Package com.consol.citrus.model.testcase.core

Examples of com.consol.citrus.model.testcase.core.Testcase


        TestCaseData testCase = new TestCaseData();
        testCase.setName(testName);
        testCase.setPackageName(packageName);
        testCase.setType(type);

        Testcase testModel;
        if (type.equals(TestCaseType.XML)) {
            testModel = getXmlTestModel(project, packageName, testName);
        } else if (type.equals(TestCaseType.JAVA)) {
            testModel = getJavaTestModel(packageName, testName);
        } else {
            throw new CitrusAdminRuntimeException("Unsupported test case type: " + type);
        }

        if (testModel.getVariables() != null) {
            for (Variables.Variable variable : testModel.getVariables().getVariables()) {
                testCase.getVariables().put(variable.getName(), variable.getValue());
            }
        }

        testCase.setDescription(testModel.getDescription());
        testCase.setMetaInfo(testModel.getMetaInfo());

        for (Object actionType : testModel.getActions().getActionsAndSendsAndReceives()) {
            boolean converterFound = false;
            for (TestActionConverter testActionConverter : actionConverter) {
                if (testActionConverter.getModelClass().isInstance(actionType)) {
                    testCase.addTestAction(testActionConverter.convert(actionType));
                    converterFound = true;
View Full Code Here


                        } else if (!method.getName().equals(methodName)) {
                           continue;
                        }
                    }

                    Testcase model = getJavaDslTest(builder, method);
                    model.setName(StringUtils.hasText(methodName) ? methodName : testClassName);
                    return model;
                }
            }
        } catch (ClassNotFoundException e) {
            throw new CitrusAdminRuntimeException("Failed to load Java source as it is not part of classpath: " + packageName + "." + testClassName, e);
        } catch (Exception e) {
            throw new CitrusAdminRuntimeException("Failed to load Java source " + packageName + "." + testClassName, e);
        }

        Testcase testModel = new Testcase();
        testModel.setName(StringUtils.hasText(methodName) ? methodName : testClassName);
        return testModel;
    }
View Full Code Here

TOP

Related Classes of com.consol.citrus.model.testcase.core.Testcase

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.