DefaultOWSMetadataProvider implements OWSMetadataProvider { @Override public List<DatasetMetadata> getAllDatasetMetadata( QName name ) { List<DatasetMetadata> datasetMetadata = new ArrayList<DatasetMetadata>(); List<DatasetMetadata> mds = datasetNameToMetadata.get( name ); if ( mds == null || mds.isEmpty() ) { for ( Entry<QName, List<DatasetMetadata>> e : datasetNameToMetadata.entrySet() ) { if ( e.getKey().getLocalPart().equalsIgnoreCase( name.getLocalPart() ) ) { datasetMetadata.addAll( e.getValue() ); } } } else { datasetMetadata.addAll( mds ); } return datasetMetadata; } DefaultOWSMetadataProvider( ServiceIdentification si, ServiceProvider sp,
                                       Map<String, List<OMElement>> extendedCapabilities,
                                       List<DatasetMetadata> datasetMetadata, Map<String, String> authorities,
                                       ResourceMetadata<OWSMetadataProvider> metadata ); @Override void init(); @Override void destroy(); @Override ServiceIdentification getServiceIdentification(); @Override ServiceProvider getServiceProvider(); @Override Map<String, List<OMElement>> getExtendedCapabilities(); @Override List<DatasetMetadata> getDatasetMetadata(); @Override DatasetMetadata getDatasetMetadata( QName name ); @Override List<DatasetMetadata> getAllDatasetMetadata( QName name ); @Override Map<String, String> getExternalMetadataAuthorities(); @Override ResourceMetadata<? extends Resource> getMetadata();  }
@Test public void testGetAllDatasetMetadataByName() throws Exception { DefaultOWSMetadataProvider metadataProvider = createProvider(); List<DatasetMetadata> datasetMetadata = metadataProvider.getAllDatasetMetadata( new QName( "name1" ) ); assertThat( datasetMetadata.size(), is( 2 ) ); }