Examples of GpxType


Examples of slash.navigation.gpx.binding11.GpxType

            throw new JAXBException("Error while marshalling: " + e, e);
        }
    }

    public static GpxType createGpxType() {
        GpxType gpxType = new slash.navigation.gpx.binding11.ObjectFactory().createGpxType();
        gpxType.setCreator("RouteConverter");
        gpxType.setVersion("1.1");
        return gpxType;
    }
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

        ExtensionsType extensionsType = objectFactory.createExtensionsType();
        extensionsType.getAny().add(userextensionType);
        metadataType.setExtensions(extensionsType);

        GpxType gpxType = GpxUtil.createGpxType();
        gpxType.setMetadata(metadataType);

        return GpxUtil.toXml(gpxType);
    }
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

    }

    @Test
    public void testUnmarshal11() throws IOException, JAXBException {
        Reader reader = new FileReader(TEST_PATH + "from11.gpx");
        GpxType gpx = GpxUtil.unmarshal11(reader);
        assertNotNull(gpx);
        assertNotNull(gpx.getWpt());
        assertEquals(3, gpx.getWpt().size());
    }
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

    }

    @Test
    public void testWritingNamespaces() throws IOException, JAXBException {
        Reader reader = new FileReader(TEST_PATH + "from11.gpx");
        GpxType gpx = GpxUtil.unmarshal11(reader);
        assertNotNull(gpx);
        StringWriter writer = new StringWriter();
        GpxUtil.marshal11(gpx, writer);
        String string = writer.toString();
        assertTrue(string.contains("<gpx"));
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

        UserextensionType userExtensionType = rcFactory.createUserextensionType();
        userExtensionType.setFirstname("FIRST");
        slash.navigation.gpx.binding11.ObjectFactory gpxFactory = new slash.navigation.gpx.binding11.ObjectFactory();
        ExtensionsType extensionsType = gpxFactory.createExtensionsType();
        extensionsType.getAny().add(userExtensionType);
        GpxType gpx = gpxFactory.createGpxType();
        gpx.setCreator("CREATOR");
        gpx.setExtensions(extensionsType);
        assertNotNull(gpx);
        StringWriter writer = new StringWriter();
        GpxUtil.marshal11(gpx, writer);
        String string = writer.toString();
        assertTrue(string.contains("<gpx creator=\"CREATOR\""));
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

    public void testWritingTrekBuddyExtensions() throws IOException, JAXBException {
        slash.navigation.gpx.binding11.ObjectFactory gpxFactory = new slash.navigation.gpx.binding11.ObjectFactory();
        slash.navigation.gpx.trekbuddy.ObjectFactory tbFactory = new slash.navigation.gpx.trekbuddy.ObjectFactory();
        ExtensionsType extensionsType = gpxFactory.createExtensionsType();
        extensionsType.getAny().add(tbFactory.createSpeed(formatBigDecimal(123.45, 2)));
        GpxType gpx = gpxFactory.createGpxType();
        assertNotNull(gpx);
        gpx.setExtensions(extensionsType);
        assertNotNull(gpx);
        StringWriter writer = new StringWriter();
        GpxUtil.marshal11(gpx, writer);
        String string = writer.toString();
        assertTrue(string.contains("<nmea:speed>123.45</nmea:speed>"));
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

    }

    public void read(InputStream source, CompactCalendar startDate, ParserContext<GpxRoute> context) throws Exception {
        InputStreamReader reader = new InputStreamReader(source);
        try {
            GpxType gpxType = unmarshal11(reader);
            process(gpxType, context);
        } finally {
            reader.close();
        }
    }
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

        HttpRequest request2 = readCategory(key);
        String result2 = request2.executeAsString();
        assertEquals(200, request2.getStatusCode());
        assertTrue(request2.isSuccessful());

        GpxType gpxType = GpxUtil.unmarshal11(result2);
        assertNotNull(gpxType);
        assertEquals("Interesting", gpxType.getMetadata().getName());
        assertEquals(USERNAME, gpxType.getMetadata().getAuthor().getName());
        assertEquals(USERS_URL + USERNAME + GPX_URL_POSTFIX, gpxType.getMetadata().getAuthor().getLink().getHref());
        assertNull(gpxType.getMetadata().getDesc());
        assertEquals(0, gpxType.getMetadata().getLink().size());
    }
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

        HttpRequest request1 = readCategory("");
        String result1 = request1.executeAsString();
        assertEquals(200, request1.getStatusCode());
        assertTrue(request1.isSuccessful());

        GpxType gpxType = GpxUtil.unmarshal11(result1);
        assertNotNull(gpxType);
        assertEquals("", gpxType.getMetadata().getName());
        assertEquals(USERNAME, gpxType.getMetadata().getAuthor().getName());
        assertEquals(USERS_URL + USERNAME + GPX_URL_POSTFIX, gpxType.getMetadata().getAuthor().getLink().getHref());
        assertNull(gpxType.getMetadata().getDesc());
        assertTrue(gpxType.getMetadata().getLink().size() > 0);
    }
View Full Code Here

Examples of slash.navigation.gpx.binding11.GpxType

        HttpRequest request2 = readCategory(key);
        String result2 = request2.executeAsString();
        assertEquals(200, request2.getStatusCode());
        assertTrue(request2.isSuccessful());

        GpxType gpxType = GpxUtil.unmarshal11(result2);
        assertNotNull(gpxType);
        assertEquals(name, gpxType.getMetadata().getName());
        assertEquals(USERNAME, gpxType.getMetadata().getAuthor().getName());
        assertEquals(USERS_URL + USERNAME + GPX_URL_POSTFIX, gpxType.getMetadata().getAuthor().getLink().getHref());
        assertNull(gpxType.getMetadata().getDesc());
        assertEquals(0, gpxType.getMetadata().getLink().size());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.