Search in sources :

Example 1 with TestContext

use of com.hazelcast.simulator.test.TestContext in project hazelcast-simulator by hazelcast.

the class PerformanceMonitorTest method test_whenTestRunning_thenSendPerformanceStats.

@Test
public void test_whenTestRunning_thenSendPerformanceStats() {
    performanceMonitor.start();
    sleepMillis(300);
    DummyTest test = new DummyTest();
    TestContext testContext = addTest(test);
    Thread runTestThread = new RunTestThread();
    runTestThread.start();
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            assertPerfStatsSend();
        }
    });
    testContext.stop();
    joinThread(runTestThread);
    performanceMonitor.close();
}
Also used : DummyTest(com.hazelcast.simulator.tests.DummyTest) TestContext(com.hazelcast.simulator.test.TestContext) AssertTask(com.hazelcast.simulator.utils.AssertTask) CommonUtils.joinThread(com.hazelcast.simulator.utils.CommonUtils.joinThread) SuccessTest(com.hazelcast.simulator.tests.SuccessTest) Test(org.junit.Test) DummyTest(com.hazelcast.simulator.tests.DummyTest)

Aggregations

TestContext (com.hazelcast.simulator.test.TestContext)1 DummyTest (com.hazelcast.simulator.tests.DummyTest)1 SuccessTest (com.hazelcast.simulator.tests.SuccessTest)1 AssertTask (com.hazelcast.simulator.utils.AssertTask)1 CommonUtils.joinThread (com.hazelcast.simulator.utils.CommonUtils.joinThread)1 Test (org.junit.Test)1