Search in sources :

Example 1 with RunTestSuiteTask

use of com.hazelcast.simulator.coordinator.tasks.RunTestSuiteTask in project hazelcast-simulator by hazelcast.

the class Coordinator method testRun.

public String testRun(RcTestRunOperation op) {
    LOGGER.info("Run starting...");
    final RunTestSuiteTask runTestSuiteTask = createRunTestSuiteTask(op.getTestSuite());
    if (op.isAsync()) {
        if (op.getTestSuite().size() > 1) {
            throw new IllegalArgumentException("1 test in testsuite allowed");
        }
        new Thread(new Runnable() {

            @Override
            public void run() {
                runTestSuiteTask.run();
            }
        }).start();
        for (; ; ) {
            sleepSeconds(1);
            for (TestData test : registry.getTests()) {
                if (test.getTestSuite() == op.getTestSuite()) {
                    return test.getTestCase().getId();
                }
            }
        }
    } else {
        boolean success = runTestSuiteTask.run();
        LOGGER.info("Run complete!");
        return success ? null : "Run completed with failures!";
    }
}
Also used : TestData(com.hazelcast.simulator.coordinator.registry.TestData) RunTestSuiteTask(com.hazelcast.simulator.coordinator.tasks.RunTestSuiteTask)

Aggregations

TestData (com.hazelcast.simulator.coordinator.registry.TestData)1 RunTestSuiteTask (com.hazelcast.simulator.coordinator.tasks.RunTestSuiteTask)1