Package org.easetech.easytest.annotation

Examples of org.easetech.easytest.annotation.Repeat


                   
                    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
View Full Code Here


    public static void handleMethodsWithNoData(List<FrameworkMethod> methodsWithNoData,
        List<FrameworkMethod> finalList, ReportDataContainer testReportContainer) {
        for (FrameworkMethod fMethod : methodsWithNoData) {

            Repeat repeatTests = fMethod.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(fMethod.getMethod().getName(), new Date());
                    testReportContainer.addTestResult(testResultBean);
                    // Create a new FrameworkMethod for each set of test data
                    EasyFrameworkMethod easyMethod = new EasyFrameworkMethod(fMethod.getMethod(), null, testResultBean,
View Full Code Here

TOP

Related Classes of org.easetech.easytest.annotation.Repeat

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.