// No context should be open
assertNull(test1LF.getContext(true));
// Opens a session with the provided Chromattic
ChromatticSession session = chromattic.openSession();
// Now we should have a context
SessionContext context = test1LF.getContext(true);
assertNotNull(context);
// Register synchronzation with event queue
context.addSynchronizationListener(queue);
// Check how chromattic see the session
FooEntity foo = session.create(FooEntity.class);
assertEquals("portal-test", foo.getWorkspace());
// Check related JCR session
jcrSession = session.getJCRSession();
assertTrue(jcrSession.isLive());
Workspace workspace = jcrSession.getWorkspace();
assertEquals("portal-test", workspace.getName());
// Closing chromattic session should not close the underlying JCR session
session.close();
assertTrue(jcrSession.isLive());
// Queue should be empty up to here
queue.assertEmpty();
}