@Test public void statesFeatureV110() throws Exception { LayerSchemaDTO layerSchema = wfsService.describeFeatureType(addressDatastore, TOPP_STATES.getLocalPart()); logger.info("\n\n\n@@@ {}", layerSchema); Assert.assertNotNull(layerSchema); Assert.assertEquals(TOPP_STATES.getLocalPart(), layerSchema.getTypeName()); Assert.assertEquals(TOPP_STATES.getNamespaceURI(), layerSchema.getTargetNamespace()); Assert.assertEquals(addressDatastore, layerSchema.getScope()); AttributeDTO geometry = layerSchema.getGeometry(); Assert.assertNotNull(geometry); Assert.assertEquals("the_geom", geometry.getName()); Assert.assertEquals("MultiPolygon", geometry.getType()); List<AttributeDTO> attributes = layerSchema.getAttributes(); Assert.assertNotNull(attributes); Assert.assertEquals(22, attributes.size()); for (AttributeDTO attribute : attributes) { Assert.assertNotNull(attribute); Assert.assertNotNull(attribute.getName()); Assert.assertNotNull(attribute.getType()); Assert.assertTrue(attribute.isNillable()); Assert.assertEquals(0, attribute.getMinOccurs()); Assert.assertEquals(1, attribute.getMaxOccurs()); } }
public static AttributeDTO convert(AttributeDetail attribute) { AttributeDTO attributeDTO = new AttributeDTO(); attributeDTO.setName(attribute.getName()); attributeDTO.setValue(attribute.getValue()); attributeDTO.setType(attribute.getType()); attributeDTO.setMaxOccurs(attribute.getMaxOccurs()); attributeDTO.setMinOccurs(attribute.getMinOccurs()); attributeDTO.setNillable(attribute.isNillable()); return attributeDTO; }
public static AttributeDetail convert(AttributeDTO attributeDTO) { AttributeDetail attribute = new AttributeDetail(); attribute.setName(attributeDTO.getName()); attribute.setValue(attributeDTO.getValue() == null ? "" : attributeDTO.getValue()); attribute.setType(attributeDTO.getType()); attribute.setMaxOccurs(attributeDTO.getMaxOccurs()); attribute.setMinOccurs(attributeDTO.getMinOccurs()); attribute.setNillable(attributeDTO.isNillable()); return attribute; }
@Test public void comuniFeatureV110() throws Exception { LayerSchemaDTO layerSchema = wfsService.describeFeatureType(addressDatastore, SF_COMUNI.getLocalPart()); logger.info("\n\n\n@@@ {}", layerSchema); Assert.assertNotNull(layerSchema); Assert.assertEquals(SF_COMUNI.getLocalPart(), layerSchema.getTypeName()); Assert.assertEquals(SF_COMUNI.getNamespaceURI(), layerSchema.getTargetNamespace()); Assert.assertEquals(addressDatastore, layerSchema.getScope()); AttributeDTO geometry = layerSchema.getGeometry(); Assert.assertNotNull(geometry); Assert.assertEquals("the_geom", geometry.getName()); Assert.assertEquals("MultiPolygon", geometry.getType()); List<AttributeDTO> attributes = layerSchema.getAttributes(); Assert.assertNotNull(attributes); Assert.assertEquals(10, attributes.size()); for (AttributeDTO attribute : attributes) { Assert.assertNotNull(attribute); Assert.assertNotNull(attribute.getName()); Assert.assertNotNull(attribute.getType()); } }