DescribeFeatureTypeKVPAdapter extends AbstractWFSRequestKVPAdapter { public static DescribeFeatureType parse( Map<String, String> kvpParams ) throws MissingParameterException, InvalidParameterValueException { Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) ); DescribeFeatureType result = null; if ( VERSION_100.equals( version ) ) { result = parse100( kvpParams ); } else if ( VERSION_110.equals( version ) ) { result = parse110( kvpParams ); } else if ( VERSION_200.equals( version ) ) { result = parse200( kvpParams ); } else { String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_100, VERSION_110, VERSION_200 ) ); throw new InvalidParameterValueException( msg ); } return result; }  static DescribeFeatureType parse( Map<String, String> kvpParams ); static DescribeFeatureType parse100( Map<String, String> kvpParams ); static DescribeFeatureType parse110( Map<String, String> kvpParams ); static DescribeFeatureType parse200( Map<String, String> kvpParams ); static String export( DescribeFeatureType request, Version version );  }
@Test public void test110Example1() throws IOException { Map<String, String> kvpParams = readFileIntoMap( this.getClass().getResource( "wfs110/example1.kvp" ) ); DescribeFeatureType dft = parse( kvpParams ); assertEquals( dft.getHandle(), null ); assertEquals( dft.getOutputFormat(), null ); assertEquals( dft.getTypeNames().length, 1 ); assertEquals( dft.getTypeNames()[0], new QName( "TreesA_1M" ) ); assertEquals( dft.getVersion(), WFSConstants.VERSION_110 ); }
@Test public void test110Example2() throws IOException { Map<String, String> kvpParams = readFileIntoMap( this.getClass().getResource( "wfs110/example2.kvp" ) ); DescribeFeatureType dft = parse( kvpParams ); assertEquals( dft.getHandle(), null ); assertEquals( dft.getOutputFormat(), null ); assertEquals( dft.getTypeNames().length, 2 ); assertEquals( dft.getTypeNames()[0], new QName( "TreesA_1M" ) ); assertEquals( dft.getTypeNames()[1], new QName( "BuiltUpA_1M" ) ); assertEquals( dft.getVersion(), WFSConstants.VERSION_110 ); }
@Test public void test200Example1() throws IOException { Map<String, String> kvpParams = readFileIntoMap( this.getClass().getResource( "wfs200/example1.kvp" ) ); DescribeFeatureType dft = parse( kvpParams ); assertEquals( VERSION_200, dft.getVersion() ); assertEquals( null, dft.getHandle() ); assertEquals( null, dft.getOutputFormat() ); assertEquals( 1, dft.getTypeNames().length ); assertEquals( valueOf( "{http: }
@Test public void test200Example2() throws IOException { Map<String, String> kvpParams = readFileIntoMap( this.getClass().getResource( "wfs200/example2.kvp" ) ); DescribeFeatureType dft = parse( kvpParams ); assertEquals( VERSION_200, dft.getVersion() ); assertEquals( null, dft.getHandle() ); assertEquals( null, dft.getOutputFormat() ); assertEquals( 2, dft.getTypeNames().length ); assertEquals( valueOf( "{http: assertEquals( valueOf( "{http: }