{
// ----- setup
HttpSession session = new MockHttpSession();
// put bag manually to session
FailOverBag failOverBag = new FailOverBag(session.getId(), "");
session.setAttribute(FailOverBag.SESSION_ATTRIBUTE_NAME, failOverBag);
DefaultOwbFailOverService failoverService =
(DefaultOwbFailOverService) getWebBeansContext().getService(FailOverService.class);
failoverService.enableFailOverSupport(true);
failoverService.enablePassivationSupport(true);
// ----- execute
failoverService.sessionIsInUse(session);
// ----- assert
FailOverSessionActivationListener listener = (FailOverSessionActivationListener)
session.getAttribute(FailOverSessionActivationListener.SESSION_ATTRIBUTE_NAME);
Assert.assertNotNull(listener);
Assert.assertTrue(failOverBag.isSessionInUse());
Assert.assertFalse(failoverService.isPassivation());
}