WMSCapabilitiesAdapter extends XMLAdapter implements OWSCapabilitiesAdapter { public Tree<LayerMetadata> getLayerTree() { return layerTree; }  LinkedList<String> getFormats( WMSRequestType request ); String getAddress( WMSRequestType request, boolean get ); Envelope getBoundingBox( String srs, String layer ); List<String> getNamedLayers(); boolean hasLayer( String name ); LinkedList<String> getCoordinateSystems( String layer ); LayerMetadata getLayer( String name ); Envelope getLatLonBoundingBox( String layer ); Envelope getLatLonBoundingBox( List<String> layers ); Tree<LayerMetadata> getLayerTree(); boolean isOperationSupported( WMSRequestType request ); @Override List<String> parseLanguages(); @Override ServiceProvider parseServiceProvider(); @Override ServiceIdentification parseServiceIdentification(); @Override OperationsMetadata parseOperationsMetadata(); OMElement getExtendedCapabilities( String prefix, String localName, String namespaceUri ); void parseWMSSpecificCapabilities( OperationsMetadata operationsMetadata );  }
@Test public void testWMSCapabilitiesLayerTree() throws XMLStreamException, UnknownCRSException { WMSCapabilitiesAdapter capabilities = createCapabilities(); Tree<LayerMetadata> layerTree = capabilities.getLayerTree(); LayerMetadata rootLayer = layerTree.value; assertNull( rootLayer.getName() ); Description description = rootLayer.getDescription(); assertEquals( "deegree demo WMS", description.getAbstract( null ).getString() ); List<Tree<LayerMetadata>> children = layerTree.children; assertEquals( getNoOfChildrenOfRootLayer(), children.size() ); }
@Test public void testWMSCapabilitiesLayerMetadataUrl() throws XMLStreamException { WMSCapabilitiesAdapter capabilities = createCapabilities(); LayerMetadata rootLayer = capabilities.getLayerTree().value; List<MetadataUrl> metadataUrls = rootLayer.getMetadataUrls(); assertEquals( 1, metadataUrls.size() ); MetadataUrl metadataUrl = metadataUrls.get( 0 ); assertEquals( "http: assertEquals( "TC211", metadataUrl.getType() ); assertEquals( "text/html", metadataUrl.getFormat() ); }