Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.MockResponseStepConfig


    if( !dialog.show() )
      return;

    TestStepConfig config = WsdlMockResponseStepFactory.createConfig( mockResponse.getMockOperation().getOperation(),
        false );
    MockResponseStepConfig mockResponseStepConfig = ( ( MockResponseStepConfig )config.getConfig() );

    config.setName( dialog.getValue( Form.STEP_NAME ) );
    mockResponseStepConfig.setPath( dialog.getValue( Form.PATH ) );
    mockResponseStepConfig.setPort( dialog.getIntValue( Form.PORT, mockService.getPort() ) );

    mockResponse.beforeSave();
    mockResponseStepConfig.getResponse().set( mockResponse.getConfig() );

    WsdlMockResponseTestStep testStep = ( WsdlMockResponseTestStep )testCase.insertTestStep( config, -1 );
    if( testStep == null )
      return;
View Full Code Here


    if( !dialog.show() )
      return false;

    TestStepConfig config = WsdlMockResponseStepFactory.createConfig( operation, false );
    MockResponseStepConfig mockResponseStepConfig = ( ( MockResponseStepConfig )config.getConfig() );

    config.setName( dialog.getValue( Form.STEP_NAME ) );
    mockResponseStepConfig.setPath( dialog.getValue( Form.PATH ) );
    mockResponseStepConfig.setPort( dialog.getIntValue( Form.PORT, 8181 ) );

    String response = operation.createResponse( operation.getSettings().getBoolean(
        WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ) );
    CompressedStringSupport.setString( mockResponseStepConfig.addNewResponse().addNewResponseContent(), response );

    WsdlMockResponseTestStep testStep = ( WsdlMockResponseTestStep )testCase.addTestStep( config );

    if( dialog.getBooleanValue( Form.ADD_SCHEMA_ASSERTION ) )
      testStep.addAssertion( SchemaComplianceAssertion.ID );
View Full Code Here

      TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
      testStepConfig.setType( MOCKRESPONSE_TYPE );
      testStepConfig.setName( dialog.getValue( CreateForm.NAME ) );

      MockResponseStepConfig config = MockResponseStepConfig.Factory.newInstance();
      config.setInterface( dialog.getValue( CreateForm.INTERFACE ) );
      config.setOperation( dialog.getValue( CreateForm.OPERATION ) );
      config.setPort( dialog.getIntValue( CreateForm.PORT, 8080 ) );
      config.setPath( dialog.getValue( CreateForm.PATH ) );
      config.addNewResponse();
      config.getResponse().addNewResponseContent();

      if( dialog.getBooleanValue( CreateForm.CREATE_RESPONSE ) )
      {
        WsdlInterface iface = ( WsdlInterface )project.getInterfaceByName( config.getInterface() );
        String response = iface.getOperationByName( config.getOperation() ).createResponse(
            project.getSettings().getBoolean( WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ) );

        CompressedStringSupport.setString( config.getResponse().getResponseContent(), response );
      }

      testStepConfig.addNewConfig().set( config );
      return testStepConfig;
    }
View Full Code Here

    {
      TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
      testStepConfig.setType( MOCKRESPONSE_TYPE );
      testStepConfig.setName( "Mock Response" );

      MockResponseStepConfig config = MockResponseStepConfig.Factory.newInstance();
      config.setInterface( operation.getInterface().getName() );
      config.setOperation( operation.getName() );
      MockResponseConfig response = config.addNewResponse();
      response.addNewResponseContent();

      if( request != null && request.getResponse() != null )
      {
        CompressedStringSupport.setString( response.getResponseContent(), request.getResponse()
View Full Code Here

    if( !dialog.show() )
      return false;

    TestStepConfig config = WsdlMockResponseStepFactory.createConfig( operation, request, false );
    MockResponseStepConfig mockResponseStepConfig = ( ( MockResponseStepConfig )config.getConfig() );

    config.setName( dialog.getValue( Form.STEP_NAME ) );
    mockResponseStepConfig.setPath( dialog.getValue( Form.PATH ) );
    mockResponseStepConfig.setPort( dialog.getIntValue( Form.PORT, 8181 ) );
    CompressedStringConfig responseContent = mockResponseStepConfig.getResponse().getResponseContent();

    if( request.getResponse() == null && !request.getOperation().isOneWay() )
    {
      create = UISupport.confirm( "Request is missing response, create default mock response instead?", title );
    }
View Full Code Here

        if (!dialog.show()) {
            return false;
        }

        TestStepConfig config = WsdlMockResponseStepFactory.createConfig(operation, false);
        MockResponseStepConfig mockResponseStepConfig = ((MockResponseStepConfig) config.getConfig());

        config.setName(dialog.getValue(Form.STEP_NAME));
        mockResponseStepConfig.setPath(dialog.getValue(Form.PATH));
        mockResponseStepConfig.setPort(dialog.getIntValue(Form.PORT, 8181));

        String response = operation.createResponse(operation.getSettings().getBoolean(
                WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS));
        CompressedStringSupport.setString(mockResponseStepConfig.addNewResponse().addNewResponseContent(), response);

        WsdlMockResponseTestStep testStep = (WsdlMockResponseTestStep) testCase.addTestStep(config);

        if (dialog.getBooleanValue(Form.ADD_SCHEMA_ASSERTION)) {
            testStep.addAssertion(SchemaComplianceAssertion.ID);
View Full Code Here

            return;
        }

        TestStepConfig config = WsdlMockResponseStepFactory.createConfig(mockResponse.getMockOperation().getOperation(),
                false);
        MockResponseStepConfig mockResponseStepConfig = ((MockResponseStepConfig) config.getConfig());

        config.setName(dialog.getValue(Form.STEP_NAME));
        mockResponseStepConfig.setPath(dialog.getValue(Form.PATH));
        mockResponseStepConfig.setPort(dialog.getIntValue(Form.PORT, mockService.getPort()));

        mockResponse.beforeSave();
        mockResponseStepConfig.getResponse().set(mockResponse.getConfig());

        WsdlMockResponseTestStep testStep = (WsdlMockResponseTestStep) testCase.insertTestStep(config, -1);
        if (testStep == null) {
            return;
        }
View Full Code Here

            TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
            testStepConfig.setType(MOCKRESPONSE_TYPE);
            testStepConfig.setName(dialog.getValue(CreateForm.NAME));

            MockResponseStepConfig config = MockResponseStepConfig.Factory.newInstance();
            config.setInterface(dialog.getValue(CreateForm.INTERFACE));
            config.setOperation(dialog.getValue(CreateForm.OPERATION));
            config.setPort(dialog.getIntValue(CreateForm.PORT, 8080));
            config.setPath(dialog.getValue(CreateForm.PATH));
            config.addNewResponse();
            config.getResponse().addNewResponseContent();

            if (dialog.getBooleanValue(CreateForm.CREATE_RESPONSE)) {
                WsdlInterface iface = (WsdlInterface) project.getInterfaceByName(config.getInterface());
                String response = iface.getOperationByName(config.getOperation()).createResponse(
                        project.getSettings().getBoolean(WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS));

                CompressedStringSupport.setString(config.getResponse().getResponseContent(), response);
            }

            testStepConfig.addNewConfig().set(config);
            return testStepConfig;
        } finally {
View Full Code Here

        } else {
            TestStepConfig testStepConfig = TestStepConfig.Factory.newInstance();
            testStepConfig.setType(MOCKRESPONSE_TYPE);
            testStepConfig.setName("Mock Response");

            MockResponseStepConfig config = MockResponseStepConfig.Factory.newInstance();
            config.setInterface(operation.getInterface().getName());
            config.setOperation(operation.getName());
            MockResponseConfig response = config.addNewResponse();
            response.addNewResponseContent();

            if (request != null && request.getResponse() != null) {
                CompressedStringSupport.setString(response.getResponseContent(), request.getResponse()
                        .getContentAsString());
View Full Code Here

        if (!dialog.show()) {
            return false;
        }

        TestStepConfig config = WsdlMockResponseStepFactory.createConfig(operation, request, false);
        MockResponseStepConfig mockResponseStepConfig = ((MockResponseStepConfig) config.getConfig());

        config.setName(dialog.getValue(Form.STEP_NAME));
        mockResponseStepConfig.setPath(dialog.getValue(Form.PATH));
        mockResponseStepConfig.setPort(dialog.getIntValue(Form.PORT, 8181));
        CompressedStringConfig responseContent = mockResponseStepConfig.getResponse().getResponseContent();

        if (request.getResponse() == null && !request.getOperation().isOneWay()) {
            create = UISupport.confirm("Request is missing response, create default mock response instead?", title);
        }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.config.MockResponseStepConfig

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.