Search in sources :

Example 1 with WallClock

use of io.s4.util.clock.WallClock in project core by s4.

the class TestPersisterWallClock method main.

public static void main(String[] args) {
    TestPersisterWallClock testPersisterClock = new TestPersisterWallClock();
    s4Clock = new WallClock();
    persister = new HashMapPersister(s4Clock);
    testPersisterClock.testPersister(persister);
    persister = new ConMapPersister(s4Clock);
    testPersisterClock.testPersister(persister);
}
Also used : ConMapPersister(io.s4.persist.ConMapPersister) WallClock(io.s4.util.clock.WallClock) HashMapPersister(io.s4.persist.HashMapPersister)

Example 2 with WallClock

use of io.s4.util.clock.WallClock in project core by s4.

the class TestPrototypeWrapper method testCloneAndInitialize.

/**
    * Verifies ability to set an initialize method that will be called when 
    * a new PE is instantiated
    */
@Test
public void testCloneAndInitialize() {
    MockPE prototype = new MockPE();
    prototype.setInitMethod("testInitialize");
    PrototypeWrapper prototypeWrapper = new PrototypeWrapper(prototype, new WallClock());
    assertEquals(0, prototype.getInitializeCount());
    MockPE instance = (MockPE) prototypeWrapper.getPE("asd");
    assertNotNull(instance);
    assertEquals(0, prototype.getInitializeCount());
    assertEquals(1, instance.getInitializeCount());
}
Also used : WallClock(io.s4.util.clock.WallClock) Test(org.junit.Test)

Aggregations

WallClock (io.s4.util.clock.WallClock)2 ConMapPersister (io.s4.persist.ConMapPersister)1 HashMapPersister (io.s4.persist.HashMapPersister)1 Test (org.junit.Test)1