1 22 package org.jboss.test.naming.ejb; 23 24 import javax.ejb.DuplicateKeyException ; 25 import javax.naming.InitialContext ; 26 27 import org.jboss.test.util.ejb.EJBTestCase; 28 import org.jboss.test.JBossTestCase; 29 import org.jboss.test.naming.interfaces.TestENCHome; 30 import org.jboss.test.naming.interfaces.TestENC; 31 import org.jboss.test.cts.interfaces.CtsCmpLocalHome; 32 import org.jboss.test.cts.interfaces.CtsCmpLocal; 33 import org.jboss.test.cts.keys.AccountPK; 34 import org.jboss.test.cts.ejb.LocalEjbTests; 35 import org.jboss.logging.Logger; 36 import junit.framework.Test; 37 38 50 public class NamingTests extends EJBTestCase 51 { 52 Logger log = Logger.getLogger(NamingTests.class); 53 54 public NamingTests(String methodName) 55 { 56 super(methodName); 57 } 58 59 public String getEJBRunnerJndiName() 60 { 61 String jndiName = "EJBTestRunnerHome"; 62 if( props != null ) 63 jndiName = props.getProperty("ejbRunnerJndiName", "EJBTestRunnerHome"); 64 return jndiName; 65 } 66 67 public void testENCPerf() throws Exception 68 { 69 InitialContext ctx = new InitialContext (); 70 String name = "ENCBean"; 71 if( props != null ) 72 name = props.getProperty("encBeanJndiName", "ENCBean"); 73 TestENCHome home = (TestENCHome) ctx.lookup(name); 74 TestENC bean = home.create(); 75 int iterations = Integer.getInteger("encIterations", 1000).intValue(); 76 long time = bean.stressENC(iterations); 77 log.info("testENCPerf, time="+time); 78 bean.remove(); 79 } 80 } 81 | Popular Tags |