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

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


    }

    public void beforeRun(TestCaseRunner testRunner, TestCaseRunContext runContext) {
        if (testRunner.getTestCase() instanceof WsdlTestCase) {
            try {
                WsdlTestCase wsdlTestCase = (WsdlTestCase) testRunner.getTestCase();

                if (wsdlTestCase.getConfig().getAmfAuthorisation()) {
                    if (noAMFTestSteps(wsdlTestCase)) {
                        return;
                    }

                    String endpoint = runContext.expand(wsdlTestCase.getConfig().getAmfEndpoint());
                    String username = runContext.expand(wsdlTestCase.getConfig().getAmfLogin());
                    String password = runContext.expand(wsdlTestCase.getConfig().getAmfPassword());

                    SoapUIAMFConnection amfConnection = null;

                    if (StringUtils.hasContent(endpoint)) {
                        if (StringUtils.hasContent(username)) {
View Full Code Here


    public static Set<Interface> getRequiredInterfaces(WsdlTestSuite testSuite, WsdlProject targetProject) {
        Set<Interface> requiredInterfaces = new HashSet<Interface>();

        for (int i = 0; i < testSuite.getTestCaseCount(); i++) {
            WsdlTestCase testCase = testSuite.getTestCaseAt(i);

            for (int y = 0; y < testCase.getTestStepCount(); y++) {
                WsdlTestStep testStep = testCase.getTestStepAt(y);
                requiredInterfaces.addAll(testStep.getRequiredInterfaces());
            }
        }

        if (requiredInterfaces.size() > 0 && targetProject.getInterfaceCount() > 0) {
View Full Code Here

    }

    public void perform(WsdlMockResponse mockResponse, Object param) {
        WsdlProject project = (WsdlProject) ModelSupport.getModelItemProject(mockResponse);

        WsdlTestCase testCase = getTargetTestCase(project);
        if (testCase != null) {
            addRequest(testCase, mockResponse, -1);
        }
    }
View Full Code Here

        super("Add to TestCase", "Adds this MockResponse to a TestCase");
    }

    public void perform(WsdlMockResponse mockResponse, Object param) {
        WsdlMockService mockService = mockResponse.getMockOperation().getMockService();
        WsdlTestCase testCase = getTargetTestCase(mockService.getProject());
        if (testCase == null) {
            return;
        }

        addMockResponseToTestCase(mockResponse, testCase, -1);
View Full Code Here

                        testStep.getId(), AbstractSecurityScanWithProperties.class));
                dialog.setOptions(CloneParameterDialog.TARGET_SECURITYSCAN, securityScanNames);
            }
        });

        WsdlTestCase wsdlTestCase = (WsdlTestCase) securityScan.getTestStep().getTestCase();

        dialog.setOptions(CloneParameterDialog.TARGET_TESTSUITE,
                ModelSupport.getNames(wsdlTestCase.getTestSuite().getProject().getTestSuiteList()));
        dialog.setValue(CloneParameterDialog.TARGET_TESTSUITE, wsdlTestCase.getTestSuite().getName());

        List<TestCase> wsdlTestCaseList = wsdlTestCase.getTestSuite().getTestCaseList();
        dialog.setOptions(CloneParameterDialog.TARGET_TESTCASE, ModelSupport.getNames(wsdlTestCaseList));
        dialog.setValue(CloneParameterDialog.TARGET_TESTCASE, wsdlTestCase.getName());

        dialog.setOptions(CloneParameterDialog.TARGET_TESTSTEP, getSecurableTestStepsNames(wsdlTestCase));
        dialog.setOptions(CloneParameterDialog.TARGET_SECURITYTEST,
                ModelSupport.getNames(wsdlTestCase.getSecurityTestList()));

        String securityTestName = dialog.getValue(CloneParameterDialog.TARGET_SECURITYTEST);
        SecurityTest securityTest = wsdlTestCase.getSecurityTestByName(securityTestName);
        String testStepName = dialog.getValue(CloneParameterDialog.TARGET_TESTSTEP);
        TestStep testStep = wsdlTestCase.getTestStepByName(testStepName);

        String[] securityScanNames = ModelSupport.getNames(securityTest.getTestStepSecurityScanByType(testStep.getId(),
                AbstractSecurityScanWithProperties.class));
        dialog.setOptions(CloneParameterDialog.TARGET_SECURITYSCAN, securityScanNames);
View Full Code Here

                WsdlTestCaseRunner callingTestCaseRunner = (WsdlTestCaseRunner) runContext
                        .getProperty("#CallingTestCaseRunner#");

                if (callingTestCaseRunner != null) {
                    WsdlTestCase ctc = callingTestCaseRunner.getTestCase();
                    WsdlRunTestCaseTestStep runTestCaseTestStep = (WsdlRunTestCaseTestStep) runContext
                            .getProperty("#CallingRunTestCaseStep#");

                    nameBase = StringUtils.createFileName(ctc.getTestSuite().getName(), '_') + exportSeparator
                            + StringUtils.createFileName(ctc.getName(), '_') + exportSeparator
                            + StringUtils.createFileName(runTestCaseTestStep.getName(), '_') + exportSeparator
                            + StringUtils.createFileName(tc.getTestSuite().getName(), '_') + exportSeparator
                            + StringUtils.createFileName(tc.getName(), '_') + exportSeparator
                            + StringUtils.createFileName(currentStep.getName(), '_') + "-" + count.longValue() + "-"
                            + result.getStatus();
View Full Code Here

        if (targetTestCase != null) {
            targetTestCase.getTestSuite().removeTestSuiteListener(testSuiteListener);
            targetTestCase.removeTestPropertyListener(testPropertyListener);
        }

        WsdlTestCase oldTestCase = this.targetTestCase;
        this.targetTestCase = testCase;

        if (testCase != null) {
            stepConfig.setTargetTestCase(testCase.getId());
View Full Code Here

        try {
            TestCaseConfig config = TestCaseConfig.Factory.parse(testCase.getConfig().xmlText());
            config.setLoadTestArray(new LoadTestConfig[0]);

            // clone entire testCase
            WsdlTestCase wsdlTestCase = testCase.getTestSuite().buildTestCase(config, true);
            wsdlTestCase.afterLoad();
            return wsdlTestCase;
        } catch (Throwable e) {
            SoapUI.logError(e);
        }
View Full Code Here

        super("Insert Step", "Inserts a TestStep at the position of this TestStep");
    }

    public void perform(WsdlTestStep testStep, Object param) {
        WsdlTestStepFactory factory = (WsdlTestStepFactory) param;
        WsdlTestCase testCase = testStep.getTestCase();

        if (!factory.canAddTestStepToTestCase(testCase)) {
            return;
        }

        String name = UISupport.prompt("Specify name for new step", "Insert Step", factory.getTestStepName());
        if (name != null) {
            TestStepConfig newTestStepConfig = factory.createNewTestStep(testCase, name);
            if (newTestStepConfig != null) {
                int ix = testCase.getIndexOfTestStep(testStep);
                testStep = testCase.insertTestStep(newTestStepConfig, ix + 1);
                if (testStep != null) {
                    UISupport.selectAndShow(testStep);
                }
            }
        }
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())) {
                WsdlInterface iface = (WsdlInterface) project.getInterfaceAt(c);
                for (int i = 0; i < iface.getOperationCount(); i++) {
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.