WMSCapabilitiesAdapter extends XMLAdapter implements OWSCapabilitiesAdapter { @Override public OperationsMetadata parseOperationsMetadata() throws XMLParsingException { OMElement requestEl = getElement( getRootElement(), new XPath( getPrefix() + "Capability/" + getPrefix() + "Request", nsContext ) ); if ( requestEl == null ) { return null; } XPath xpath = new XPath( "./*", nsContext ); List<OMElement> opEls = getElements( requestEl, xpath ); List<Operation> operations = new ArrayList<Operation>( opEls.size() ); if ( opEls != null ) { for ( OMElement opEl : opEls ) { Operation op = parseOperation( opEl ); operations.add( op ); } } return new OperationsMetadata( operations, new ArrayList<Domain>(), new ArrayList<Domain>(), new ArrayList<OMElement>() ); }  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 testWMSCapabilitiesOperationsMetadata() throws XMLStreamException { WMSCapabilitiesAdapter capabilities = createCapabilities(); OperationsMetadata operationsMetadata = capabilities.parseOperationsMetadata(); List<Operation> operations = operationsMetadata.getOperation(); assertEquals( 4, operations.size() ); Operation getMapOperation = operationsMetadata.getOperation( "GetMap" ); List<URL> getUrls = getMapOperation.getGetUrls(); assertEquals( 1, getUrls.size() ); assertEquals( getGetGetMapUrl(), getUrls.get( 0 ).toExternalForm() ); List<URL> postUrls = getMapOperation.getPostUrls(); assertEquals( 1, postUrls.size() ); assertEquals( getPostGetMapUrl(), postUrls.get( 0 ).toExternalForm() ); List<DCP> dcps = getMapOperation.getDCPs(); assertEquals( 1, dcps.size() ); DCP dcp = dcps.get( 0 ); List<Pair<URL, List<Domain>>> getEndpoints = dcp.getGetEndpoints(); assertEquals( 1, getEndpoints.size() ); assertEquals( getGetGetMapUrl(), getEndpoints.get( 0 ).getFirst().toExternalForm() ); List<Pair<URL, List<Domain>>> postEndpoints = dcp.getPostEndpoints(); assertEquals( 1, postEndpoints.size() ); assertEquals( getPostGetMapUrl(), postEndpoints.get( 0 ).getFirst().toExternalForm() ); }