mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
fixed ordering of messages
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@155 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
7dfc244ce7
commit
45724ce974
2 changed files with 17 additions and 1 deletions
|
@ -456,8 +456,8 @@ public final class BahnProvider implements NetworkProvider
|
|||
+ "(?: <span class=\"[\\w ]*\">(?:(pünktl\\.)|ca. \\+(\\d+))</span>)?" // ontime, delay
|
||||
+ "(?: k\\.A\\.)?" //
|
||||
+ "(?:, <span class=\"red\">([^<]*)</span>)?" // message
|
||||
+ "(?:,<br/><a[^>]*><span class=\"red\">[^<]*</a></span>)?" // (ersatzzug message)
|
||||
+ "(?:(?:, )?(?:<span class=\"red\">heute )?(Gl\\. " + ParserUtils.P_PLATFORM + ")(?:\\s*</span>)?)?" // position
|
||||
+ "(?:,<br/><a[^>]*><span class=\"red\">[^<]*</a></span>)?" // (ersatzzug message)
|
||||
, Pattern.DOTALL);
|
||||
private static final Pattern P_DEPARTURES_URI_STATION_ID = Pattern.compile("input=(\\d+)");
|
||||
|
||||
|
|
|
@ -146,6 +146,22 @@ public class BahnProviderTest
|
|||
assertNotNull(m.group(6)); // message
|
||||
}
|
||||
|
||||
@Test
|
||||
public void departureWithPositionAndMessages()
|
||||
{
|
||||
final Matcher m = assertFineDepartures("" //
|
||||
+ "<a href=\"http://mobile.bahn.de/bin/mobil/traininfo.exe/dox/32967/150423/39690/8856/80/si=676819&bt=dep&ti=00:57&pt=00:57&p=1111111111&date=09.09.10&max=10&rt=1&&\">\n" //
|
||||
+ "<span class=\"bold\">RB 34075</span>\n" //
|
||||
+ "</a>\n" //
|
||||
+ ">>\n" //
|
||||
+ "Nürnberg Hbf\n" //
|
||||
+ "<br />\n" //
|
||||
+ "<span class=\"bold\">00:18</span>, <span class=\"red\">Zug fällt aus</span>, Gl. 4,<br/><a class=\"red underline\" href=\"http://mobile.bahn.de/bin/mobil/traininfo.exe/dox/843399/1026627/462944/49661/80?ld=96159&rt=1&use_realtime_filter=1&date=09.09.10&time=00:18&station_evaId=8001844&station_type=dep&\"><span class=\"red\">Ersatzzug RB 30535</a></span>");
|
||||
|
||||
assertNotNull(m.group(6)); // message
|
||||
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