new MockCoreModuleWithFileBaseCheckpointingBackend(), new AppModule(getClass().getClassLoader()));
TestApp app = injector.getInstance(TestApp.class);
app.init();
app.start();
Event event = new Event();
event.setStreamId("stream1");
event.put("command", String.class, "setValue1");
event.put("value", String.class, "message1");
app.testStream.receiveEvent(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.setStreamId("stream1");
event.put("command", String.class, "checkpoint");
app.testStream.receiveEvent(event);
Assert.assertTrue(signalCheckpointed.await(10, TimeUnit.SECONDS));
// NOTE: the backend has asynchronous save operations
Thread.sleep(1000);