TransactionXmlReader200 extends AbstractTransactionXmlReader { @Override public Transaction read( XMLStreamReader xmlStream ) throws XMLStreamException { xmlStream.require( START_ELEMENT, WFS_200_NS, "Transaction" ); String handle = getAttributeValue( xmlStream, "handle" ); String lockId = getAttributeValue( xmlStream, "lockId" ); String releaseActionString = getAttributeValue( xmlStream, "releaseAction" ); ReleaseAction releaseAction = parseReleaseAction( releaseActionString ); String srsName = getAttributeValue( xmlStream, "srsName" ); nextElement( xmlStream ); LazyTransactionActionsReader iterable = new LazyTransactionActionsReader( xmlStream, this ); return new Transaction( VERSION_200, handle, lockId, releaseAction, iterable, srsName ); }  @Override Transaction read( XMLStreamReader xmlStream ); @Override TransactionAction readAction( XMLStreamReader xmlStream ); @Override Filter readFilter( XMLStreamReader xmlStream ); @Override PropertyReplacement readProperty( XMLStreamReader xmlStream );  }
@Test public void testReadUpdateWfs200MixedTransaction() throws Exception { XMLStreamReader xmlStream = getXMLStreamReader( MIXED_200 ); Transaction ta = reader.read( xmlStream ); Iterator<TransactionAction> taIter = ta.getActions().iterator(); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Native" ); Native nativeAction = (Native) taIter.next(); skipElement( nativeAction.getVendorSpecificData() ); xmlStream.require( XMLStreamReader.END_ELEMENT, WFS_200_NS, "Native" ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Insert" ); Insert insert = (Insert) taIter.next(); XMLStreamReader features = insert.getFeatures(); features.require( XMLStreamReader.START_ELEMENT, "http: skipElement( features ); nextElement( features ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Insert" ); insert = (Insert) taIter.next(); features = insert.getFeatures(); features.require( XMLStreamReader.START_ELEMENT, "http: skipElement( features ); nextElement( features ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Update" ); Update update = (Update) taIter.next(); Iterator<PropertyReplacement> propIter = update.getReplacementProps(); assertTrue( propIter.hasNext() ); PropertyReplacement property = propIter.next(); XMLStreamReader replacementValue = property.getReplacementValue(); skipElement( replacementValue ); nextElement( replacementValue ); nextElement( replacementValue ); assertFalse( propIter.hasNext() ); assertNotNull( update.getFilter() ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Insert" ); insert = (Insert) taIter.next(); features = insert.getFeatures(); features.require( XMLStreamReader.START_ELEMENT, "http: skipElement( features ); nextElement( features ); skipElement( features ); nextElement( features ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Update" ); update = (Update) taIter.next(); propIter = update.getReplacementProps(); assertTrue( propIter.hasNext() ); property = propIter.next(); replacementValue = property.getReplacementValue(); skipElement( replacementValue ); nextElement( replacementValue ); nextElement( replacementValue ); assertFalse( propIter.hasNext() ); assertNotNull( update.getFilter() ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Update" ); update = (Update) taIter.next(); propIter = update.getReplacementProps(); assertTrue( propIter.hasNext() ); property = propIter.next(); replacementValue = property.getReplacementValue(); skipElement( replacementValue ); nextElement( replacementValue ); nextElement( replacementValue ); assertFalse( propIter.hasNext() ); assertNotNull( update.getFilter() ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Delete" ); Delete delete = (Delete) taIter.next(); assertNotNull( delete ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Delete" ); delete = (Delete) taIter.next(); assertNotNull( delete ); assertTrue( taIter.hasNext() ); xmlStream.require( XMLStreamReader.START_ELEMENT, WFS_200_NS, "Replace" ); Replace replace = (Replace) taIter.next(); skipElement( replace.getReplacementFeatureStream() ); assertNotNull( replace.getFilter() ); assertFalse( taIter.hasNext() ); }