Examples of StringToObjectMap


Examples of com.eviware.soapui.support.types.StringToObjectMap

    public RunFromTestStepAction() {
        super("Run from here", "Runs the TestCase starting at this step");
    }

    public void perform(WsdlTestStep testStep, Object param) {
        StringToObjectMap properties = recoverContextProperties(testStep);
        properties.put(TestCaseRunContext.INTERACTIVE, Boolean.TRUE);

        WsdlTestCaseRunner testCaseRunner = new WsdlTestCaseRunner(testStep.getTestCase(), properties);
        testCaseRunner.setStartStep(testStep.getTestCase().getIndexOfTestStep(testStep));
        testCaseRunner.start(true);
    }
View Full Code Here

Examples of com.eviware.soapui.support.types.StringToObjectMap

        testCaseRunner.setStartStep(testStep.getTestCase().getIndexOfTestStep(testStep));
        testCaseRunner.start(true);
    }

    private StringToObjectMap recoverContextProperties(WsdlTestStep testStep) {
        StringToObjectMap properties = null;
        try {
            if (testStep.getParent() instanceof WsdlTestCase) {
                properties = ((WsdlTestCase) testStep.getParent()).getRunFromHereContext();
            } else {
                properties = new StringToObjectMap();
            }
        } catch (Exception e) {
            properties = new StringToObjectMap();
        }
        return properties;
    }
View Full Code Here

Examples of com.eviware.soapui.support.types.StringToObjectMap

            return null;
        }

        name = name.substring(1);

        StringToObjectMap objects = new StringToObjectMap(context.getProperties());
        objects.put("context", context);
        objects.put("log", SoapUI.ensureGroovyLog());

        if (context instanceof TestCaseRunContext) {
            TestCaseRunContext testCaseRunContext = (TestCaseRunContext) context;
            objects.put("testRunner", testCaseRunContext.getTestRunner());

            objects.put("testStep", testCaseRunContext.getCurrentStep());

            if (testCaseRunContext.getCurrentStep() instanceof SamplerTestStep) {
                objects.put("request", ((SamplerTestStep) testCaseRunContext.getCurrentStep()).getTestRequest());
            }
        }

        if (context instanceof LoadTestRunContext) {
            objects.put("loadTestRunner", ((LoadTestRunContext) context).getLoadTestRunner());
        }

        if (context instanceof MockRunContext) {
            objects.put("mockRunner", ((MockRunContext) context).getMockRunner());
        }

        ModelItem modelItem = context.getModelItem();
        if (modelItem instanceof TestCase) {
            objects.put("testCase", modelItem);

            objects.put("testSuite", ((TestCase) modelItem).getTestSuite());
            objects.put("project", ((TestCase) modelItem).getTestSuite().getProject());
        } else if (modelItem instanceof TestStep) {
            objects.put("testStep", modelItem);

            if (modelItem instanceof SamplerTestStep) {
                objects.put("request", ((SamplerTestStep) modelItem).getTestRequest());
            }

            objects.put("testCase", ((TestStep) modelItem).getTestCase());
            objects.put("testSuite", ((TestStep) modelItem).getTestCase().getTestSuite());
            objects.put("project", ((TestStep) modelItem).getTestCase().getTestSuite().getProject());
        } else if (modelItem instanceof TestSuite) {
            objects.put("testSuite", modelItem);
            objects.put("project", ((TestSuite) modelItem).getProject());
        }
        if (modelItem instanceof LoadTest) {
            objects.put("loadTest", modelItem);
            objects.put("testCase", ((LoadTest) modelItem).getTestCase());
            objects.put("testSuite", ((LoadTest) modelItem).getTestCase().getTestSuite());
            objects.put("project", ((LoadTest) modelItem).getTestCase().getTestSuite().getProject());
        } else if (modelItem instanceof Project) {
            objects.put("project", modelItem);
        } else if (modelItem instanceof MockService) {
            objects.put("mockService", modelItem);
            objects.put("project", ((MockService) modelItem).getProject());
        } else if (modelItem instanceof MockOperation) {
            objects.put("mockOperation", modelItem);
            objects.put("mockService", ((MockOperation) modelItem).getMockService());
            objects.put("project", ((MockOperation) modelItem).getMockService().getProject());
        } else if (modelItem instanceof MockResponse) {
            objects.put("mockResponse", modelItem);
            objects.put("mockOperation", ((MockResponse) modelItem).getMockOperation());
            objects.put("mockService", ((MockResponse) modelItem).getMockOperation().getMockService());
            objects.put("project", ((MockResponse) modelItem).getMockOperation().getMockService().getProject());
        } else if (modelItem instanceof Request) {
            objects.put("request", modelItem);

            if (modelItem instanceof TestRequest) {
                objects.put("testStep", ((TestRequest) modelItem).getTestStep());
                objects.put("testCase", ((TestRequest) modelItem).getTestStep().getTestCase());
                objects.put("testSuite", ((TestRequest) modelItem).getTestStep().getTestCase().getTestSuite());
                objects.put("project", ((TestRequest) modelItem).getTestStep().getTestCase().getTestSuite()
                        .getProject());
            }
        } else if (modelItem instanceof Operation) {
            objects.put("operation", modelItem);
        } else if (modelItem instanceof Interface) {
            objects.put("interface", modelItem);
        } else if (modelItem instanceof SecurityTest) {
            objects.put("securityTest", modelItem);
        }

        if (modelItem != null) {
            objects.put("modelItem", modelItem);
        }

        return doEval(name, modelItem, objects);
    }
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.