Examples of Parallel


Examples of org.apache.commons.scxml2.model.Parallel

        //Validate child counts:
        for (Map.Entry<EnterableState, Set<EnterableState>> entry : counts.entrySet()) {
            EnterableState es = entry.getKey();
            Set<EnterableState> count = entry.getValue();
            if (es instanceof Parallel) {
                Parallel p = (Parallel) es;
                if (count.size() < p.getChildren().size()) {
                    errRep.onError(ErrorConstants.ILLEGAL_CONFIG, "Not all AND states active for parallel " + p.getId(), entry);
                    legalConfig = false;
                }
            } else {
                if (count.size() > 1) {
                    errRep.onError(ErrorConstants.ILLEGAL_CONFIG, "Multiple OR states active for state " + es.getId(), entry);
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Parallel

        // run init in parent thread, then resolve in children
        project.setProperty("ivy.settings.file", "test/repositories/ivysettings-with-nio.xml");
        project.setProperty("ivy.log.locking", "true");
        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml"));

        Parallel parallel = new Parallel();
        parallel.setThreadCount(4);
        parallel.addTask(resolve);
        parallel.addTask(resolve);
        parallel.addTask(resolve);
        parallel.addTask(resolve);
        parallel.execute();
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Parallel

        Project project = (Project)prCtrl.getMock();

        TaskRegistry registry = TaskRegistry.init(project);

        MockControl tkCtrl = MockClassControl.createControl(Parallel.class);
        Parallel task = (Parallel)tkCtrl.getMock();
        task.getTaskName();
        tkCtrl.setReturnValue("blah");

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getTask();
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Parallel

     * Create a newly bound parallel instance
     * @param parallelTimeout timeout
     * @return a bound and initialised parallel instance.
     */
    private Parallel newParallel(long parallelTimeout) {
        Parallel par = new Parallel();
        bind(par);
        par.setFailOnAny(true);
        par.setTimeout(parallelTimeout);
        return par;
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Parallel

     * @param parallelTimeout timeout
     * @param child task
     * @return a bound and initialised parallel instance.
     */
    private Parallel newParallel(long parallelTimeout, Task child) {
        Parallel par = newParallel(parallelTimeout);
        par.addTask(child);
        return par;
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Parallel

        }

        long timeoutMillis = timeout * timeoutUnitMultiplier;

        //set up the application to run in a separate thread
        Parallel applicationRun = newParallel(timeoutMillis);
        //with a worker which we can use to manage it
        WorkerAnt worker = new WorkerAnt(applicationRun, null);
        if (application != null) {
            applicationRun.addTask(application);
        }

        //The test run consists of the block followed by the tests.
        long testRunTimeout = 0;
        Sequential testRun = new Sequential();
        bind(testRun);
        if (block != null) {
            //waitfor is not a task, it needs to be adapted
            TaskAdapter ta = new TaskAdapter(block);
            ta.bindToOwner(this);
            validateTask(ta, "block");
            testRun.addTask(ta);
            //add the block time to the total test run timeout
            testRunTimeout = block.calculateMaxWaitMillis();
        }

        //add the tests and more delay
        if (tests != null) {
            testRun.addTask(tests);
            testRunTimeout += timeoutMillis;
        }
        //add the reporting and more delay
        if (reporting != null) {
            testRun.addTask(reporting);
            testRunTimeout += timeoutMillis;
        }

        //wrap this in a parallel purely to set up timeouts for the
        //test run
        timedTests = newParallel(testRunTimeout, testRun);

        try {
            //run any setup task
            if (setup != null) {
                Parallel setupRun = newParallel(timeoutMillis, setup);
                setupRun.execute();
            }
            //start the worker thread and leave it running
            worker.start();
            //start the probe+test sequence
            timedTests.execute();
        } catch (BuildException e) {
            //Record the exception and continue
            testException = e;
        } finally {
            //teardown always runs; its faults are filed away
            if (teardown != null) {
                try {
                    Parallel teardownRun = newParallel(timeoutMillis, teardown);
                    teardownRun.execute();
                } catch (BuildException e) {
                    teardownException = e;
                }
            }
        }
View Full Code Here

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

Examples of org.jcsp.lang.Parallel

                registeredLabel,
                attendeesLabel,
                registeredLocationLabel,
                attendeeNumberLabel,
                main};
        new Parallel(network).run();
    }
View Full Code Here

Examples of org.jcsp.lang.Parallel

                registeredLabel,
                attendeesLabel,
                registeredLocationLabel,
                attendeeNumberLabel,
                main};
        new Parallel(network).run();
    }
View Full Code Here

Examples of org.jcsp.lang.Parallel

                root,
                newButton,
                findButton
        };
        System.out.println("MeetingAccessFrame about to invoke PAR");
        new Parallel(network).run();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.