Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.MockResponseConfig


    if( name == null )
      return;

    WsdlMockOperation mockOperation = mockResponse.getMockOperation();
    mockOperation.beforeSave();
    MockResponseConfig config = mockOperation.getConfig().addNewResponse();
    config.set( mockResponse.getConfig().copy() );
    config.setName( name );
    WsdlMockResponse newResponse = mockOperation.addNewMockResponse( config );

    UISupport.selectAndShow( newResponse );
  }
View Full Code Here


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

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

    return mockResponse;
  }

  public WsdlMockResponse addNewMockResponse( String name, boolean createResponse )
  {
    MockResponseConfig responseConfig = getConfig().addNewResponse();
    responseConfig.setName( name );
    responseConfig.addNewResponseContent();

    if( createResponse && getOperation() != null && getOperation().isBidirectional() )
    {
      boolean createOptional = SoapUI.getSettings().getBoolean(
          WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS );
      CompressedStringSupport.setString( responseConfig.getResponseContent(),
          getOperation().createResponse( createOptional ) );
    }

    return addNewMockResponse( responseConfig );
  }
View Full Code Here

        XmlBeansSettingsImpl mockedSettings = mock(XmlBeansSettingsImpl.class);
        when(mockOperation.getSettings()).thenReturn(mockedSettings);

        compressedStringConfig = mock(CompressedStringConfig.class);

        MockResponseConfig mockResponseConfig = mock(MockResponseConfig.class);
        SettingsConfig mockedResponseSettings = mock(SettingsConfig.class);
        when(mockResponseConfig.getSettings()).thenReturn(mockedResponseSettings);
        when(mockResponseConfig.getResponseContent()).thenReturn(compressedStringConfig);

        mockResponse = new WsdlMockResponse(mockOperation, mockResponseConfig);
    }
View Full Code Here

        mockResponse.writeResponse(mockResult, content);
    }

    public WsdlMockResponse createWsdlMockResponse() throws Exception {
        WsdlMockOperation mockOperation = createWsdlMockOperation();
        MockResponseConfig responseConfig = MockResponseConfig.Factory.newInstance();
        WsdlMockResponse mockResponse = new MockedWsdlMockResponse(mockOperation, responseConfig);

        addAttachment(mockResponse);
        return mockResponse;
    }
View Full Code Here

        return mockResponse;
    }

    public WsdlMockResponse addNewMockResponse(String name, boolean createResponse) {
        MockResponseConfig responseConfig = getConfig().addNewResponse();
        responseConfig.setName(name);
        responseConfig.addNewResponseContent();

        if (createResponse && getOperation() != null && getOperation().isBidirectional()) {
            boolean createOptional = SoapUI.getSettings().getBoolean(
                    WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS);
            CompressedStringSupport.setString(responseConfig.getResponseContent(),
                    getOperation().createResponse(createOptional));
        }

        return addNewMockResponse(responseConfig);
    }
View Full Code Here

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

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

            return;
        }

        WsdlMockOperation mockOperation = mockResponse.getMockOperation();
        mockOperation.beforeSave();
        MockResponseConfig config = mockOperation.getConfig().addNewResponse();
        config.set(mockResponse.getConfig().copy());
        config.setName(name);
        WsdlMockResponse newResponse = mockOperation.addNewMockResponse(config);

        UISupport.selectAndShow(newResponse);
    }
View Full Code Here

TOP

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

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.