String outXml = (String) resultHandler.getObject();
outXml = roundTripFromXml( outXml );
ExecutionResults result = (ExecutionResults) BatchExecutionHelper.newJSonMarshaller().fromXML( outXml );
result = ( ExecutionResults ) roundTripFromObject( result );
ChangeCollector collector = ( ChangeCollector ) result.getValue( "changes" );
Cheese c = ( Cheese ) collector.getChanges().get( 0 );
assertEquals( 42, c.getPrice() );
inXml = "";
inXml += "{\"batch-execution\":{\"commands\":[";
inXml += " {\"insert\":{\"object\":{\"org.drools.Person\":{\"name\":\"mark\"} }, \"out-identifier\":\"person\" } }";
inXml += ", {\"insert\":{\"object\":{\"org.drools.ChangeCollector\":{} }, \"out-identifier\":\"changes\" } }";
inXml += ", {\"fire-all-rules\":\"\"}";
inXml += "]}}";
inXml = roundTripFromXml( inXml );
resultHandler = new ResultHandlerImpl();
getPipelineStateful( ksession ).insert( inXml,
resultHandler );
outXml = (String) resultHandler.getObject();
outXml = roundTripFromXml( outXml );
result = (ExecutionResults) BatchExecutionHelper.newJSonMarshaller().fromXML( outXml );
result = ( ExecutionResults ) roundTripFromObject( result );
collector = ( ChangeCollector ) result.getValue( "changes" );
assertEquals( "stilton", collector.getRetracted().get( 0 ) );
}