1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.security; 26 27 import static org.testng.Assert.fail; 28 29 import javax.annotation.security.RunAs; 30 import javax.ejb.EJB ; 31 import javax.ejb.EJBAccessException ; 32 import javax.ejb.Remote ; 33 import javax.ejb.Stateless ; 34 35 import org.objectweb.easybeans.log.JLog; 36 import org.objectweb.easybeans.log.JLogFactory; 37 38 43 @RunAs("mainrole") 44 @Stateless 45 @Remote 46 public class SLSBSecurityInheritanceTester00 implements ItfSecurityInheritanceTester { 47 48 51 private static JLog logger = JLogFactory.getLog(SLSBSecurityInheritanceTester00.class); 52 53 56 @EJB 57 private ItfSecurityInheritance bean; 58 59 63 public void callMethodDenyAll() { 64 try { 65 bean.dummyMethod1(); 66 fail("The method has a denyAll annotation, so the bean cannot call this method."); 67 } catch (EJBAccessException e) { 68 logger.debug("The bean threw an expected exception {0}", e); 69 } 70 } 71 72 76 public void callMethodMainRole() { 77 bean.dummyMethod2(); 78 } 79 80 83 public void callMethodPermitAll() { 84 bean.dummyMethod3(); 85 } 86 } 87 | Popular Tags |