final QName typeName = CiteTestData.STREAMS;
// make sure typeName _is_ in the default namespace
Catalog catalog = getCatalog();
NamespaceInfo defaultNs = catalog.getDefaultNamespace();
GeoServer geoServer = getGeoServer();
WFSInfo service = geoServer.getService(WFSInfo.class);
try {
// make sure typeName _is_ in the default namespace
catalog.setDefaultNamespace(catalog.getNamespaceByURI(typeName.getNamespaceURI()));
FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());
typeInfo.setEnabled(true);
catalog.save(typeInfo);
DataStoreInfo store = typeInfo.getStore();
store.setEnabled(true);
catalog.save(store);
// and request typeName without prefix
String path = "ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName="
+ typeName.getLocalPart();
Document doc;
//first, non cite compliant mode should find the type even if namespace is not specified
service.setCiteCompliant(false);
geoServer.save(service);
doc = getAsDOM(path);
print(doc);
assertSchema(doc, typeName);
//then, in cite compliance more, it should not find the type name
service.setCiteCompliant(true);
geoServer.save(service);
doc = getAsDOM(path);
//print(doc);
assertEquals("ows:ExceptionReport", doc.getDocumentElement().getNodeName());
} finally {
catalog.setDefaultNamespace(defaultNs);
service.setCiteCompliant(false);
geoServer.save(service);
}
}