" </resource>\n" +
"</gateway>";
Reader reader = new StringReader( xml );
GatewayDescriptor descriptor = GatewayDescriptorFactory.load( "xml", reader );
assertThat( descriptor, notNullValue() );
assertThat( descriptor.resources().size(), is( 2 ) );
ResourceDescriptor resource1 = descriptor.resources().get( 0 );
assertThat( resource1, notNullValue() );
assertThat( resource1.pattern(), is( "resource1-source" ) );
assertThat( resource1.filters().size(), is( 2 ) );
FilterDescriptor filter1 = resource1.filters().get( 0 );
assertThat( filter1, notNullValue() );
assertThat( filter1.role(), is( "resource1-filter1-role" ) );
assertThat( filter1.impl(), is( "resource1-filter1-impl" ) );
assertThat( filter1.params().size(), is( 2 ) );
FilterParamDescriptor param1 = filter1.params().get( 0 );
assertThat( param1, notNullValue() );
assertThat( param1.name(), is( "resource1-filter1-param1-name" ) );
assertThat( param1.value(), is( "resource1-filter1-param1-value" ) );
FilterParamDescriptor param2 = filter1.params().get( 1 );
assertThat( param2, notNullValue() );
assertThat( param2.name(), is( "resource1-filter1-param2-name" ) );
assertThat( param2.value(), is( "resource1-filter1-param2-value" ) );
FilterDescriptor filter2 = resource1.filters().get( 1 );
assertThat( filter2, notNullValue() );
assertThat( filter2.role(), is( "resource1-filter2-role" ) );
assertThat( filter2.impl(), is( "resource1-filter2-impl" ) );
ResourceDescriptor resource2 = descriptor.resources().get( 1 );
assertThat( resource2, notNullValue() );
assertThat( resource2.pattern(), is( "resource2-source" ) );
}