returnType = testedElementName.substring(0, pos);
pos1 -= pos + 1;
testedElementName = testedElementName.substring(pos + 1);
}
int pos2 = testedElementName.lastIndexOf(')');
Member testedElement = null;
if (pos1 >= 0 && pos2 >= 0) {
String[] params = {}, exceptions = {};
if (pos2 > pos1 + 2) {
params = parseTypeList(testedElementName.substring(pos1 + 1, pos2));
}
String THROWS_KEYWORD = "throws ";
int pos3 = testedElementName.indexOf(THROWS_KEYWORD, pos2);
if (pos3 >= pos2) {
exceptions = parseTypeList(testedElementName.substring(pos3 + THROWS_KEYWORD.length()));
}
testedElementName = testedElementName.substring(0, pos1);
if (methodParent == null) {
continue;
}
if (testedElementName != methodParent.getName() && returnType == null) {
returnType = "void";
}
JavaMethod javaMethod = (JavaMethod) ensureJavaMethod(testedElementName, returnType, params, exceptions, methodParent.getMembers());
testedElement = javaMethod;
} else {
JavaField javaField = (JavaField) ensureJavaElement(testedElementName, methodParent.getMembers(), JexPackage.eINSTANCE.getJavaField());
javaField.setType(returnType);
testedElement = javaField;
}
javaMethodTester.getTestedElements().add(testedElement);
JavaRequirement javaReq = JexFactory.eINSTANCE.createJavaRequirement();
javaReq.setText("Requires " + testedElements[i].trim());
javaReq.setJavaElement(testedElement);
if (modifiers != null) {
testedElement.setModifiers((Integer) JexFactory.eINSTANCE.createFromString(JexPackage.eINSTANCE.getModifiers(), modifiers));
} else {
javaReq.setRequiredFeatures("!modifiers");
}
testReq.getRequirements().add(javaReq);
}