1 22 package org.jboss.ejb3.test.reference21_30.unit; 23 24 import javax.naming.*; 25 26 import org.jboss.ejb3.test.reference21_30.*; 27 import org.jboss.logging.Logger; 28 29 import javax.ejb.EJBException ; 30 31 import junit.framework.Test; 32 33 import org.jboss.security.SecurityAssociation; 34 import org.jboss.security.SimplePrincipal; 35 import org.jboss.test.JBossTestCase; 36 37 43 public class GlobalReferenceTestCase 44 extends JBossTestCase { 45 46 private static final Logger log = Logger 47 .getLogger(GlobalReferenceTestCase.class); 48 49 public GlobalReferenceTestCase(String name) 50 { 51 super(name); 52 } 53 54 public void testSession21() throws Exception 55 { 56 InitialContext jndiContext = new InitialContext(); 57 58 Session21Home home = (Session21Home) jndiContext.lookup("Session21"); 59 Session21 session = (Session21)home.create(); 60 String access = session.access(); 61 assertEquals("Session21", access); 62 access = session.globalAccess30(); 63 assertEquals("Session30", access); 64 } 65 66 public void testSession30() throws Exception 67 { 68 InitialContext jndiContext = new InitialContext(); 69 70 Session30 session = (Session30) jndiContext.lookup("GlobalSession30"); 71 String access = session.access(); 72 assertEquals("Session30", access); 73 access = session.globalAccess21(); 74 assertEquals("Session21", access); 75 } 76 77 protected void setUp() throws Exception 78 { 79 } 80 81 public static Test suite() throws Exception 82 { 83 return getDeploySetup(GlobalReferenceTestCase.class, "globalReference-ejb3.jar,globalReference.jar"); 85 } 86 87 } 88 | Popular Tags |