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

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


    }
  }

  public Object getValueAt( int rowIndex, int columnIndex )
  {
    WsdlTestCase testCase = loadTest.getTestCase();

    switch( columnIndex )
    {
    case 0 :
      return rowIndex == testCase.getTestStepCount() ? null : ColorPalette.getColor( testCase
          .getTestStepAt( rowIndex ) );
    case 1 :
    {
      if( rowIndex == testCase.getTestStepCount() )
      {
        return "TestCase:";
      }
      else
      {
        return testCase.getTestStepAt( rowIndex ).getLabel();
      }
    }
    case 4 :
    case 7 :
      return new Float( ( float )data[rowIndex][columnIndex - 2] / 100 );
View Full Code Here


    return result;
  }

  private WsdlOperation findWsdlOperation()
  {
    WsdlTestCase testCase = getTestCase();
    if( testCase == null || testCase.getTestSuite() == null )
      return null;

    Project project = testCase.getTestSuite().getProject();
    WsdlOperation operation = null;
    for( int c = 0; c < project.getInterfaceCount(); c++ )
    {
      if( project.getInterfaceAt( c ).getName().equals( requestStepConfig.getInterface() ) )
      {
View Full Code Here

    public static final String METHOD_NAME = "My Method";
    public static final String PATH = "/";

    @Test
    public void resourceIsFoundEvenThoughMultipleInterfacesWithDuplicateNameExists() throws RestRequestStepFactory.ItemDeletedException, XmlException, IOException, SoapUIException {
        WsdlTestCase testCase = Mockito.mock(WsdlTestCase.class);
        WsdlProject project = new WsdlProject();
        RestService restService1 = (RestService) project
                .addNewInterface(INTERFACE_NAME, RestServiceFactory.REST_TYPE);
        RestService restService2 = (RestService) project
                .addNewInterface(INTERFACE_NAME, RestServiceFactory.REST_TYPE);
        RestResource restResource = restService2.addNewResource(RESOURCE_NAME, PATH);
        restResource.addNewMethod(METHOD_NAME);
        Mockito.when(testCase.getParent()).thenReturn(project);

        TestStepConfig config = TestStepConfig.Factory.newInstance();
        RestRequestStepConfig configConfig = (RestRequestStepConfig) config.addNewConfig().changeType(RestRequestStepConfig.type);
        configConfig.setService(INTERFACE_NAME);
        configConfig.setResourcePath(PATH);
View Full Code Here

        super(modelItem);

        project = getModelItem().getTestCase().getTestSuite().getProject();

        getModelItem().addPropertyChangeListener(WsdlRunTestCaseTestStep.TARGET_TESTCASE, this);
        WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
        if (targetTestCase != null) {
            targetTestCase.addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
            targetTestCase.getTestSuite().addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
        }

        buildUI();
        setEnabledState();
View Full Code Here

        return propertiesTable;
    }

    private String createTitleForBorder() {
        WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
        return "TestCase ["
                + (targetTestCase == null ? "- none selected -" : targetTestCase.getTestSuite().getName() + ":"
                + targetTestCase.getName()) + "] Run Properties";
    }
View Full Code Here

    }

    public boolean onClose(boolean canCancel) {
        getModelItem().removePropertyChangeListener(WsdlRunTestCaseTestStep.TARGET_TESTCASE, this);

        WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
        if (targetTestCase != null) {
            targetTestCase.removePropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
            targetTestCase.getTestSuite().removePropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
        }

        testRunLog.release();
        if (optionsDialog != null) {
            optionsDialog.release();
View Full Code Here

    public void propertyChange(PropertyChangeEvent evt) {
        super.propertyChange(evt);

        if (evt.getPropertyName().equals(WsdlRunTestCaseTestStep.TARGET_TESTCASE)) {
            WsdlTestCase targetTestCase = (WsdlTestCase) evt.getOldValue();
            if (targetTestCase != null) {
                targetTestCase.removePropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
                targetTestCase.getTestSuite().removePropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
            }

            targetTestCase = (WsdlTestCase) evt.getNewValue();
            if (targetTestCase != null) {
                targetTestCase.addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
                targetTestCase.getTestSuite().addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
            }
        }

        setEnabledState();
        titledBorder.setTitle(createTitleForBorder());
View Full Code Here

            putValue(Action.SMALL_ICON, UISupport.createImageIcon("/testCase.gif"));
            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

                        List<TestCase> testCaseList = project.getTestSuiteByName(newValue).getTestCaseList();
                        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 {
                if (project.getTestSuiteCount() == 0) {
                    optionsDialog.setOptions(OptionsForm.TESTCASE, new String[0]);
View Full Code Here

                    }

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