now supporting all gpx files with both tracks and routes.
[utils] / gps / src / test / java / org / wamblee / gpx / GpxParserTest.java
1 package org.wamblee.gpx;
2
3 import java.io.IOException;
4
5 import org.wamblee.gps.track.Track;
6 import org.wamblee.io.ClassPathResource;
7 import org.wamblee.xml.XMLException;
8
9 import junit.framework.TestCase;
10
11 public class GpxParserTest extends TestCase {
12
13         /**
14          * Tests parsing of a GPS file received by Payne Freret. 
15          */
16         public void testNoJoy() throws IOException, XMLException { 
17                 GpxParser parser = new GpxParser();
18                 Track track = parser.parse(new ClassPathResource("nojoy.gpx").getInputStream());
19                 assertEquals(468, track.size());
20         }
21         
22         public void testParseRoute() throws Exception { 
23             GpxParser parser = new GpxParser();
24         Track track = parser.parse(new ClassPathResource("mh2d.route.gpx").getInputStream());
25         assertEquals(250, track.size());
26         }
27 }