SchemaAnalyzerOption extends AbstractOptionString implements PropertyChangeListener { @Override public void propertyChange( PropertyChangeEvent evt ) { final String propName = evt.getPropertyName(); String create = DEFAULT_SOAP_MESSAGE; if ( CurrentRequest.PROP_WSDLREQUEST.equals( propName ) ) { if ( evt.getNewValue() != null ) { WsdlRequest newRequest = (WsdlRequest) evt.getNewValue(); create = create( newRequest.getRequestContent() ); } } else if ( CurrentRequest.PROP_WSDLREQUESTCONTENT.equals( propName ) ) { if ( evt.getNewValue() != null ) { String newContent = (String) evt.getNewValue(); create = create( newContent ); } } else if ( CurrentRequest.PROP_WSDLRESPONSE.equals( propName ) || CurrentRequest.PROP_WSDLRESPONSECONTENT.equals( propName ) ) { return; } setValue( create ); } SchemaAnalyzerOption( String name, String value, SchemaAnalyzer schemaAnalyzer ); @Override boolean isValid( String value ); @Override void propertyChange( PropertyChangeEvent evt );  }
@Test public void abc() { SchemaAnalyzerOption sao = new SchemaAnalyzerOption( null, xml, schemaAnalyzer ); PropertyChangeEvent evt = new PropertyChangeEvent( this, CurrentRequest.PROP_WSDLREQUESTCONTENT, xml, xml ); sao.propertyChange( evt ); assertThat( sao.getValue(), is( "<soapenv:Envelope xmlns:soapenv=\"http: + " <soapenv:Header $$PAYLOADATTR$$>$$PAYLOADELEMENT$$</soapenv:Header>\n" + " <soapenv:Body $$PAYLOADATTR$$>\n" + " <my:reverse>\n" + " <my:stringToRevers>?</my:stringToRevers>\n" + " </my:reverse>\n" + " $$PAYLOADELEMENT$$</soapenv:Body>\n" + "$$PAYLOADELEMENT$$</soapenv:Envelope>" ) ); }