use of org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader in project geotoolkit by Geomatys.
the class XmlFeatureTypeTest method testReadComplexFeatureType.
@Test
public void testReadComplexFeatureType() throws JAXBException {
final JAXBFeatureTypeReader reader = getReader(true);
final List<FeatureType> types = new ArrayList<>(reader.read(XmlFeatureTypeTest.class.getResourceAsStream("/org/geotoolkit/feature/xml/ComplexType.xsd")).getValues());
removeGMLBaseTypes(types);
assertEquals(1, types.size());
Collection<? extends PropertyType> expProperties = complexType.getProperties(false);
Collection<? extends PropertyType> resProperties = types.get(0).getProperties(false);
assertEquals(diffSizeProperties(expProperties, resProperties), expProperties.size(), resProperties.size());
FeatureComparator comparator = new FeatureComparator(complexType, types.get(0));
comparator.ignoredCharacteristics.add("http://www.w3.org/1999/xlink:href");
comparator.ignoredCharacteristics.add("http://www.w3.org/2001/XMLSchema-instance:@nil");
comparator.ignoredCharacteristics.add("mapping");
comparator.ignoreDescription = true;
comparator.compare();
}
use of org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader in project geotoolkit by Geomatys.
the class XmlFeatureTypeTest method testReadReferenceType.
@Test
public void testReadReferenceType() throws JAXBException, IOException, ParserConfigurationException, SAXException {
final JAXBFeatureTypeReader reader = getReader(true);
final List<FeatureType> types = new ArrayList<>(reader.read(XmlFeatureTypeTest.class.getResourceAsStream("/org/geotoolkit/feature/xml/ReferenceType.xsd")).getValues());
removeGMLBaseTypes(types);
assertEquals(1, types.size());
final FeatureType readType = types.get(0);
FeatureComparator comparator = new FeatureComparator(typeReference, readType);
comparator.ignoredCharacteristics.add("http://www.w3.org/1999/xlink:href");
comparator.ignoredCharacteristics.add("mapping");
comparator.ignoreDescription = true;
comparator.compare();
}
use of org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader in project geotoolkit by Geomatys.
the class XmlFeatureTypeTest method testReadVeryComplexFeatureType.
@Test
@Ignore("Random test failure due to connection timeout or when internet is not available. See #GEOTK-485")
public void testReadVeryComplexFeatureType() throws Exception {
final JAXBFeatureTypeReader reader = getReader(true);
final URL url = new URL("http://schemas.opengis.net/gml/3.1.1/base/feature.xsd");
final List<FeatureType> types = new ArrayList<>(reader.read(url).getValues());
removeGMLBaseTypes(types);
System.out.println("RESULT:" + types);
}
use of org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader in project geotoolkit by Geomatys.
the class XmlFeatureTypeTest method testReadSimpleFeatureEmpty.
@Test
public void testReadSimpleFeatureEmpty() throws JAXBException {
final JAXBFeatureTypeReader reader = getReader(true);
final List<FeatureType> types = new ArrayList<>(reader.read(XmlFeatureTypeTest.class.getResourceAsStream("/org/geotoolkit/feature/xml/SimpleTypeEmpty.xsd")).getValues());
removeGMLBaseTypes(types);
assertEquals(1, types.size());
final FeatureType readType = types.get(0);
FeatureComparator comparator = new FeatureComparator(typeEmpty, readType);
comparator.ignoredCharacteristics.add("http://www.w3.org/1999/xlink:href");
comparator.ignoredCharacteristics.add("mapping");
comparator.ignoreDescription = true;
comparator.compare();
}
use of org.geotoolkit.feature.xml.jaxb.JAXBFeatureTypeReader in project geotoolkit by Geomatys.
the class XmlFeatureTypeTest method testReadSimpleGeomFeatureType.
@Test
public void testReadSimpleGeomFeatureType() throws JAXBException {
final JAXBFeatureTypeReader reader = getReader(true);
final List<FeatureType> types = new ArrayList<>(reader.read(XmlFeatureTypeTest.class.getResourceAsStream("/org/geotoolkit/feature/xml/SimpleGeomType.xsd")).getValues());
removeGMLBaseTypes(types);
assertEquals(1, types.size());
FeatureComparator comparator = new FeatureComparator(simpleTypeGeom, types.get(0));
comparator.ignoredCharacteristics.add("http://www.w3.org/1999/xlink:href");
comparator.ignoredCharacteristics.add("mapping");
comparator.compare();
}
Aggregations