Search in sources :

Example 36 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class RegistryTest method testAddTests.

@Test
public void testAddTests() {
    TestSuite testSuite = new TestSuite();
    testSuite.addTest(new TestCase("Test1"));
    testSuite.addTest(new TestCase("Test2"));
    testSuite.addTest(new TestCase("Test3"));
    List<TestData> tests = registry.addTests(testSuite);
    assertEquals(3, tests.size());
    assertEquals(3, registry.testCount());
}
Also used : TestSuite(com.hazelcast.simulator.coordinator.TestSuite) TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Example 37 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PerformanceMonitorTest method addTest.

private DelayTestContext addTest(Object test, int delayMillis) {
    TestCase testCase = new TestCase(TEST_NAME);
    testCase.setProperty("threadCount", 1);
    DelayTestContext testContext = new DelayTestContext(delayMillis);
    TestContainer testContainer = new TestContainer(testContext, test, testCase);
    tests.put(TEST_NAME, testContainer);
    return testContext;
}
Also used : TestContainer(com.hazelcast.simulator.worker.testcontainer.TestContainer) TestCase(com.hazelcast.simulator.common.TestCase)

Example 38 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class MetronomeConstructorTest method testThreadCount.

@Test
public void testThreadCount() {
    PropertyBinding propertyBinding = new PropertyBinding(new TestCase("foo").setProperty("interval", "20ns"));
    MetronomeConstructor metronomeConstructor = new MetronomeConstructor("", propertyBinding, 10);
    Metronome m = metronomeConstructor.newInstance();
    assertEquals(SleepingMetronome.class, m.getClass());
    SleepingMetronome metronome = (SleepingMetronome) m;
    assertEquals(200, metronome.getIntervalNanos());
}
Also used : SleepingMetronome(com.hazelcast.simulator.worker.metronome.SleepingMetronome) TestCase(com.hazelcast.simulator.common.TestCase) Metronome(com.hazelcast.simulator.worker.metronome.Metronome) BusySpinningMetronome(com.hazelcast.simulator.worker.metronome.BusySpinningMetronome) EmptyMetronome(com.hazelcast.simulator.worker.metronome.EmptyMetronome) SleepingMetronome(com.hazelcast.simulator.worker.metronome.SleepingMetronome) Test(org.junit.Test)

Example 39 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class MetronomeConstructorTest method whenZeroInterval.

@Test
public void whenZeroInterval() {
    PropertyBinding propertyBinding = new PropertyBinding(new TestCase("foo"));
    MetronomeConstructor metronomeConstructor = new MetronomeConstructor("", propertyBinding, 5);
    Metronome m = metronomeConstructor.newInstance();
    assertEquals(EmptyMetronome.class, m.getClass());
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Metronome(com.hazelcast.simulator.worker.metronome.Metronome) BusySpinningMetronome(com.hazelcast.simulator.worker.metronome.BusySpinningMetronome) EmptyMetronome(com.hazelcast.simulator.worker.metronome.EmptyMetronome) SleepingMetronome(com.hazelcast.simulator.worker.metronome.SleepingMetronome) Test(org.junit.Test)

Example 40 with TestCase

use of com.hazelcast.simulator.common.TestCase in project hazelcast-simulator by hazelcast.

the class PropertyBindingTest method loadAsInt_nonExisting.

@Test
public void loadAsInt_nonExisting() {
    TestCase testCase = new TestCase("foo");
    PropertyBinding binding = new PropertyBinding(testCase);
    assertEquals(10, binding.loadAsInt("intValue", 10));
}
Also used : TestCase(com.hazelcast.simulator.common.TestCase) Test(org.junit.Test)

Aggregations

TestCase (com.hazelcast.simulator.common.TestCase)74 Test (org.junit.Test)61 Server (com.hazelcast.simulator.protocol.Server)18 SuccessTest (com.hazelcast.simulator.tests.SuccessTest)13 Callable (java.util.concurrent.Callable)11 Future (java.util.concurrent.Future)11 FailingTest (com.hazelcast.simulator.tests.FailingTest)10 CreateTestOperation (com.hazelcast.simulator.worker.operations.CreateTestOperation)9 StoppingTest (com.hazelcast.simulator.tests.StoppingTest)8 TestPhase (com.hazelcast.simulator.common.TestPhase)7 StubPromise (com.hazelcast.simulator.protocol.StubPromise)6 StartPhaseOperation (com.hazelcast.simulator.worker.operations.StartPhaseOperation)6 StopException (com.hazelcast.simulator.test.StopException)5 TestSuite (com.hazelcast.simulator.coordinator.TestSuite)4 BusySpinningMetronome (com.hazelcast.simulator.worker.metronome.BusySpinningMetronome)4 EmptyMetronome (com.hazelcast.simulator.worker.metronome.EmptyMetronome)4 Metronome (com.hazelcast.simulator.worker.metronome.Metronome)4 SleepingMetronome (com.hazelcast.simulator.worker.metronome.SleepingMetronome)4 BaseThreadState (com.hazelcast.simulator.test.BaseThreadState)2 HashMap (java.util.HashMap)2