new MockCoreModuleWithFileBaseCheckpointingBackend());
TestApp app = injector.getInstance(TestApp.class);
app.init();
app.start();
Event event = new Event();
event.put("command", String.class, "setValue1");
event.put("value", String.class, "message1");
app.testStream.receiveEvent(new EventMessage("", "stream1", app.getSerDeser().serialize(event)));
signalValue1Set.await();
StatefulTestPE pe = (StatefulTestPE) app.getPE("statefulPE1").getInstanceForKey("X");
Assert.assertEquals("message1", pe.getValue1());
Assert.assertEquals("", pe.getValue2());
// 3. generate a checkpoint event
event = new Event();
event.put("command", String.class, "checkpoint");
app.testStream.receiveEvent(new EventMessage("", "stream1", app.getSerDeser().serialize(event)));
Assert.assertTrue(signalCheckpointed.await(10, TimeUnit.SECONDS));
// NOTE: the backend has asynchronous save operations
Thread.sleep(1000);