use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class TestManagerTest method test_createTest.
@Test
public void test_createTest() {
TestCase testCase = new TestCase("foo").setProperty("class", SuccessTest.class);
CreateTestOperation op = new CreateTestOperation(testCase);
manager.createTest(op);
Collection<TestContainer> containers = manager.getContainers();
assertEquals(1, containers.size());
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class PrimordialRunStrategyIntegrationTest method testWithAllPhases.
@Test
public void testWithAllPhases() throws Exception {
int threadCount = 2;
DummyTest testInstance = new DummyTest();
TestCase testCase = new TestCase("id").setProperty("threadCount", threadCount).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 runFuture = spawn(new Callable() {
@Override
public Object call() throws Exception {
container.invoke(RUN);
return null;
}
});
Thread.sleep(5000);
testContext.stop();
runFuture.get();
container.invoke(TestPhase.LOCAL_TEARDOWN);
assertTrue(testInstance.count.get() > 1000);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class PropertyBindingTest method loadAsClass_existing.
@Test
public void loadAsClass_existing() {
TestCase testCase = new TestCase("foo").setProperty("classValue", String.class);
PropertyBinding binding = new PropertyBinding(testCase);
assertEquals(String.class, binding.loadAsClass("classValue", Long.class));
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class PropertyBindingTest method loadAsDouble_existing_wihUnderscores.
@Test
public void loadAsDouble_existing_wihUnderscores() {
TestCase testCase = new TestCase("foo").setProperty("doubleValue", "5_0d");
PropertyBinding binding = new PropertyBinding(testCase);
assertEquals(50, binding.loadAsDouble("doubleValue", 10), 0.1);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class PropertyBindingTest method loadAsBoolean_existing.
@Test
public void loadAsBoolean_existing() {
TestCase testCase = new TestCase("foo").setProperty("booleanValue", false);
PropertyBinding binding = new PropertyBinding(testCase);
assertEquals(false, binding.loadAsBoolean("booleanValue", true));
}
Aggregations