fixed footways without link

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@53 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-08-08 19:50:54 +00:00
parent 515dbf7b13
commit af646c7e79
2 changed files with 29 additions and 11 deletions

View file

@ -306,7 +306,7 @@ public final class VbbProvider implements NetworkProvider
+ "(\\d+) Min\\.[\n\\s]?" // footway
+ "Fussweg\n?" //
+ ".*?(?:<a href=\"/Fahrinfo.*?input=(\\d+)\">\n?" // arrivalId
+ "<strong>(.*?)</strong>|<a href=\"/Stadtplan.*?\">(\\w.*?)</a>).*?" // arrival
+ "<strong>(.*?)</strong>|<a href=\"/Stadtplan.*?\">(\\w.*?)</a>|<strong>(.*?)</strong>).*?" // arrival
+ ").*?", Pattern.DOTALL);
public GetConnectionDetailsResult getConnectionDetails(final String uri) throws IOException
@ -387,7 +387,7 @@ public final class VbbProvider implements NetworkProvider
{
final int arrivalId = mDetFine.group(12) != null ? Integer.parseInt(mDetFine.group(12)) : 0;
final String arrival = ParserUtils.resolveEntities(selectNotNull(mDetFine.group(13), mDetFine.group(14)));
final String arrival = ParserUtils.resolveEntities(selectNotNull(mDetFine.group(13), mDetFine.group(14), mDetFine.group(15)));
if (parts.size() > 0 && parts.get(parts.size() - 1) instanceof Connection.Footway)
{

View file

@ -29,14 +29,7 @@ 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&amp;n=2&amp;i=00.072331.1278280801&amp;rt=0&amp;input=9024106\">"
+ "<strong>S Messe Nord/ICC (Berlin)</strong> </a><br />");
}
@Test
public void fussweg()
public void footwayWithLink()
{
assertFineConnectionDetails("<a href=\"/Stadtplan/index/mobil?language=d&amp;location=,ADR,WGS84,13426558,52536061&amp;label=10405 Bln Pankow, Christburger Str. 123\">10405 Bln Pankow, Christburger Str. 123</a>\n"
+ "<br />\n"
@ -44,7 +37,32 @@ public class VbbProviderTest
+ "Fussweg\n"
+ "<br />\n"
+ "<a href=\"/Fahrinfo/bin/stboard.bin/dox?ld=0.1&amp;n=2&amp;i=c6.0318411.1278336553&amp;rt=0&amp;input=9110017\">\n"
+ "<strong>Prenzlauer Allee/Danziger Str. (Berlin)</strong>\n" + "</a>\n" + "<br />");
+ "<strong>Prenzlauer Allee/Danziger Str. (Berlin)</strong>\n" //
+ "</a>\n" //
+ "<br />");
}
@Test
public void footwayWithoutLink()
{
assertFineConnectionDetails("18 Min.\n" //
+ "Fussweg\n" //
+ "<br />\n" //
+ "<strong>Berlin, Deutschlandhalle</strong>\n" //
+ "<br/>Messedamm 26; 14055 Berlin\n" //
+ "<br />"); //
}
@Test
public void footwayStripped()
{
assertFineConnectionDetails("6 Min. " //
+ "Fussweg" //
+ "<br />" //
+ "<a href=\"/Fahrinfo/bin/stboard.bin/dox?ld=0.1&amp;n=2&amp;i=00.072331.1278280801&amp;rt=0&amp;input=9024106\">" //
+ "<strong>S Messe Nord/ICC (Berlin)</strong> "//
+ "</a>" //
+ "<br />");
}
@Test