use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class CoordinatorRunMonolithTest method failing.
@Test
public void failing() throws Exception {
TestSuite suite = new TestSuite().setDurationSeconds(5).addTest(new TestCase("foo").setProperty("threadCount", 1).setProperty("class", FailingTest.class));
DeploymentPlan deploymentPlan = new DeploymentPlan(hazelcastDriver, registry.getAgents()).addToPlan(1, "member");
run.init(deploymentPlan);
boolean success = run.run(suite);
assertFalse(success);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class CoordinatorRunMonolithTest method success.
@Test
public void success() throws Exception {
TestSuite suite = new TestSuite().setDurationSeconds(5).addTest(new TestCase("foo").setProperty("threadCount", 1).setProperty("class", SuccessTest.class));
DeploymentPlan deploymentPlan = new DeploymentPlan(hazelcastDriver, registry.getAgents()).addToPlan(1, "member");
run.init(deploymentPlan);
boolean success = run.run(suite);
assertTrue(success);
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class RegistryTest method testGetTests.
// @Test
// public void testRemoveTests() {
// TestSuite testSuite1 = new TestSuite()
// .addTest(new TestCase("Test1a"))
// .addTest(new TestCase("Test1b"));
// registry.addTests(testSuite1);
//
// TestSuite testSuite2 = new TestSuite()
// .addTest(new TestCase("Test2a"))
// .addTest(new TestCase("Test2b"));
// registry.addTests(testSuite2);
//
// registry.removeTests(testSuite1);
//
// assertEquals(2, registry.testCount());
// for (TestData testData : registry.getTests()) {
// assertSame(testSuite2, testData.getTestSuite());
// }
// }
@Test
public void testGetTests() {
TestSuite testSuite = new TestSuite();
testSuite.addTest(new TestCase("Test1"));
testSuite.addTest(new TestCase("Test2"));
testSuite.addTest(new TestCase("Test3"));
registry.addTests(testSuite);
Collection<TestData> tests = registry.getTests();
assertEquals(3, tests.size());
for (TestData testData : tests) {
assertTrue(testData.getTestCase().getId().startsWith("Test"));
}
}
use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.
the class RegistryTest method testGetTest.
@Test
public void testGetTest() {
TestSuite testSuite = new TestSuite();
testSuite.addTest(new TestCase("Test1"));
testSuite.addTest(new TestCase("Test2"));
testSuite.addTest(new TestCase("Test3"));
registry.addTests(testSuite);
TestData testData = registry.getTest("Test2");
assertEquals(2, testData.getTestIndex());
assertEquals("Test2", testData.getTestCase().getId());
}
Aggregations