Examples of WsdlTestSuite


Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

            if (testCasesToRun.size() > 0) {
                for (TestCase testCase : testCasesToRun) {
                    runTestCase((WsdlTestCase) testCase);
                }
            } else if (testSuite != null) {
                WsdlTestSuite ts = project.getTestSuiteByName(testSuite);
                if (ts == null) {
                    throw new Exception("TestSuite with name [" + testSuite + "] not found in project");
                } else {
                    runSuite(ts);
                }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

            String targetTestSuiteName = dialog.getValue(Form.TESTSUITE);
            String targetTestCaseName = dialog.getValue(Form.TESTCASE);
            String name = dialog.getValue(Form.NAME);

            WsdlProject project = testStep.getTestCase().getTestSuite().getProject();
            WsdlTestSuite targetTestSuite = null;
            WsdlTestCase targetTestCase = null;
            Set<Interface> requiredInterfaces = new HashSet<Interface>();

            // to another project project?
            if (!targetProjectName.equals(project.getName())) {
                // get required interfaces
                requiredInterfaces.addAll(testStep.getRequiredInterfaces());

                project = (WsdlProject) workspace.getProjectByName(targetProjectName);
                if (project == null) {
                    targetProjectName = UISupport.prompt("Enter name for new Project", "Clone TestStep", "");
                    if (targetProjectName == null) {
                        return;
                    }

                    try {
                        project = workspace.createProject(targetProjectName, null);
                    } catch (SoapUIException e) {
                        UISupport.showErrorMessage(e);
                    }

                    if (project == null) {
                        return;
                    }
                }

                if (requiredInterfaces.size() > 0 && project.getInterfaceCount() > 0) {
                    Map<String, Interface> bindings = new HashMap<String, Interface>();
                    for (Interface iface : requiredInterfaces) {
                        bindings.put(iface.getTechnicalId(), iface);
                    }

                    for (Interface iface : project.getInterfaceList()) {
                        bindings.remove(iface.getTechnicalId());
                    }

                    requiredInterfaces.retainAll(bindings.values());
                }

                if (requiredInterfaces.size() > 0) {
                    String msg = "Target project [" + targetProjectName + "] is missing required Interfaces;\r\n\r\n";
                    for (Interface iface : requiredInterfaces) {
                        msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";
                    }
                    msg += "\r\nThese will be cloned to the targetProject as well";

                    if (!UISupport.confirm(msg, "Clone TestStep")) {
                        return;
                    }

                    for (Interface iface : requiredInterfaces) {
                        project.importInterface((AbstractInterface<?>) iface, true, true);
                    }
                }
            }

            targetTestSuite = project.getTestSuiteByName(targetTestSuiteName);
            if (targetTestSuite == null) {
                targetTestSuiteName = UISupport.prompt("Specify name for new TestSuite", "Clone TestStep", "Copy of "
                        + testStep.getTestCase().getTestSuite().getName());
                if (targetTestSuiteName == null) {
                    return;
                }

                targetTestSuite = project.addNewTestSuite(targetTestSuiteName);
            }

            targetTestCase = targetTestSuite.getTestCaseByName(targetTestCaseName);
            if (targetTestCase == null) {
                targetTestCaseName = UISupport.prompt("Specify name for new TestCase", "Clone TestStep", "Copy of "
                        + testStep.getTestCase().getName());
                if (targetTestCaseName == null) {
                    return;
                }

                targetTestCase = targetTestSuite.addNewTestCase(targetTestCaseName);
            }

            boolean move = dialog.getBooleanValue(Form.MOVE);

            WsdlTestStep newTestStep = targetTestCase.importTestStep(testStep, name, -1, !move);
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

        }
        while (project.getTestSuiteByName(name.trim()) != null) {
            name = UISupport.prompt("Specify unique name of TestSuite", "Rename TestSuite", name);
        }

        WsdlTestSuite testSuite = project.addNewTestSuite(name);
        UISupport.showDesktopPanel(testSuite);
        return testSuite;
    }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

                testSuiteName = UISupport.prompt("Enter name of TestSuite to create", "Generate TestSuite",
                        service.getName() + " TestSuite");
            }

            if (testSuiteName != null && testSuiteName.trim().length() > 0) {
                WsdlTestSuite testSuite = project.getTestSuiteByName(testSuiteName);

                if (testSuite == null) {
                    testSuite = project.addNewTestSuite(testSuiteName);
                    testSuite.setDescription("TestSuite generated for REST Service [" + service.getName() + "]");
                }

                int style = dialog.getValueIndex(GenerateForm.STYLE);
                boolean generateLoadTest = dialog.getBooleanValue(GenerateForm.GENERATE_LOADTEST);
                if (style == 0) {
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    @Test
    public void testScopedPropertyExpansion() throws Exception {
        WsdlProject project = new WsdlProject();
        project.addProperty("projectId").setValue("123");
        WsdlTestSuite testSuite = project.addNewTestSuite("TestSuite");
        testSuite.addProperty("testSuiteId").setValue("234");
        WsdlTestCase testCase = testSuite.addNewTestCase("TestCase");
        testCase.addProperty("testCaseId").setValue("345");

        WsdlTestStep testStep = testCase.addTestStep(GroovyScriptStepFactory.GROOVY_TYPE, "GroovyScript");

        MockTestRunner mockTestRunner = new MockTestRunner(testCase, Logger.getLogger("testing"));
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

                testSuiteName = UISupport.prompt("Enter name of TestSuite to create", "Generate TestSuite",
                        iface.getName() + " TestSuite");
            }

            if (testSuiteName != null && testSuiteName.trim().length() > 0) {
                WsdlTestSuite testSuite = project.getTestSuiteByName(testSuiteName);

                if (testSuite == null) {
                    testSuite = project.addNewTestSuite(testSuiteName);
                }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    public MoveTestCaseDownAction() {
        super("Move TestCase Down", "Moves this TestCase down");
    }

    public void perform(WsdlTestCase testCase, Object param) {
        WsdlTestSuite testSuite = testCase.getTestSuite();
        int ix = testSuite.getIndexOfTestCase(testCase);
        if (ix == -1 || ix >= testSuite.getTestCaseCount() - 1) {
            return;
        }

        testSuite.moveTestCase(ix, 1);
        UISupport.select(testCase);
    }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

            String targetProjectName = dialog.getValue(Form.PROJECT);
            String targetTestSuiteName = dialog.getValue(Form.TESTSUITE);
            String name = dialog.getValue(Form.NAME);

            WsdlProject project = testCase.getTestSuite().getProject();
            WsdlTestSuite targetTestSuite = null;
            Set<Interface> requiredInterfaces = new HashSet<Interface>();

            // to another project project?
            if (!targetProjectName.equals(project.getName())) {
                // get required interfaces
                for (int y = 0; y < testCase.getTestStepCount(); y++) {
                    WsdlTestStep testStep = testCase.getTestStepAt(y);
                    requiredInterfaces.addAll(testStep.getRequiredInterfaces());
                }

                project = (WsdlProject) workspace.getProjectByName(targetProjectName);
                if (project == null) {
                    targetProjectName = UISupport.prompt("Enter name for new Project", "Clone TestCase", "");
                    if (targetProjectName == null) {
                        return;
                    }

                    try {
                        project = workspace.createProject(targetProjectName, null);
                    } catch (SoapUIException e) {
                        UISupport.showErrorMessage(e);
                    }

                    if (project == null) {
                        return;
                    }
                }

                if (requiredInterfaces.size() > 0 && project.getInterfaceCount() > 0) {
                    Map<String, Interface> bindings = new HashMap<String, Interface>();
                    for (Interface iface : requiredInterfaces) {
                        bindings.put(iface.getTechnicalId(), iface);
                    }

                    for (Interface iface : project.getInterfaceList()) {
                        bindings.remove(iface.getTechnicalId());
                    }

                    requiredInterfaces.retainAll(bindings.values());
                }

                if (requiredInterfaces.size() > 0) {
                    String msg = "Target project [" + targetProjectName + "] is missing required Interfaces;\r\n\r\n";
                    for (Interface iface : requiredInterfaces) {
                        msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";
                    }
                    msg += "\r\nShould these will be cloned to the targetProject as well?";

                    Boolean result = UISupport.confirmOrCancel(msg, "Clone TestCase");
                    if (result == null) {
                        return;
                    }

                    if (result) {
                        for (Interface iface : requiredInterfaces) {
                            project.importInterface((AbstractInterface<?>) iface, true, true);
                        }
                    }
                }
            }

            targetTestSuite = project.getTestSuiteByName(targetTestSuiteName);
            if (targetTestSuite == null) {
                targetTestSuiteName = UISupport.prompt("Specify name for new TestSuite", "Clone TestCase", "Copy of "
                        + testCase.getTestSuite().getName());
                if (targetTestSuiteName == null) {
                    return;
                }

                targetTestSuite = project.addNewTestSuite(targetTestSuiteName);
            }

            boolean move = dialog.getBooleanValue(Form.MOVE);
            WsdlTestCase newTestCase = targetTestSuite.importTestCase(testCase, name, -1,
                    dialog.getBooleanValue(Form.CLONE_LOADTESTS), dialog.getBooleanValue(Form.CLONE_SECURITYTESTS),
                    !move);
            UISupport.select(newTestCase);

            if (move) {
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

    public MoveTestCaseUpAction() {
        super("Move TestCase Up", "Moves this TestCase up");
    }

    public void perform(WsdlTestCase testCase, Object param) {
        WsdlTestSuite testSuite = testCase.getTestSuite();
        int ix = testSuite.getIndexOfTestCase(testCase);
        if (ix == -1 || ix == 0) {
            return;
        }

        testSuite.moveTestCase(ix, -1);
        UISupport.select(testCase);
    }
View Full Code Here

Examples of com.eviware.soapui.impl.wsdl.WsdlTestSuite

        if (testCasesToRun.size() > 0) {
            for (TestCase tc : testCasesToRun) {
                runTestCase((WsdlTestCase) tc);
            }
        } else if (testSuite != null) {
            WsdlTestSuite ts = project.getTestSuiteByName(testSuite);
            if (ts == null) {
                throw new Exception("TestSuite with name [" + testSuite + "] not found in project");
            } else {
                runSuite(ts);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.