import static org.junit.Assert.assertTrue;

import java.util.HashSet;

import org.alternativevision.gpx.beans.Route;
import org.alternativevision.gpx.beans.Waypoint;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import uk.co.ordnancesurvey.gpx.extensions.ExtensionConstants;
import uk.co.ordnancesurvey.gpx.graphhopper.GraphHopperGPXParserRouteTest;

public class GPHRouteTest {

	private static final Logger LOG = LoggerFactory
			.getLogger(GPHRouteTest.class);
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Ignore
	public void testrouteContainsTurn() {
		String path = getClass().getResource("sampleGraphHopper.gpx").getPath();
		GraphHopperGPXParserRouteTest ghrt = GraphHopperGPXParserRouteTest.getParserForgpxFileName(path);
		HashSet<Route> hs = ghrt.getRoutes();
		String turn = "turn sharp right onto Bellemoor Road";
		
		assertTrue(ghrt.routeContainsTurn(turn, hs.iterator().next()));
	}

	@Ignore
	public void testWayPointIsOnRoute() {
		
		String path = getClass().getResource("sampleGraphHopper.gpx").getPath();
		GraphHopperGPXParserRouteTest ghrt = GraphHopperGPXParserRouteTest.getParserForgpxFileName(path);
		Waypoint wayPoint = getTestWayPoint();
		HashSet<Route> hs = ghrt.getRoutes();
		
		assertTrue(ghrt.isWayPointOnRoute(wayPoint,hs.iterator().next()));
	}
	
	@Test
	public void testTotalRouteTime() {
		String path = getClass().getResource("sampleGraphHopper.gpx").getPath();
		GraphHopperGPXParserRouteTest ghrt = GraphHopperGPXParserRouteTest.getParserForgpxFileName(path);
		ghrt.getTotalRouteTime();
		assertTrue(true);
	}
	
	@Test
	public void testGetRouteAsGPX() {
		LOG.info("Starting To Test");
		GraphHopperGPXParserRouteTest ghrt = new GraphHopperGPXParserRouteTest();
		String gpxString = ghrt.parseRoute("50.93602556772844,-1.4194250106811523,50.92544987854478,-1.389212608337402", "gpx", "car");
		
		LOG.info(gpxString);
		HashSet<Route> hs = ghrt.getRoutes();
		
		assertTrue(ghrt.routeContainsTurn("turn sharp right onto ROCKLEIGH ROAD",hs.iterator().next()));
	}

	private Waypoint getTestWayPoint() {
		
		Waypoint wp = new Waypoint();
		wp.setLatitude(new Double(50.927146));
		wp.setLongitude(new Double(-1.416787));
		wp.addExtensionData(ExtensionConstants.AZIMUTH, "339");
		wp.addExtensionData(ExtensionConstants.DIRECTION, "N");
		wp.addExtensionData(ExtensionConstants.TIME, "2515");
		wp.addExtensionData(ExtensionConstants.DISTANCE, "13.974");
		
		return wp;
	}
}

@@ -1,12 +1,57 @@
+import static org.junit.Assert.assertEquals;%0A
 import stati
@@ -333,94 +333,12 @@
 nit.
-Ignore;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory
+Test
 ;%0A%0Ai
@@ -508,94 +508,8 @@
  %7B%0A%0A
-%09private static final Logger LOG = LoggerFactory%0A%09%09%09.getLogger(GPHRouteTest.class);%0A%09%0A
 %09@Be
@@ -768,22 +768,20 @@
 %0A%09%7D%0A%09%0A%09@
-Ignore
+Test
 %0A%09public
@@ -1162,14 +1162,12 @@
 %0A%0A%09@
-Ignore
+Test
 %0A%09pu
@@ -1758,16 +1758,37 @@
 ath);%0A%09%09
+assertEquals(269000, 
 ghrt.get
@@ -1807,27 +1807,8 @@
 me()
-;%0A%09%09assertTrue(true
 );%0A%09
@@ -1859,35 +1859,78 @@
 %7B%0A%09%09
-LOG.info(%22Starting To Test%22
+String path = getClass().getResource(%22sampleGraphHopper.gpx%22).getPath(
 );%0A%09
@@ -1966,20 +1966,16 @@
 t ghrt =
- new
  GraphHo
@@ -2000,165 +2000,37 @@
 Test
-();%0A%09%09String gpxString = ghrt.parseRoute(%2250.93602556772844,-1.4194250106811523,50.92544987854478,-1.389212608337402%22, %22gpx%22, %22car%22);%0A%09%09%0A%09%09LOG.info(gpxString
+.getParserForgpxFileName(path
 );%0A%09
@@ -2063,32 +2063,69 @@
 getRoutes();%0A%09%09%0A
+%09%09Route next = hs.iterator().next();%0A
 %09%09assertTrue(ghr
@@ -2171,44 +2171,28 @@
 nto 
-ROCKLEIGH ROAD%22,hs.iterator().
+Bellemoor Road%22,
 next
-()
 ));%0A

Enable tests which were left to be ignored.