GetFeatureWithLockXMLAdapter extends AbstractWFSRequestXMLAdapter { public GetFeatureWithLock parse() throws Exception { Version version = determineVersion110Safe(); GetFeatureWithLock result = null; if ( VERSION_100.equals( version ) ) { result = parse100(); } else if ( VERSION_110.equals( version ) ) { result = parse110(); } else if ( VERSION_200.equals( version ) ) { result = parse200(); } else { throw new Exception( "Version " + version + " is not supported for parsing (for now). Only 1.1.0 and 1.0.0 are supported." ); } return result; }  GetFeatureWithLock parse(); GetFeatureWithLock parse100(); GetFeatureWithLock parse110(); GetFeatureWithLock parse200();  }
@Test public void testWfs200Example1() throws Exception { GetFeatureWithLockXMLAdapter parser = new GetFeatureWithLockXMLAdapter(); parser.load( GetFeatureWithLockXMLAdapterTest.class.getResource( "wfs200/example1.xml" ) ); GetFeatureWithLock request = parser.parse(); assertEquals( VERSION_200, request.getVersion() ); assertEquals( 1, request.getQueries().size() ); assertNull( request.getExpiryInSeconds() ); assertNull( request.getLockAll() ); assertNull( request.getHandle() ); }
@Test public void testWfs200Example2() throws Exception { GetFeatureWithLockXMLAdapter parser = new GetFeatureWithLockXMLAdapter(); parser.load( GetFeatureWithLockXMLAdapterTest.class.getResource( "wfs200/example2.xml" ) ); GetFeatureWithLock request = parser.parse(); assertEquals( VERSION_200, request.getVersion() ); assertEquals( 1, request.getQueries().size() ); assertEquals( new BigInteger( "902544598624567873156901" ), request.getExpiryInSeconds() ); assertFalse( request.getLockAll() ); assertNull( request.getHandle() ); }