InitialContext ctx = new InitialContext(env);
Object obj = ctx.lookup("caller-info.SubjectSessionFacade");
obj = PortableRemoteObject.narrow(obj, SubjectSessionHome.class);
SubjectSessionHome home = (SubjectSessionHome) obj;
log.debug("Found CustomPrincipalHome");
SubjectSession bean = home.create();
log.debug("Created CustomPrincipal");
HashSet principals = new HashSet();
principals.add(new SimplePrincipal("CallerInfoFacadeRole"));
principals.add(new SimplePrincipal("CallerInfoStatelessRole"));
principals.add(new SimplePrincipal("CallerInfoStatefulRole"));
principals.add(new SimplePrincipal("CallerInfoEntityRole"));
bean.validateCallerContext("callerJduke", principals);
bean.remove();
}