1 22 package org.jboss.ejb3.test.stateless14.unit; 23 24 import javax.naming.InitialContext ; 25 26 import org.jboss.logging.Logger; 27 import org.jboss.test.JBossTestCase; 28 import org.jboss.ejb3.test.stateless14.Calculator; 29 30 import junit.framework.Test; 31 import junit.framework.TestSuite; 32 33 37 public class StatelessTestCase extends JBossTestCase 38 { 39 private static final Logger log = Logger.getLogger(StatelessTestCase.class); 40 41 public StatelessTestCase(String name) 42 { 43 super(name); 44 } 45 46 public void testCallerPrincipal() throws Exception 47 { 48 InitialContext ctx = new InitialContext (); 49 Calculator calculator = (Calculator) ctx.lookup("CalculatorBean/remote"); 50 assertNotNull(calculator); 51 52 log.info("1 + 1 = " + calculator.add(1, 1)); 53 log.info("1 - 1 = " + calculator.subtract(1, 1)); 54 } 55 56 public static Test suite() throws Exception 57 { 58 return new TestSuite(StatelessTestCase.class); 59 } 61 } | Popular Tags |