Package com.eviware.soapui.impl.wsdl.testcase

Examples of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase


  }

  public void beforeStep( TestCaseRunner testRunner, TestCaseRunContext runContext, TestStep testStep )
  {
    TestStep currentStep = testStep;
    WsdlTestCase testCase = ( WsdlTestCase )runContext.getTestCase();
    if( currentStep instanceof WsdlTestRequestStep && testCase.getWsrmEnabled() )
    {
      if( wsrmMap == null )
      {
        wsrmMap = new HashMap<String, WsrmSequence>();
      }
      WsdlTestRequestStep requestStep = ( WsdlTestRequestStep )currentStep;
      String endpoint = requestStep.getHttpRequest().getEndpoint();
      SoapVersion soapVersion = requestStep.getOperation().getInterface().getSoapVersion();
      if( !wsrmMap.containsKey( endpoint ) )
      {

        WsrmUtils utils = new WsrmUtils( soapVersion );
        WsrmSequence sequence = utils.createSequence( endpoint, soapVersion, testCase.getWsrmVersionNamespace(),
            testCase.getWsrmAckTo(), testCase.getWsrmExpires(), requestStep.getOperation(), null );

        wsrmMap.put( endpoint, sequence );
      }

      WsrmSequence sequence = wsrmMap.get( endpoint );
      WsdlRequest wsdlRequest = ( WsdlRequest )requestStep.getHttpRequest();

      wsdlRequest.getWsrmConfig().setVersion( testCase.getWsrmVersion() );
      wsdlRequest.getWsrmConfig().setSequenceIdentifier( sequence.getIdentifier() );
      wsdlRequest.getWsrmConfig().setLastMessageId( sequence.incrementLastMsgNumber() );
      wsdlRequest.getWsrmConfig().setUuid( sequence.getUuid() );
      wsdlRequest.getWsrmConfig().setWsrmEnabled( true );

      if( !testCase.getWsrmVersion().equals( WsrmVersionTypeConfig.X_1_0.toString() ) )
      {
        WsmcInjection injection = new WsmcInjection( wsdlRequest.getEndpoint(), wsdlRequest.getOperation(),
            soapVersion, wsdlRequest.getWsrmConfig().getUuid() );
        wsdlRequest.setAfterRequestInjection( injection );
      }
View Full Code Here


      putValue( Action.SHORT_DESCRIPTION, "Opens the target TestCases editor" );
    }

    public void actionPerformed( ActionEvent e )
    {
      WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
      if( targetTestCase == null )
        UISupport.showErrorMessage( "No target TestCase selected" );
      else
        UISupport.showDesktopPanel( targetTestCase );
    }
View Full Code Here

            testCaseList.remove( getModelItem().getTestCase() );
            optionsDialog.setOptions( OptionsForm.TESTCASE, ModelSupport.getNames( testCaseList ) );

            if( testCaseList.size() > 0 )
            {
              WsdlTestCase testCase = project.getTestSuiteByName( newValue ).getTestCaseAt( 0 );
              optionsDialog.setOptions( OptionsForm.RETURN_PROPERTIES, testCase.getPropertyNames() );
              ( ( XFormMultiSelectList )optionsDialog.getFormField( OptionsForm.RETURN_PROPERTIES ) )
                  .setSelectedOptions( getModelItem().getReturnProperties().toStringArray() );
            }
          }
        } );
        optionsDialog.getFormField( OptionsForm.TESTCASE ).addFormFieldListener( new XFormFieldListener()
        {

          public void valueChanged( XFormField sourceField, String newValue, String oldValue )
          {
            WsdlTestSuite testSuite = project.getTestSuiteByName( optionsDialog.getValue( OptionsForm.TESTSUITE ) );
            WsdlTestCase testCase = testSuite.getTestCaseByName( newValue );
            optionsDialog.setOptions( OptionsForm.RETURN_PROPERTIES, testCase.getPropertyNames() );
            ( ( XFormMultiSelectList )optionsDialog.getFormField( OptionsForm.RETURN_PROPERTIES ) )
                .setSelectedOptions( getModelItem().getReturnProperties().toStringArray() );
          }
        } );
      }

      WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();

      optionsDialog.setOptions( OptionsForm.TESTSUITE, ModelSupport.getNames( project.getTestSuiteList() ) );
      if( targetTestCase != null )
      {
        optionsDialog.setValue( OptionsForm.TESTSUITE, targetTestCase.getTestSuite().getName() );

        List<TestCase> testCaseList = targetTestCase.getTestSuite().getTestCaseList();
        testCaseList.remove( getModelItem().getTestCase() );

        optionsDialog.setOptions( OptionsForm.TESTCASE, ModelSupport.getNames( testCaseList ) );
        optionsDialog.setValue( OptionsForm.TESTCASE, targetTestCase.getName() );

        optionsDialog.setOptions( OptionsForm.RETURN_PROPERTIES, targetTestCase.getPropertyNames() );
        ( ( XFormMultiSelectList )optionsDialog.getFormField( OptionsForm.RETURN_PROPERTIES ) )
            .setSelectedOptions( getModelItem().getReturnProperties().toStringArray() );
      }
      else
      {
View Full Code Here

            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();
View Full Code Here

  }

  @Override
  boolean copyAfter( WsdlTestCase source, WsdlTestCase target )
  {
    WsdlTestCase testCase = TestCaseToTestSuiteDropHandler.copyTestCase( source, target.getTestSuite(), target
        .getTestSuite().getIndexOfTestCase( target ) + 1 );

    if( testCase != null )
      UISupport.select( testCase );
View Full Code Here

  }

  @Override
  boolean moveAfter( WsdlTestCase source, WsdlTestCase target )
  {
    WsdlTestCase testCase = TestCaseToTestSuiteDropHandler.moveTestCase( source, target.getTestSuite(), target
        .getTestSuite().getIndexOfTestCase( target ) + 1 );

    if( testCase != null )
      UISupport.select( testCase );
View Full Code Here

  }

  @Override
  boolean copyBefore( WsdlTestCase source, WsdlTestCase target )
  {
    WsdlTestCase testCase = TestCaseToTestSuiteDropHandler.copyTestCase( source, target.getTestSuite(), target
        .getTestSuite().getIndexOfTestCase( target ) );

    if( testCase != null )
      UISupport.select( testCase );
View Full Code Here

  }

  @Override
  boolean moveBefore( WsdlTestCase source, WsdlTestCase target )
  {
    WsdlTestCase testCase = TestCaseToTestSuiteDropHandler.moveTestCase( source, target.getTestSuite(), target
        .getTestSuite().getIndexOfTestCase( target ) );

    if( testCase != null )
      UISupport.select( testCase );
View Full Code Here

  }

  @Override
  boolean copyAfter( WsdlTestCase source, WsdlTestSuite target )
  {
    WsdlTestCase testCase = copyTestCase( source, target, 0 );
    if( testCase != null )
      UISupport.select( testCase );

    return testCase != null;
  }
View Full Code Here

  }

  @Override
  boolean moveAfter( WsdlTestCase source, WsdlTestSuite target )
  {
    WsdlTestCase testCase = moveTestCase( source, target, 0 );
    if( testCase != null )
      UISupport.select( testCase );

    return testCase != null;
  }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.