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());
}
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;
}
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());
}
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());
}
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));
}
Aggregations