WMSCapabilitiesAdapter extends XMLAdapter implements OWSCapabilitiesAdapter { public String getAddress( WMSRequestType request, boolean get ) { if ( !isOperationSupported( request ) ) { return null; } List<URL> urls; if ( get ) { urls = parseOperationsMetadata().getGetUrls( request.name() ); } else { urls = parseOperationsMetadata().getPostUrls( request.name() ); } return urls.size() > 0 ? urls.get( 0 ).toExternalForm() : null; }  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 testWMSCapabilitiesAddresses() throws XMLStreamException { WMSCapabilitiesAdapter capabilities = createCapabilities(); assertEquals( getGetGetMapUrl(), capabilities.getAddress( GetMap, true ) ); assertEquals( getPostGetMapUrl(), capabilities.getAddress( GetMap, false ) ); }
@Test public void testWMSCapabilitiesAddressesUnknownRequest() throws XMLStreamException { WMSCapabilitiesAdapter capabilities = createCapabilities(); assertNull( capabilities.getAddress( DescribeLayer, true ) ); }