Update API base for Hannover & Lower Saxony.

This commit is contained in:
Andreas Schildbach 2015-01-17 16:28:54 +01:00
parent f0b071bb62
commit 7dd49cf0ee
2 changed files with 5 additions and 52 deletions

View file

@ -28,7 +28,10 @@ import de.schildbach.pte.dto.Style;
public class GvhProvider extends AbstractEfaProvider
{
public static final NetworkId NETWORK_ID = NetworkId.GVH;
private static final String API_BASE = "http://mobil.efa.de/mobile3/";
private static final String API_BASE = "http://bhb.efa.de/bhb/";
// http://bhb.efa.de/bhb/
// http://mobil.efa.de/mobile3/
public GvhProvider(final String additionalQueryParameter)
{
@ -36,6 +39,7 @@ public class GvhProvider extends AbstractEfaProvider
setAdditionalQueryParameter(additionalQueryParameter);
setStyles(STYLES);
setSessionCookieName("HASESSIONID");
}
public NetworkId id()
@ -43,47 +47,6 @@ public class GvhProvider extends AbstractEfaProvider
return NETWORK_ID;
}
@Override
protected boolean hasCapability(final Capability capability)
{
if (capability == Capability.SUGGEST_LOCATIONS)
return false;
else
return super.hasCapability(capability);
}
@Override
protected String parseLine(final String mot, final String symbol, final String name, final String longName, final String trainType,
final String trainNum, final String trainName)
{
if ("0".equals(mot))
{
if ("S1".equals(symbol))
return "SS1";
if ("S11".equals(symbol))
return "SS11";
if ("S2".equals(symbol))
return "SS2";
if ("S21".equals(symbol))
return "SS21";
if ("S3".equals(symbol))
return "SS3";
if ("S31".equals(symbol))
return "SS31";
if ("U1".equals(symbol))
return "UU1";
if ("U2".equals(symbol))
return "UU2";
if ("U3".equals(symbol))
return "UU3";
if ("U4".equals(symbol))
return "UU4";
}
return super.parseLine(mot, symbol, name, longName, trainType, trainNum, trainName);
}
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
static

View file

@ -18,7 +18,6 @@
package de.schildbach.pte.live;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Date;
@ -27,7 +26,6 @@ import org.junit.Test;
import de.schildbach.pte.GvhProvider;
import de.schildbach.pte.NetworkProvider.Accessibility;
import de.schildbach.pte.NetworkProvider.Capability;
import de.schildbach.pte.NetworkProvider.WalkSpeed;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
@ -47,14 +45,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
super(new GvhProvider(null));
}
@Test
public void capabilities() throws Exception
{
assertTrue(provider.hasCapabilities(Capability.NEARBY_STATIONS, Capability.DEPARTURES));
assertFalse(provider.hasCapabilities(Capability.SUGGEST_LOCATIONS, Capability.TRIPS));
assertFalse(provider.hasCapabilities(Capability.DEPARTURES, Capability.TRIPS));
}
@Test
public void nearbyStations() throws Exception
{