Package org.easetech.easytest.annotation

Examples of org.easetech.easytest.annotation.Parallel


     * Set whether the tests should be run in parallel or serial.
     */
    protected void setSchedulingStrategy() {
        Class<?> testClass = getTestClass().getJavaClass();
        super.setScheduler(SchedulerStrategy.getScheduler(testClass , false));
        Parallel parallelAnnotation = testClass.getAnnotation(Parallel.class);
        if(parallelAnnotation != null) {
            int threads = parallelAnnotation.threads();
            System.setProperty(SystemProperties.PARALLEL_THREAD_COUNT.getValue(), String.valueOf(threads));
        }
       
       
    }
View Full Code Here


     * @param testClass the Class under test
     * @param policyApplied Identifies whether a test Policy identified by {@link TestPolicy} annotation has been applied or not
     * @return an implementation of {@link RunnerScheduler}
     */
    public static RunnerScheduler getScheduler(Class<?> testClass , Boolean policyApplied) {
        Parallel parallelAnnotation = testClass.getAnnotation(Parallel.class);
        String parallelThreadsStr = System.getProperty(SystemProperties.PARALLEL_THREAD_COUNT.getValue());
        Integer parallelThreads = null;
        if (parallelThreadsStr != null) {
            parallelThreads = Integer.valueOf(parallelThreadsStr);
        }

        if (parallelThreads != null) {
            if (parallelThreads <= 0) {
                return new ParallelScheduler();
            } else {
                return new ParallelScheduler(parallelThreads);
            }
        } else {
            if (parallelAnnotation != null) {
                if (parallelAnnotation.threads() <= 0) {
                    return new ParallelScheduler();
                } else {
                    return new ParallelScheduler(parallelAnnotation.threads());
                }

            }
        }
        if(policyApplied) {
View Full Code Here

TOP

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

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.