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;