mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
migrated Germany to binary connections query
This commit is contained in:
parent
8123974b3e
commit
afc4b4b096
10 changed files with 38 additions and 407 deletions
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* Copyright 2010-2012 the original author or authors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class BahnProviderTest
|
||||
{
|
||||
@Test
|
||||
public void connectionUebergang()
|
||||
{
|
||||
assertFineConnectionDetails("" //
|
||||
+ "<span class=\"bold\">Berlin Hbf</span><br />\n" //
|
||||
+ "Übergang\n" //
|
||||
+ "<br />\n" //
|
||||
+ "<span class=\"bold\">Berlin-Lichtenberg</span><br />\n");
|
||||
}
|
||||
|
||||
private void assertFineConnectionDetails(final String s)
|
||||
{
|
||||
Matcher m = BahnProvider.P_CONNECTION_DETAILS_FINE.matcher(s);
|
||||
assertTrue(m.matches());
|
||||
|
||||
// ParserUtils.printGroups(m);
|
||||
}
|
||||
}
|
|
@ -25,7 +25,6 @@ import org.junit.Test;
|
|||
import de.schildbach.pte.BahnProvider;
|
||||
import de.schildbach.pte.NetworkProvider.Accessibility;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.dto.Connection;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -89,8 +88,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
LocationType.STATION, 8010205, null, "Leipzig Hbf"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
for (final Connection connection : result.connections)
|
||||
provider.getConnectionDetails(connection);
|
||||
System.out.println(laterResult);
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
@ -108,8 +105,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
for (final Connection connection : result.connections)
|
||||
provider.getConnectionDetails(connection);
|
||||
System.out.println(laterResult);
|
||||
}
|
||||
|
||||
|
@ -122,8 +117,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
System.out.println(result);
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
for (final Connection connection : result.connections)
|
||||
provider.getConnectionDetails(connection);
|
||||
System.out.println(laterResult);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue