return;
testSuite = getProject().addNewTestSuite( targetTestSuiteName );
}
WsdlTestCase testCase = testSuite.getTestCaseByName( targetTestCaseName );
if( testCase == null )
{
targetTestCaseName = ModelSupport.promptForUniqueName( "TestCase", testSuite, "" );
if( targetTestCaseName == null )
return;
testCase = testSuite.addNewTestCase( targetTestCaseName );
}
for( int row : rows )
{
WsdlMonitorMessageExchange me = tableModel.getMessageExchangeAt( row );
if( me.getOperation() != null )
{
WsdlTestRequestStep test = ( WsdlTestRequestStep )testCase.insertTestStep(
WsdlTestRequestStepFactory.createConfig( me.getOperation(), "Monitor Request " + ( row + 1 ) ),
-1 );
WsdlTestRequest request = test.getTestRequest();
request.setRequestContent( me.getRequestContent() );
request.setEndpoint( me.getTargetUrl().toString() );
request.setIncomingWss( incomingRequestWss );
Attachment[] requestAttachments = me.getRequestAttachments();
if( requestAttachments != null )
{
for( Attachment attachment : requestAttachments )
{
request.importAttachment( attachment );
}
}
}
else
{
// if( me.getResponseContentType().contains( "/x-amf" ) )
// {
// AMFRequestStepFactory httpRequestStepFactory = new
// AMFRequestStepFactory();
// AMFRequestTestStep test = ( AMFRequestTestStep
// )testCase.insertTestStep( httpRequestStepFactory
// .createConfig( me, "Monitor Request " + ( row + 1 ) ), -1
// );
//
// AMFRequest request = test.getAMFRequest();
// // request.setRequestContent( me.getRequestContent() );
// request.setEndpoint( me.getTargetUrl().toString() );
// request.setHttpHeaders( me.getRequestHeaders() );
//
// }
// else
// {
HttpRequestStepFactory httpRequestStepFactory = new HttpRequestStepFactory();
HttpTestRequestStep test = ( HttpTestRequestStep )testCase.insertTestStep(
httpRequestStepFactory.createConfig( me, "Monitor Request " + ( row + 1 ) ), -1 );
test.getTestRequest().setRequestHeaders( excludeHeaders( me.getRequestHeaders() ) );
HttpTestRequest request = ( HttpTestRequest )test.getHttpRequest();