Boolean isParent = true;
EasyFrameworkMethod parentMethod = null;
for (Map<String, Object> testData : methodData) {
if (runInContext) {
Repeat repeatTests = method.getAnnotation(Repeat.class);
if (repeatTests != null || getRepeatCount() != null) {
int repeatCount = getRepeatCount() != null ? getRepeatCount() : repeatTests.times();
for (int count = 0; count < repeatCount; count++) {
TestResultBean testResultBean = new TestResultBean(methodWithData.getMethod()
.getName(), new Date());
testReportContainer.addTestResult(testResultBean);
// Create a new FrameworkMethod for each set of test data
EasyFrameworkMethod easyMethod = new EasyFrameworkMethod(method.getMethod(),
testData, testResultBean, method.getName().concat(testData.toString()));
easyMethod.setName(method.getName().concat("_").concat(String.valueOf(count))
.concat(testData.toString()));
if (isParent) {
List<EasyFrameworkMethod> childMethods = new ArrayList<EasyFrameworkMethod>();
easyMethod.setChildMethods(childMethods);
finalList.add(easyMethod);
isParent = false;
parentMethod = easyMethod;
} else {
parentMethod.getChildMethods().add(easyMethod);
}
}
} else {
TestResultBean testResultBean = new TestResultBean(
methodWithData.getMethod().getName(), new Date());
testReportContainer.addTestResult(testResultBean);
// Create a new FrameworkMethod for each set of test data
EasyFrameworkMethod easyMethod = new EasyFrameworkMethod(method.getMethod(), testData,
testResultBean, method.getName().concat(testData.toString()));
easyMethod.setName(method.getName().concat(testData.toString()));
// finalList.add(easyMethod);
if (isParent) {
List<EasyFrameworkMethod> childMethods = new ArrayList<EasyFrameworkMethod>();
easyMethod.setChildMethods(childMethods);
isParent = false;
finalList.add(easyMethod);
parentMethod = easyMethod;
} else {
parentMethod.getChildMethods().add(easyMethod);
// finalList.add(easyMethod);
}
}
} else {
Repeat repeatTests = method.getAnnotation(Repeat.class);
if (repeatTests != null || getRepeatCount() != null) {
int repeatCount = getRepeatCount() != null ? getRepeatCount() : repeatTests.times();
for (int count = 0; count < repeatCount; count++) {
TestResultBean testResultBean = new TestResultBean(methodWithData.getMethod()
.getName(), new Date());
testReportContainer.addTestResult(testResultBean);
// Create a new FrameworkMethod for each set of test data