typeRegistry.addSchemas(schemaIndex);
@Test public void testGML32Undeclared() { // GEOT-4756: no namespace support provided.. due to namespaces not set in // mapping file. This is legitimate if the mapping doesn't use any GML attributes. // Previously, this won't work. AppSchemaFeatureTypeRegistry registry = new AppSchemaFeatureTypeRegistry(); registry.addSchemas(schemaIndex); AttributeType type = registry.getAttributeType(BOREHOLE_TYPE); assertTrue(type instanceof FeatureType); } }
@Test public void testGML32Declared() { AppSchemaFeatureTypeRegistry registry = new AppSchemaFeatureTypeRegistry(gml32NS); registry.addSchemas(schemaIndex); AttributeType type = registry.getAttributeType(BOREHOLE_TYPE); assertTrue(type instanceof FeatureType); }
@Test public void testSimpleAttributeFromComplexDeclaration() throws Exception { String res = "/test-data/complexFeature.xsd"; URL resource = getClass().getResource(res); SchemaIndex schemaIndex = EmfComplexFeatureReader.newInstance().parse(resource); AppSchemaFeatureTypeRegistry registry = new AppSchemaFeatureTypeRegistry(); try { registry.addSchemas(schemaIndex); Name tcl = Types.typeName(NS_URI, "TypedCategoryListType"); AttributeType typedCategoryListType = registry.getAttributeType(tcl); Assert.assertNotNull(typedCategoryListType); Assert.assertTrue(typedCategoryListType instanceof ComplexType); AttributeType superType = typedCategoryListType.getSuper(); Assert.assertNotNull(superType); Name superName = superType.getName(); Assert.assertEquals(XS.STRING.getNamespaceURI(), superName.getNamespaceURI()); Assert.assertEquals(XS.STRING.getLocalPart(), superName.getLocalPart()); Assert.assertNotNull(typedCategoryListType.getUserData().get(XSDTypeDefinition.class)); } finally { registry.disposeSchemaIndexes(); } }
parsedTypes.addSchemas(schemaIndex);
typeRegistry.addSchemas(schemaIndex);
typeRegistry.addSchemas(schemaIndex);
typeRegistry.addSchemas(schemaIndex);
typeRegistry.addSchemas(schemaIndex);
/** * Tests if the schema-to-FM parsing code developed for complex data store configuration loading * can parse the GeoSciML types * * @throws Exception */ @Test public void testParseSchema() throws Exception { SchemaIndex schemaIndex = loadSchema("http://schemas.opengis.net/GeoSciML/Gsml.xsd"); AppSchemaFeatureTypeRegistry typeRegistry = new AppSchemaFeatureTypeRegistry(); try { typeRegistry.addSchemas(schemaIndex); Name typeName = Types.typeName(GSMLNS, "GeologicUnitType"); ComplexType mf = (ComplexType) typeRegistry.getAttributeType(typeName); assertNotNull(mf); assertTrue(mf instanceof FeatureType); AttributeType superType = mf.getSuper(); assertNotNull(superType); Name superTypeName = Types.typeName(GSMLNS, "GeologicFeatureType"); assertEquals(superTypeName, superType.getName()); assertTrue(superType instanceof FeatureType); } finally { typeRegistry.disposeSchemaIndexes(); } }
typeRegistry.addSchemas(schemaIndex);
typeRegistry.addSchemas(schemaIndex);