@Test
public void testAnaylizeRequestOrder()
                        throws JAXBException, IOException {

    MapContentProvider wmsContentProvider = getProvider();
    JAXBContext jc = JAXBContext.newInstance( org.deegree.services.wps.provider.jrxml.jaxb.map.Map.class );
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    InputStream is = TestMapContentProviderTest.class.getResourceAsStream( "mapDescription.xml" );
    org.deegree.services.wps.provider.jrxml.jaxb.map.Map map = (org.deegree.services.wps.provider.jrxml.jaxb.map.Map) unmarshaller.unmarshal( is );
    List<OrderedDatasource<?>> anaylizeRequestOrder = wmsContentProvider.anaylizeRequestOrder( map.getDatasources().getWMSDatasourceOrWFSDatasource() );
    List<Pair<String, String>> expectedParts = new ArrayList<Pair<String, String>>();
    expectedParts.add( new Pair<String, String>( "http://demo.deegree.org:80/deegree-wms/services", "StateOverview" ) );
    expectedParts.add( new Pair<String, String>( "http://testing.deegree.org:80/deegree-wms/services", "River" ) );
    expectedParts.add( new Pair<String, String>( "http://demo.deegree.org:80/deegree-wms/services", "Lake" ) );
    expectedParts.add( new Pair<String, String>( "http://testing.printer.org:80/deegree-wms/services",
                                                 "Vegetation,Wood" ) );
    expectedParts.add( new Pair<String, String>( "http://localhost:8080/deegree-wms/services", "Town,SmallTown" ) );
    int index = 0;
    assertEquals( expectedParts.size(), anaylizeRequestOrder.size() );
    for ( OrderedDatasource<?> ds : anaylizeRequestOrder ) {
        assertTrue( ds instanceof WMSOrderedDatasource );
        WMSOrderedDatasource wds = (WMSOrderedDatasource) ds;
        Pair<String, String> expected = expectedParts.get( index++ );
        assertTrue( wds.datasource.getUrl().startsWith( expected.first ) );
        String layersAsString = "";
        boolean isFirst = true;
        for ( Layer l : wds.layers ) {
            if ( !isFirst ) {
                layersAsString += ",";
            }
            layersAsString += l.getName();
            isFirst = false;
        }
        assertEquals( expected.second, layersAsString );
    }
    is.close();
}