use of com.hazelcast.simulator.worker.metronome.SleepingMetronome in project hazelcast-simulator by hazelcast.
the class MetronomeConstructorTest method test.
public void test(long expectedInterval, String actualInterval) {
PropertyBinding propertyBinding = new PropertyBinding(new TestCase("foo").setProperty("interval", actualInterval));
MetronomeConstructor metronomeConstructor = new MetronomeConstructor("", propertyBinding, 1);
Metronome m = metronomeConstructor.newInstance();
assertEquals(SleepingMetronome.class, m.getClass());
SleepingMetronome metronome = (SleepingMetronome) m;
assertEquals(expectedInterval, metronome.getIntervalNanos());
}
use of com.hazelcast.simulator.worker.metronome.SleepingMetronome 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());
}
Aggregations