Search in sources :

Example 1 with BusySpinningMetronome

use of com.hazelcast.simulator.worker.metronome.BusySpinningMetronome in project hazelcast-simulator by hazelcast.

the class MetronomeConstructorTest method withCustomMetronome.

@Test
public void withCustomMetronome() {
    PropertyBinding propertyBinding = new PropertyBinding(new TestCase("foo").setProperty("interval", "10ns").setProperty("metronomeClass", BusySpinningMetronome.class));
    MetronomeConstructor metronomeConstructor = new MetronomeConstructor("", propertyBinding, 1);
    Metronome m = metronomeConstructor.newInstance();
    assertEquals(BusySpinningMetronome.class, m.getClass());
    BusySpinningMetronome metronome = (BusySpinningMetronome) m;
    assertEquals(10, metronome.getIntervalNanos());
}
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) BusySpinningMetronome(com.hazelcast.simulator.worker.metronome.BusySpinningMetronome) Test(org.junit.Test)

Aggregations

TestCase (com.hazelcast.simulator.common.TestCase)1 BusySpinningMetronome (com.hazelcast.simulator.worker.metronome.BusySpinningMetronome)1 EmptyMetronome (com.hazelcast.simulator.worker.metronome.EmptyMetronome)1 Metronome (com.hazelcast.simulator.worker.metronome.Metronome)1 SleepingMetronome (com.hazelcast.simulator.worker.metronome.SleepingMetronome)1 Test (org.junit.Test)1