Package com.eviware.soapui.ui.desktop

Examples of com.eviware.soapui.ui.desktop.SoapUIDesktop


    dialog.setBooleanValue( COPY_ATTACHMENTS, true );

    dialog.getFormField( COPY_HTTPHEADERS ).setEnabled( request.getRequestHeaders().size() > 0 );
    dialog.setBooleanValue( COPY_HTTPHEADERS, false );

    SoapUIDesktop desktop = SoapUI.getDesktop();
    closeRequestCheckBox.setEnabled( desktop != null && desktop.hasDesktopPanel( request ) );

    boolean bidirectional = request.getOperation().isBidirectional();
    dialog.getFormField( ADD_SCHEMA_ASSERTION ).setEnabled( bidirectional );
    dialog.getFormField( ADD_SOAP_FAULT_ASSERTION ).setEnabled( bidirectional );
    dialog.getFormField( ADD_SOAP_RESPONSE_ASSERTION ).setEnabled( bidirectional );

    dialogValues = dialog.show( dialogValues );
    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 )
    {
      desktop.closeDesktopPanel( request );
    }

    if( dialogValues.getBoolean( SHOW_TESTCASE ) )
    {
      UISupport.selectAndShow( testCase );
View Full Code Here


      return null;

    try
    {
      UISupport.setHourglassCursor();
      SoapUIDesktop desktop = SoapUI.getDesktop();
      return desktop == null ? null : desktop.showDesktopPanel( modelItem );
    }
    finally
    {
      UISupport.resetCursor();
    }
View Full Code Here

  public static DesktopPanel showDesktopPanel( DesktopPanel desktopPanel )
  {
    try
    {
      UISupport.setHourglassCursor();
      SoapUIDesktop desktop = SoapUI.getDesktop();
      return desktop == null ? null : desktop.showDesktopPanel( desktopPanel );
    }
    finally
    {
      UISupport.resetCursor();
    }
View Full Code Here

    dialog.setBooleanValue( Form.CLOSE_EDITOR, true );
    dialog.setBooleanValue( Form.SHOW_TESTCASE, true );
    dialog.setIntValue( Form.PORT, mockService.getPort() );
    dialog.setValue( Form.PATH, mockService.getPath() );

    SoapUIDesktop desktop = SoapUI.getDesktop();
    dialog.getFormField( Form.CLOSE_EDITOR ).setEnabled( desktop != null && desktop.hasDesktopPanel( mockResponse ) );

    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;

    if( dialog.getBooleanValue( Form.ADD_SCHEMA_ASSERTION ) )
      testStep.addAssertion( SchemaComplianceAssertion.ID );

    UISupport.selectAndShow( testStep );

    if( dialog.getBooleanValue( Form.CLOSE_EDITOR ) && desktop != null )
    {
      desktop.closeDesktopPanel( mockResponse );
    }

    if( dialog.getBooleanValue( Form.SHOW_TESTCASE ) )
    {
      UISupport.selectAndShow( testCase );
View Full Code Here

    dialogValues.put( STEP_NAME, request.getRestMethod().getName() + " - " + request.getName() );
    dialogValues.put( CLOSE_REQUEST, "true" );
    dialogValues.put( SHOW_TESTCASE, "true" );
    dialogValues.put( SHOW_REQUEST, "true" );

    SoapUIDesktop desktop = SoapUI.getDesktop();
    closeRequestCheckBox.setEnabled( desktop != null && desktop.hasDesktopPanel( request ) );

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

    String name = dialogValues.get( STEP_NAME );

    RestTestRequestStep testStep = ( RestTestRequestStep )testCase.insertTestStep(
        RestRequestStepFactory.createConfig( request, name ), position );

    if( testStep == null )
      return null;

    if( dialogValues.getBoolean( CLOSE_REQUEST ) && desktop != null )
    {
      desktop.closeDesktopPanel( request );
    }

    if( dialogValues.getBoolean( SHOW_TESTCASE ) )
    {
      UISupport.selectAndShow( testCase );
View Full Code Here

    dialog.setBooleanValue( Form.CLOSE_REQUEST, true );
    dialog.setBooleanValue( Form.SHOW_TESTCASE, true );
    dialog.setIntValue( Form.PORT, 8181 );
    dialog.setValue( Form.PATH, "/" + operation.getName() );

    SoapUIDesktop desktop = SoapUI.getDesktop();
    dialog.getFormField( Form.CLOSE_REQUEST ).setEnabled( desktop != null && desktop.hasDesktopPanel( request ) );

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

    if( create )
    {
      String response = operation.createResponse( operation.getSettings().getBoolean(
          WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ) );
      CompressedStringSupport.setString( responseContent, response );
    }
    else if( request.getResponse() != null )
    {
      String response = request.getResponse().getContentAsString();
      CompressedStringSupport.setString( responseContent, response );
    }

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

    if( dialog.getBooleanValue( Form.ADD_SCHEMA_ASSERTION ) )
      testStep.addAssertion( SchemaComplianceAssertion.ID );

    UISupport.selectAndShow( testStep );

    if( dialog.getBooleanValue( Form.CLOSE_REQUEST ) && desktop != null )
    {
      desktop.closeDesktopPanel( request );
    }

    if( dialog.getBooleanValue( Form.SHOW_TESTCASE ) )
    {
      UISupport.selectAndShow( testCase );
View Full Code Here

        dialog.setBooleanValue(Form.CLOSE_EDITOR, true);
        dialog.setBooleanValue(Form.SHOW_TESTCASE, true);
        dialog.setIntValue(Form.PORT, mockService.getPort());
        dialog.setValue(Form.PATH, mockService.getPath());

        SoapUIDesktop desktop = SoapUI.getDesktop();
        dialog.getFormField(Form.CLOSE_EDITOR).setEnabled(desktop != null && desktop.hasDesktopPanel(mockResponse));

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

        if (dialog.getBooleanValue(Form.ADD_SCHEMA_ASSERTION)) {
            testStep.addAssertion(SchemaComplianceAssertion.ID);
        }

        UISupport.selectAndShow(testStep);

        if (dialog.getBooleanValue(Form.CLOSE_EDITOR) && desktop != null) {
            desktop.closeDesktopPanel(mockResponse);
        }

        if (dialog.getBooleanValue(Form.SHOW_TESTCASE)) {
            UISupport.selectAndShow(testCase);
        }
View Full Code Here

        dialogValues.put(STEP_NAME, request.getRestMethod().getName() + " - " + request.getName());
        dialogValues.put(CLOSE_REQUEST, "true");
        dialogValues.put(SHOW_TESTCASE, "true");
        dialogValues.put(SHOW_REQUEST, "true");

        SoapUIDesktop desktop = SoapUI.getDesktop();
        closeRequestCheckBox.setEnabled(desktop != null && desktop.hasDesktopPanel(request));

        dialogValues = dialog.show(dialogValues);
        if (dialog.getReturnValue() != XFormDialog.OK_OPTION) {
            return false;
        }

        String name = dialogValues.get(STEP_NAME);

        RestTestRequestStep testStep = (RestTestRequestStep) testCase.insertTestStep(
                RestRequestStepFactory.createConfig(request, name), position);

        if (testStep == null) {
            return false;
        }

        if (dialogValues.getBoolean(CLOSE_REQUEST) && desktop != null) {
            desktop.closeDesktopPanel(request);
        }

        if (dialogValues.getBoolean(SHOW_TESTCASE)) {
            UISupport.selectAndShow(testCase);
        }
View Full Code Here

        dialog.setBooleanValue(Form.CLOSE_REQUEST, true);
        dialog.setBooleanValue(Form.SHOW_TESTCASE, true);
        dialog.setIntValue(Form.PORT, 8181);
        dialog.setValue(Form.PATH, "/" + operation.getName());

        SoapUIDesktop desktop = SoapUI.getDesktop();
        dialog.getFormField(Form.CLOSE_REQUEST).setEnabled(desktop != null && desktop.hasDesktopPanel(request));

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

        if (create) {
            String response = operation.createResponse(operation.getSettings().getBoolean(
                    WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS));
            CompressedStringSupport.setString(responseContent, response);
        } else if (request.getResponse() != null) {
            String response = request.getResponse().getContentAsString();
            CompressedStringSupport.setString(responseContent, response);
        }

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

        if (dialog.getBooleanValue(Form.ADD_SCHEMA_ASSERTION)) {
            testStep.addAssertion(SchemaComplianceAssertion.ID);
        }

        UISupport.selectAndShow(testStep);

        if (dialog.getBooleanValue(Form.CLOSE_REQUEST) && desktop != null) {
            desktop.closeDesktopPanel(request);
        }

        if (dialog.getBooleanValue(Form.SHOW_TESTCASE)) {
            UISupport.selectAndShow(testCase);
        }
View Full Code Here

        dialog.setBooleanValue(COPY_ATTACHMENTS, true);

        dialog.getFormField(COPY_HTTPHEADERS).setEnabled(request.getRequestHeaders().size() > 0);
        dialog.setBooleanValue(COPY_HTTPHEADERS, false);

        SoapUIDesktop desktop = SoapUI.getDesktop();
        closeRequestCheckBox.setEnabled(desktop != null && desktop.hasDesktopPanel(request));

        boolean bidirectional = request.getOperation().isBidirectional();
        dialog.getFormField(ADD_SCHEMA_ASSERTION).setEnabled(bidirectional);
        dialog.getFormField(ADD_SOAP_FAULT_ASSERTION).setEnabled(bidirectional);
        dialog.getFormField(ADD_SOAP_RESPONSE_ASSERTION).setEnabled(bidirectional);

        dialogValues = dialog.show(dialogValues);
        if (dialog.getReturnValue() != XFormDialog.OK_OPTION) {
            return false;
        }

        String name = dialogValues.get(STEP_NAME);

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

        if (testStep == null) {
            return false;
        }

        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) {
            desktop.closeDesktopPanel(request);
        }

        if (dialogValues.getBoolean(SHOW_TESTCASE)) {
            UISupport.selectAndShow(testCase);
        }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.ui.desktop.SoapUIDesktop

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.