mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 15:48:49 +00:00
parse 'sonderzug'
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@167 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
ca8a410e01
commit
fab1f8f8ef
2 changed files with 18 additions and 1 deletions
|
@ -465,6 +465,7 @@ public final class BahnProvider implements NetworkProvider
|
|||
+ "(?:(?:, )?(?:<span class=\"red\">heute )?(Gl\\. " + ParserUtils.P_PLATFORM + ")(?:\\s*</span>)?)?" // position
|
||||
+ "(?:,<br/><a[^>]*><span class=\"red\">[^<]*</a></span>)?" // (ersatzzug message)
|
||||
+ "(?:,<br/><span class=\"red\">[^<]*<a[^>]*>[^<]*</a></span>)?" // (ersatzzug message)
|
||||
+ "(?:,<br/> <span class=\"red\">[^<]*</span>)?" // (sonderzug message)
|
||||
, Pattern.DOTALL);
|
||||
private static final Pattern P_DEPARTURES_URI_STATION_ID = Pattern.compile("input=(\\d+)");
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ public class BahnProviderTest
|
|||
@Test
|
||||
public void departureWithMultipleMessages()
|
||||
{
|
||||
final Matcher m = assertFineDepartures(""//
|
||||
final Matcher m = assertFineDepartures("" //
|
||||
+ "<a href=\"http://mobile.bahn.de/bin/mobil/traininfo.exe/dox/66819/191058/790068/372764/80/si=445675&bt=dep&ti=10:44&pt=10:44&p=1111111111&date=15.09.10&max=10&rt=1&&\">\n" //
|
||||
+ "<span class=\"bold\">S 11</span>\n" //
|
||||
+ "</a>\n" //
|
||||
|
@ -199,6 +199,22 @@ public class BahnProviderTest
|
|||
assertNotNull(m.group(7)); // position
|
||||
}
|
||||
|
||||
@Test
|
||||
public void departureSonderzug()
|
||||
{
|
||||
final Matcher m = assertFineDepartures("" //
|
||||
+ "<a href=\"http://mobile.bahn.de/bin/mobil/traininfo.exe/dox/656949/964945/873914/217974/80/si=675348&bt=dep&ti=22:16&pt=22:16&p=1111111111&date=16.09.10&max=50&rt=1&&\">\n" //
|
||||
+ "<span class=\"bold\">RE 30534</span>\n" //
|
||||
+ "</a>\n" //
|
||||
+ ">>\n" //
|
||||
+ "Nürnberg Hbf\n" //
|
||||
+ "<br />\n" //
|
||||
+ "<span class=\"bold\">22:58</span> <span class=\"green bold\">pünktl.</span>, Gl. 2,<br/> <span class=\"red\">Sonderzug</span>");
|
||||
|
||||
assertNotNull(m.group(4)); // onTime
|
||||
assertNotNull(m.group(7)); // position
|
||||
}
|
||||
|
||||
private void assertFineConnectionDetails(String s)
|
||||
{
|
||||
Matcher m = BahnProvider.P_CONNECTION_DETAILS_FINE.matcher(s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue