GetFeatureWithLockKVPAdapter extends AbstractWFSRequestKVPAdapter { public static GetFeatureWithLock parse( Map<String, String> kvpParams ) throws Exception { Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) ); GetFeatureWithLock 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_110 ) ); throw new InvalidParameterValueException( msg ); } return result; }  static GetFeatureWithLock parse( Map<String, String> kvpParams );  }
@Test public void testExample1Wfs110() throws Exception { URL example1 = this.getClass().getResource( EXAMPLE1WFS110 ); Map<String, String> kvpMap = KVPUtils.readFileIntoMap( example1 ); GetFeatureWithLock getFeatureWL = GetFeatureWithLockKVPAdapter.parse( kvpMap ); assertEquals( new BigInteger( "60" ), getFeatureWL.getExpiryInSeconds() ); }
@Test public void testExample1Wfs200() throws Exception { URL example1 = this.getClass().getResource( EXAMPLE1WFS200 ); Map<String, String> kvpMap = KVPUtils.readFileIntoMap( example1 ); GetFeatureWithLock getFeatureWL = GetFeatureWithLockKVPAdapter.parse( kvpMap ); assertNull( getFeatureWL.getExpiryInSeconds() ); assertNull( getFeatureWL.getLockAll() ); }
@Test public void testExample2Wfs200() throws Exception { URL example2 = this.getClass().getResource( EXAMPLE2WFS200 ); Map<String, String> kvpMap = KVPUtils.readFileIntoMap( example2 ); GetFeatureWithLock getFeatureWL = GetFeatureWithLockKVPAdapter.parse( kvpMap ); assertEquals( new BigInteger( "300" ), getFeatureWL.getExpiryInSeconds() ); assertFalse( getFeatureWL.getLockAll() ); }