/** Test getting current user roles */ @Test public void testGetCurrentUserRoles() throws Exception { System.out.println(">>> Loading roles for current user."); UserTransaction tx = getUserTransaction(); try { AdminEJBLocal instance = (AdminEJBLocal) getEJBInstance(AdminEJB.class.getSimpleName()); tx.begin(); List<Role> result = instance.getCurrentUserRoles(); tx.commit(); assertNotNull("List of roles for current user is null.", result); System.out.println(">>> Found " + result.size() + " roles for current user."); } catch (Exception e) { tx.rollback(); fail(e.getMessage()); } }