use of eu.esdihumboldt.hale.io.geoserver.Namespace in project hale by halestudio.
the class NamespaceResourceTest method testSerializeIsolated.
/**
* Tests the correct serialization of a namespace resource whose
* {@code isolated} attribute is set to {@code true}.
*
* @throws Exception if an error occurs parsing the resource as XML
*/
@Test
public void testSerializeIsolated() throws Exception {
Namespace testNamespace = ResourceBuilder.namespace(TEST_PREFIX).setAttribute(Namespace.URI, TEST_URI).setAttribute(Namespace.ISOLATED, true).build();
Document doc = parseResource(testNamespace);
assertEquals(1, doc.getElementsByTagName(ELEMENT_NAMESPACE).getLength());
Node namespaceEl = doc.getElementsByTagName(ELEMENT_NAMESPACE).item(0);
Map<String, String> expectedValues = new HashMap<>();
expectedValues.put(ELEMENT_PREFIX, TEST_PREFIX);
expectedValues.put(ELEMENT_URI, TEST_URI);
expectedValues.put(ELEMENT_ISOLATED, "true");
checkResource(namespaceEl, expectedValues);
}
Aggregations