Package com.eviware.soapui.model.testsuite

Examples of com.eviware.soapui.model.testsuite.TestSuite


        updating = true;

        List<String> testCases = new ArrayList<String>();
        List<String> loadTests = new ArrayList<String>();

        TestSuite ts = getModelItem().getTestSuiteByName(mainForm.getComponentValue(TESTSUITE));
        String testCaseName = mainForm.getComponentValue(TESTCASE);
        if (ALL_VALUE.equals(testCaseName)) {
            testCaseName = null;
        }
View Full Code Here


    private String getScopedProperty(PropertyExpansionContext context, String pe, boolean globalOverride) {
        ModelItem modelItem = context.getModelItem();

        TestStep testStep = null;
        TestCase testCase = null;
        TestSuite testSuite = null;
        Project project = null;
        MockService mockService = null;
        AbstractMockResponse mockResponse = null;
        SecurityTest securityTest = null;

        if (modelItem instanceof WsdlTestStep) {
            testStep = (WsdlTestStep) modelItem;
            testCase = testStep.getTestCase();
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlTestCase) {
            testCase = (WsdlTestCase) modelItem;
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlLoadTest) {
            testCase = ((WsdlLoadTest) modelItem).getTestCase();
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlTestSuite) {
            testSuite = (WsdlTestSuite) modelItem;
            project = testSuite.getProject();
        } else if (modelItem instanceof WsdlInterface) {
            project = ((WsdlInterface) modelItem).getProject();
        } else if (modelItem instanceof WsdlProject) {
            project = (WsdlProject) modelItem;
        } else if (modelItem instanceof WsdlMockService) {
            mockService = (WsdlMockService) modelItem;
            project = mockService.getProject();
        } else if (modelItem instanceof TestRequest) {
            testStep = ((TestRequest) modelItem).getTestStep();
            testCase = testStep.getTestCase();
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof AbstractHttpRequestInterface<?>) {
            project = ((AbstractHttpRequest<?>) modelItem).getOperation().getInterface().getProject();
        } else if (modelItem instanceof RestResource) {
            project = modelItem.getProject();
        } else if (modelItem instanceof WsdlMockOperation) {
            mockService = ((WsdlMockOperation) modelItem).getMockService();
            project = mockService.getProject();
        } else if (modelItem instanceof AbstractMockResponse) {
            mockResponse = (AbstractMockResponse) modelItem;
            mockService = mockResponse.getMockOperation().getMockService();
            project = mockService.getProject();
        } else if (modelItem instanceof SecurityTest) {
            securityTest = (SecurityTest) modelItem;
            testCase = ((SecurityTest) modelItem).getTestCase();
            testSuite = testCase.getTestSuite();
            project = testSuite.getProject();
        } else if (modelItem instanceof OAuth2Profile) {
            project = ((WsdlProject) modelItem.getParent());
        }

        // no project -> nothing
View Full Code Here

                                        testCases.add(testCase.getName());
                                    }
                                }
                            }
                        } else {
                            TestSuite testSuite = getModelItem().getTestSuiteByName(newValue);
                            if (testSuite != null) {
                                testCases.addAll(Arrays.asList(ModelSupport.getNames(testSuite.getTestCaseList())));
                            }
                        }

                        testCases.add(0, ALL_VALUE);
                        mainForm.setOptions(TESTCASE, testCases.toArray());

                        if (testCases.contains(tc)) {
                            mainForm.getFormField(TESTCASE).setValue(tc);
                        }
                    }
                });

        mainForm.addComboBox(TESTCASE, new String[]{}, "The TestCase to run").addFormFieldListener(
                new XFormFieldListener() {

                    public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
                        List<String> securityTests = new ArrayList<String>();
                        String st = mainForm.getComponentValue(SECURITYTEST);

                        if (newValue.equals(ALL_VALUE)) {
                            for (TestSuite testSuite : testSuites) {
                                for (TestCase testCase : testSuite.getTestCaseList()) {
                                    for (SecurityTest securityTest : testCase.getSecurityTestList()) {
                                        if (!securityTests.contains(securityTest.getName())) {
                                            securityTests.add(securityTest.getName());
                                        }
                                    }
View Full Code Here

                                new String[]{CREATE_NEW_OPTION});
                        dialog.setOptions(Form.TESTSUITE, names);
                        dialog.setValue(Form.TESTSUITE, names[0]);

                        if (names.length > 1) {
                            TestSuite testSuite = project.getTestSuiteByName(names[0]);
                            dialog.setOptions(Form.TESTCASE,
                                    ModelSupport.getNames(testSuite.getTestCaseList(), new String[]{CREATE_NEW_OPTION}));
                        } else {
                            dialog.setOptions(Form.TESTCASE, new String[]{CREATE_NEW_OPTION});
                        }
                    }
                }
            });

            dialog.getFormField(Form.TESTSUITE).addFormFieldListener(new XFormFieldListener() {

                public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
                    if (newValue.equals(CREATE_NEW_OPTION)) {
                        dialog.setOptions(Form.TESTCASE, new String[]{CREATE_NEW_OPTION});
                    } else {
                        String projectName = dialog.getValue(Form.PROJECT);
                        Project project = SoapUI.getWorkspace().getProjectByName(projectName);
                        TestSuite testSuite = project.getTestSuiteByName(newValue);
                        dialog.setOptions(Form.TESTCASE, testSuite == null ? new String[]{CREATE_NEW_OPTION}
                                : ModelSupport.getNames(testSuite.getTestCaseList(), new String[]{CREATE_NEW_OPTION}));
                    }
                }
            });

        }
View Full Code Here

        if (SoapUI.getTestMonitor() == null) {
            return false;
        }

        for (int c = 0; c < iface.getProject().getTestSuiteCount(); c++) {
            TestSuite testSuite = iface.getProject().getTestSuiteAt(c);
            for (int i = 0; i < testSuite.getTestCaseCount(); i++) {
                TestCase testCase = testSuite.getTestCaseAt(i);
                if (!SoapUI.getTestMonitor().hasRunningTest(testCase)) {
                    continue;
                }

                for (int j = 0; j < testCase.getTestStepCount(); j++) {
View Full Code Here

        return false;
    }

    public static boolean hasDependingTests(AbstractInterface<?> iface) {
        for (int c = 0; c < iface.getProject().getTestSuiteCount(); c++) {
            TestSuite testSuite = iface.getProject().getTestSuiteAt(c);
            for (int i = 0; i < testSuite.getTestCaseCount(); i++) {
                TestCase testCase = testSuite.getTestCaseAt(i);

                for (int j = 0; j < testCase.getTestStepCount(); j++) {
                    WsdlTestStep testStep = (WsdlTestStep) testCase.getTestStepAt(j);
                    if (testStep.dependsOn(iface)) {
                        return true;
View Full Code Here

    }

    private boolean hasRunningTests(WsdlProject project) {
        for (int c = 0; c < project.getTestSuiteCount(); c++) {
            TestSuite testSuite = project.getTestSuiteAt(c);
            for (int i = 0; i < testSuite.getTestCaseCount(); i++) {
                if (SoapUI.getTestMonitor().hasRunningTest(testSuite.getTestCaseAt(i))) {
                    return true;
                }
            }
        }
View Full Code Here

                                        testCases.add(testCase.getName());
                                    }
                                }
                            }
                        } else {
                            TestSuite testSuite = getModelItem().getTestSuiteByName(newValue);
                            if (testSuite != null) {
                                testCases.addAll(Arrays.asList(ModelSupport.getNames(testSuite.getTestCaseList())));
                            }
                        }

                        testCases.add(0, ALL_VALUE);
                        mainForm.setOptions(TESTCASE, testCases.toArray());
View Full Code Here

                                        testCases.add(testCase.getName());
                                    }
                                }
                            }
                        } else {
                            TestSuite testSuite = getModelItem().getTestSuiteByName(newValue);
                            if (testSuite != null) {
                                testCases.addAll(Arrays.asList(ModelSupport.getNames(testSuite.getTestCaseList())));
                            }
                        }

                        testCases.add(0, ALL_VALUE);
                        mainForm.setOptions(TESTCASE, testCases.toArray());

                        if (testCases.contains(tc)) {
                            mainForm.getFormField(TESTCASE).setValue(tc);
                        }
                    }
                });

        mainForm.addComboBox(TESTCASE, new String[]{}, "TestCase").addFormFieldListener(new XFormFieldListener() {

            public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
                List<String> securityTests = new ArrayList<String>();
                String st = mainForm.getComponentValue(SECURITY_TEST_NAME);

                if (newValue.equals(ALL_VALUE)) {
                    for (TestSuite testSuite : testSuites) {
                        for (TestCase testCase : testSuite.getTestCaseList()) {
                            for (SecurityTest securityTest : testCase.getSecurityTestList()) {
                                if (!securityTests.contains(securityTest.getName())) {
                                    securityTests.add(securityTest.getName());
                                }
                            }
View Full Code Here

        List<TestCase> testCasesToRun = new ArrayList<TestCase>();

        // start by listening to all testcases.. (since one testcase can call
        // another)
        for (int c = 0; c < project.getTestSuiteCount(); c++) {
            TestSuite suite = project.getTestSuiteAt(c);
            for (int i = 0; i < suite.getTestCaseCount(); i++) {
                TestCase tc = suite.getTestCaseAt(i);
                if ((testSuite == null || suite.getName().equals(suite.getName())) && testCase != null
                        && tc.getName().equals(testCase)) {
                    testCasesToRun.add(tc);
                }

                addListeners(tc);
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.TestSuite

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.