use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class TestContainer_TimeStep_ProbeInjectionTest method testMeasureLatency.
@Test
public void testMeasureLatency() throws Exception {
TestClass testInstance = new TestClass();
TestCase testCase = new TestCase("exceptionTest").setProperty("threadCount", 1).setProperty("measureLatency", true).setProperty("class", testInstance.getClass());
TestContextImpl testContext = new TestContextImpl(testCase.getId(), "localhost", mock(Server.class));
final TestContainer container = new TestContainer(testContext, testInstance, testCase);
container.invoke(SETUP);
Future f = spawn(new Callable() {
@Override
public Object call() throws Exception {
container.invoke(RUN);
return null;
}
});
assertCompletesEventually(f);
assertInstanceOf(HdrProbe.class, testInstance.probe);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class TestContainer_TimeStep_ProbeInjectionTest method testNoMeasureLatency.
@Test
public void testNoMeasureLatency() throws Exception {
TestClass testInstance = new TestClass();
TestCase testCase = new TestCase("exceptionTest").setProperty("threadCount", 1).setProperty("measureLatency", false).setProperty("class", testInstance.getClass());
TestContextImpl testContext = new TestContextImpl(testCase.getId(), "localhost", mock(Server.class));
final TestContainer container = new TestContainer(testContext, testInstance, testCase);
container.invoke(SETUP);
Future f = spawn(new Callable() {
@Override
public Object call() throws Exception {
container.invoke(RUN);
return null;
}
});
assertCompletesEventually(f);
assertInstanceOf(EmptyProbe.class, testInstance.probe);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class TestContainer_TimeStep_UnusedProbabilityTest method test.
@Test(expected = IllegalTestException.class)
public void test() throws Exception {
UnusedProbabilityTest testInstance = new UnusedProbabilityTest();
TestCase testCase = new TestCase("stopRun").setProperty("threadCount", 1).setProperty("iterations", 100).setProperty("unusedProb", "0.2").setProperty("class", testInstance.getClass());
TestContextImpl testContext = new TestContextImpl(testCase.getId(), "localhost", mock(Server.class));
TestContainer container = new TestContainer(testContext, testInstance, testCase);
container.invoke(SETUP);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class TimeStepModel_IllegalTest method test_threadState_illegalArgumentTypeInConstructor.
@Test(expected = IllegalTestException.class)
public void test_threadState_illegalArgumentTypeInConstructor() {
TestCase testCase = new TestCase("id");
PropertyBinding binding = new PropertyBinding(testCase);
new TimeStepModel(TestWithContextWithIllegalArgumentTypeInConstructor.class, binding);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class TimeStepModel_IllegalTest method test_threadState_notPublicClass.
@Test(expected = IllegalTestException.class)
public void test_threadState_notPublicClass() {
TestCase testCase = new TestCase("id");
PropertyBinding binding = new PropertyBinding(testCase);
new TimeStepModel(TestWithPrivateThreadState.class, binding);
}
Aggregations