@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); }
(ComplexType) typeRegistry.getAttributeType(unrestrictedTypeName); assertNotNull(unrestrictedType); assertTrue(Types.canHaveTextContent(unrestrictedType)); (ComplexType) typeRegistry.getAttributeType(restrictedTypeName); assertNotNull(restrictedType); assertFalse(Types.canHaveTextContent(restrictedType));
@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(); } }
AttributeType type = parsedTypes.getAttributeType(typeName); Assert.assertNotNull(type); Assert.assertTrue(type.getClass().getName(), type instanceof ComplexType);
ComplexType mf = (ComplexType) typeRegistry.getAttributeType(typeName); assertNotNull(mf); assertTrue(mf instanceof FeatureType); mf = (ComplexType) typeRegistry.getAttributeType(typeName); assertNotNull(mf); assertTrue(mf instanceof FeatureType);
(ComplexFeatureTypeImpl) typeRegistry.getAttributeType(typeName); assertNotNull(borehole); assertTrue(borehole instanceof FeatureType); (AttributeType) typeRegistry.getAttributeType(tcl); assertNotNull(typedCategoryListType); assertTrue(typedCategoryListType instanceof ComplexType);
final ComplexType testType = (ComplexType) typeRegistry.getAttributeType(typeName);
expectedInstanceOf = typeRegistry.getAttributeType(expectedNodeTypeName, null, crs); if (expectedInstanceOf == null) { String msg =
AttributeType type = (AttributeType) typeRegistry.getAttributeType(typeName); Assert.assertTrue(type instanceof FeatureType); Assert.assertFalse(type instanceof SimpleFeatureType); type = typeRegistry.getAttributeType(typeName); Assert.assertTrue(type instanceof ComplexType); Assert.assertFalse(type instanceof FeatureType);
/** * 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(); } }
ComplexType mf = (ComplexType) typeRegistry.getAttributeType(typeName); assertNotNull(mf); assertTrue(mf instanceof FeatureType);