mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@5 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
e0f25c467b
commit
b809336727
1 changed files with 55 additions and 0 deletions
55
test/de/schildbach/pte/VbbProviderTest.java
Normal file
55
test/de/schildbach/pte/VbbProviderTest.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class VbbProviderTest
|
||||
{
|
||||
@Test
|
||||
public void fusswegWithSpace()
|
||||
{
|
||||
assertFineConnectionDetails("6 Min. Fussweg<br /><a href=\"/Fahrinfo/bin/stboard.bin/dox?ld=0.1&n=2&i=00.072331.1278280801&rt=0&input=9024106\">"
|
||||
+ "<strong>S Messe Nord/ICC (Berlin)</strong> </a><br />");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fussweg()
|
||||
{
|
||||
assertFineConnectionDetails("<a href=\"/Stadtplan/index/mobil?language=d&location=,ADR,WGS84,13426558,52536061&label=10405 Bln Pankow, Christburger Str. 123\">10405 Bln Pankow, Christburger Str. 123</a>\n"
|
||||
+ "<br />\n"
|
||||
+ "10 Min.\n"
|
||||
+ "Fussweg\n"
|
||||
+ "<br />\n"
|
||||
+ "<a href=\"/Fahrinfo/bin/stboard.bin/dox?ld=0.1&n=2&i=c6.0318411.1278336553&rt=0&input=9110017\">\n"
|
||||
+ "<strong>Prenzlauer Allee/Danziger Str. (Berlin)</strong>\n" + "</a>\n" + "<br />");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void trip()
|
||||
{
|
||||
assertFineConnectionDetails("<a href=\"/Fahrinfo/bin/stboard.bin/dox?ld=0.1&n=2&i=er.042611.1278315324&rt=0&input=9275402\">\n"
|
||||
+ "<strong>Brandenburg, Frhr.-v.-Thüngen-Str.</strong>\n"
|
||||
+ "</a>\n"
|
||||
+ "<br />\n"
|
||||
+ "ab 09:35\n"
|
||||
+ "<br/><strong>BusH/528</strong>\n"
|
||||
+ "Ri. Brandenburg, Potsdamer Str.\n"
|
||||
+ "<br />\n"
|
||||
+ "an 09:41\n"
|
||||
+ "<br />\n"
|
||||
+ "<a href=\"/Fahrinfo/bin/stboard.bin/dox?ld=0.1&n=2&i=er.042611.1278315324&rt=0&input=9275104\">\n"
|
||||
+ "<strong>Brandenburg, Plauer Str.</strong>\n" //
|
||||
+ "</a>\n" //
|
||||
+ "<br />");
|
||||
}
|
||||
|
||||
private void assertFineConnectionDetails(String s)
|
||||
{
|
||||
Matcher m = VbbProvider.P_CONNECTION_DETAILS_FINE.matcher(s);
|
||||
assertTrue(m.matches());
|
||||
// ParserUtils.printGroups(m);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue