TransactionXmlReader200 extends AbstractTransactionXmlReader { Delete readDelete( XMLStreamReader xmlStream ) throws XMLStreamException { String handle = xmlStream.getAttributeValue( null, "handle" ); QName typeName = getRequiredAttributeValueAsQName( xmlStream, null, "typeName" ); nextElement( xmlStream ); try { xmlStream.require( START_ELEMENT, FES_20_NS, "Filter" ); } catch ( XMLStreamException e ) { throw new MissingParameterException( "Mandatory 'fes:Filter' element is missing in Delete." ); } Filter filter = readFilter( xmlStream ); nextElement( xmlStream ); xmlStream.require( END_ELEMENT, WFS_200_NS, "Delete" ); return new Delete( handle, typeName, filter ); }  @Override Transaction read( XMLStreamReader xmlStream ); @Override TransactionAction readAction( XMLStreamReader xmlStream ); @Override Filter readFilter( XMLStreamReader xmlStream ); @Override PropertyReplacement readProperty( XMLStreamReader xmlStream );  }
@Test public void testReadDeleteWfs200SpecExample1() throws Exception { XMLStreamReader xmlStream = getXMLStreamReader( DELETE_ACTION1 ); Delete delete = reader.readDelete( xmlStream ); xmlStream.require( XMLStreamReader.END_ELEMENT, WFS_200_NS, "Delete" ); assertNull( delete.getHandle() ); assertEquals( new QName( "InWaterA_1M" ), delete.getTypeName() ); assertNotNull( delete.getFilter() ); }
@Test public void testReadDeleteWfs200SpecExample2() throws Exception { XMLStreamReader xmlStream = getXMLStreamReader( DELETE_ACTION2 ); Delete delete = reader.readDelete( xmlStream ); xmlStream.require( XMLStreamReader.END_ELEMENT, WFS_200_NS, "Delete" ); assertNull( delete.getHandle() ); QName expectedTypeName = new QName( "http: assertEquals( expectedTypeName, delete.getTypeName() ); assertNotNull( delete.getFilter() ); }
@Test public void testReadDeleteWfs200SpecExample3() throws Exception { XMLStreamReader xmlStream = getXMLStreamReader( DELETE_ACTION3 ); Delete delete = reader.readDelete( xmlStream ); xmlStream.require( XMLStreamReader.END_ELEMENT, WFS_200_NS, "Delete" ); assertNull( delete.getHandle() ); QName expectedTypeName = new QName( "InWaterA_1M" ); assertEquals( expectedTypeName, delete.getTypeName() ); assertNotNull( delete.getFilter() ); }