Search in sources :

Example 11 with TestSuite

use of com.hazelcast.simulator.coordinator.TestSuite 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"));
    }
}
Also used : TestSuite(com.hazelcast.simulator.coordinator.TestSuite) TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Example 12 with TestSuite

use of com.hazelcast.simulator.coordinator.TestSuite 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());
}
Also used : TestSuite(com.hazelcast.simulator.coordinator.TestSuite) TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Aggregations

TestSuite (com.hazelcast.simulator.coordinator.TestSuite)12 Test (org.junit.Test)11 TestCase (com.hazelcast.simulator.common.TestCase)4 Coordinator (com.hazelcast.simulator.coordinator.Coordinator)1 RcTestRunOperation (com.hazelcast.simulator.coordinator.operations.RcTestRunOperation)1