Package com.eviware.soapui.impl.wsdl.teststeps

Examples of com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep


      if( wsdlRequest.getOperation().getInterface() == this )
        list.add( wsdlRequest );
    }
    else if( modelItem instanceof WsdlTestRequestStep )
    {
      WsdlTestRequestStep testRequestStep = ( WsdlTestRequestStep )modelItem;
      WsdlTestRequest testRequest = testRequestStep.getTestRequest();
      if( testRequest != null && testRequest.getOperation() != null
          && testRequest.getOperation().getInterface() == this )
        list.add( testRequest );
    }
    else if( modelItem instanceof WsdlMockResponse )
View Full Code Here


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

        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();

            request.setEndpoint( me.getTargetUrl().toString() );
            // request.setIncomingWss( incomingRequestWss );
            String existingMediaType = me.getResponseHeaders().get( "Content-Type", "" );
            if( !StringUtils.isNullOrEmpty( existingMediaType ) )
            {
              request.setMediaType( existingMediaType );
            }
            if( "application/octet-stream".equals( existingMediaType )
                || "application/x-amf".equals( existingMediaType ) )
            {
              request.attachBinaryData( me.getRequestContent().getBytes(), existingMediaType );
            }
            else
            {
              request.setRequestContent( me.getRequestContent() );
              test.getTestRequest().setRequestContent( me.getRequestContent() );
            }
            Attachment[] requestAttachments = me.getRequestAttachments();
            if( requestAttachments != null )
            {
              for( Attachment attachment : requestAttachments )
View Full Code Here

    if( dialog.getReturnValue() != XFormDialog.OK_OPTION )
      return null;

    String name = dialogValues.get( STEP_NAME );

    WsdlTestRequestStep testStep = ( WsdlTestRequestStep )testCase.insertTestStep(
        WsdlTestRequestStepFactory.createConfig( request, name ), position );

    if( testStep == null )
      return null;

    if( dialogValues.getBoolean( COPY_ATTACHMENTS ) )
      request.copyAttachmentsTo( testStep.getTestRequest() );

    if( dialogValues.getBoolean( COPY_HTTPHEADERS ) )
      testStep.getTestRequest().setRequestHeaders( request.getRequestHeaders() );

    if( bidirectional )
    {
      if( dialogValues.getBoolean( ADD_SOAP_RESPONSE_ASSERTION ) )
        testStep.getTestRequest().addAssertion( SoapResponseAssertion.ID );

      if( dialogValues.getBoolean( ADD_SCHEMA_ASSERTION ) )
        testStep.getTestRequest().addAssertion( SchemaComplianceAssertion.ID );

      if( dialogValues.getBoolean( ADD_SOAP_FAULT_ASSERTION ) )
        testStep.getTestRequest().addAssertion( NotSoapFaultAssertion.LABEL );
    }

    UISupport.selectAndShow( testStep );

    if( dialogValues.getBoolean( CLOSE_REQUEST ) && desktop != null )
View Full Code Here

      return null;
    ;

    String name = dialogValues.get( STEP_NAME );

    WsdlTestRequestStep testStep = ( WsdlTestRequestStep )testCase.insertTestStep(
        WsdlTestRequestStepFactory.createConfig( mockResponse.getMockOperation().getOperation(), name ), position );

    if( testStep == null )
      return null;

    if( enabled )
    {
      if( dialogValues.getBoolean( ADD_SOAP_RESPONSE_ASSERTION ) )
        testStep.getTestRequest().addAssertion( SoapResponseAssertion.ID );

      if( dialogValues.getBoolean( ADD_SCHEMA_ASSERTION ) )
        testStep.getTestRequest().addAssertion( SchemaComplianceAssertion.ID );

      if( dialogValues.getBoolean( ADD_SOAP_FAULT_ASSERTION ) )
        testStep.getTestRequest().addAssertion( NotSoapFaultAssertion.LABEL );
    }

    testStep.getTestRequest().setEndpoint( mockResponse.getMockOperation().getMockService().getLocalEndpoint() );

    UISupport.selectAndShow( testStep );

    return testStep;
  }
View Full Code Here

        TestStep testStep = getAssertable().getTestStep();
        MessageExchange exchange = null;

        if( testStep instanceof WsdlTestRequestStep )
        {
          WsdlTestRequestStep testRequestStep = ( WsdlTestRequestStep )testStep;
          exchange = new WsdlResponseMessageExchange( testRequestStep.getTestRequest() );
          ( ( WsdlResponseMessageExchange )exchange ).setResponse( testRequestStep.getTestRequest().getResponse() );
        }
        else if( testStep instanceof RestTestRequestStepInterface )
        {
          RestTestRequestStepInterface testRequestStep = ( RestTestRequestStepInterface )testStep;
          exchange = new RestResponseMessageExchange( ( RestRequestInterface )testRequestStep.getTestRequest() );
          ( ( RestResponseMessageExchange )exchange )
              .setResponse( ( ( AbstractHttpRequestInterface<?> )testRequestStep.getTestRequest() )
                  .getResponse() );
        }
        else if( testStep instanceof HttpTestRequestStepInterface )
        {
          HttpTestRequestStepInterface testRequestStep = ( HttpTestRequestStepInterface )testStep;
          exchange = new HttpResponseMessageExchange( testRequestStep.getTestRequest() );
          ( ( HttpResponseMessageExchange )exchange )
              .setResponse( ( ( AbstractHttpRequestInterface<?> )testRequestStep.getTestRequest() )
                  .getResponse() );
        }
        else if( testStep instanceof WsdlMockResponseTestStep )
        {
          WsdlMockResponseTestStep mockResponseStep = ( WsdlMockResponseTestStep )testStep;
View Full Code Here

    super( REQUEST_TYPE, "Test Request", "Submits a request and validates its response", "/request.gif" );
  }

  public WsdlTestStep buildTestStep( WsdlTestCase testCase, TestStepConfig config, boolean forLoadTest )
  {
    return new WsdlTestRequestStep( testCase, config, forLoadTest );
  }
View Full Code Here

    putValue( Action.SHORT_DESCRIPTION, "Creates a new request from this result" );
  }

  public void actionPerformed( ActionEvent e )
  {
    WsdlTestRequestStep step = ( WsdlTestRequestStep )result.getTestStep();
    String name = UISupport.prompt( "Specify name of request", "Create Request", "Result from " + step.getName() );

    if( name != null )
    {
      WsdlOperation operation = ( WsdlOperation )step.getTestRequest().getOperation();
      WsdlRequest request = operation.addNewRequest( name );
      request.setRequestContent( result.getRequestContent() );
      request.setDomain( result.getDomain() );
      request.setEncoding( result.getEncoding() );
      request.setEndpoint( result.getEndpoint() );
View Full Code Here

      for( int c = 0; c < testCase.getTestStepCount(); c++ )
      {
        TestStep step = testCase.getTestStepAt( c );
        if( step instanceof WsdlTestRequestStep )
        {
          WsdlTestRequestStep requestStep = ( WsdlTestRequestStep )step;
          requestStep.getTestRequest().setUsername( form.getComponentValue( USERNAME ) );
          requestStep.getTestRequest().setPassword( form.getComponentValue( PASSWORD ) );
          requestStep.getTestRequest().setDomain( form.getComponentValue( DOMAIN ) );
        }
      }

      dialog.setVisible( false );
    }
View Full Code Here

                }

                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 {
                        HttpRequestStepFactory httpRequestStepFactory = new HttpRequestStepFactory();
                        HttpTestRequestStep test = (HttpTestRequestStep) testCase.insertTestStep(
                                httpRequestStepFactory.createConfig(me, "Monitor Request " + (row + 1)), -1);

                        test.getTestRequest().setRequestHeaders(excludeProxyHeaders(me.getRequestHeaders()));

                        HttpTestRequest request = (HttpTestRequest) test.getHttpRequest();

                        request.setEndpoint(me.getTargetUrl().toString());
                        // request.setIncomingWss( incomingRequestWss );
                        String existingMediaType = me.getResponseHeaders().get("Content-Type", "");
                        if (!StringUtils.isNullOrEmpty(existingMediaType)) {
                            request.setMediaType(existingMediaType);
                        }
                        if ("application/octet-stream".equals(existingMediaType)
                                || "application/x-amf".equals(existingMediaType)) {
                            request.attachBinaryData(me.getRequestContent().getBytes(), existingMediaType);
                        } else {
                            request.setRequestContent(me.getRequestContent());
                            test.getTestRequest().setRequestContent(me.getRequestContent());
                        }
                        Attachment[] requestAttachments = me.getRequestAttachments();
                        if (requestAttachments != null) {
                            for (Attachment attachment : requestAttachments) {
                                request.importAttachment(attachment);
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep

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.