1 25 26 package org.objectweb.jonas.jtests.clients.timer; 27 28 import javax.naming.NamingException ; 29 import javax.rmi.PortableRemoteObject ; 30 31 import junit.framework.Test; 32 import junit.framework.TestSuite; 33 34 import org.objectweb.jonas.jtests.beans.transacted.Simple; 35 import org.objectweb.jonas.jtests.beans.transacted.SimpleEHome; 36 37 41 public class F_TimerEC extends A_TimerEntity { 42 43 private static String BEAN_HOME = "transactedSimpleECHome"; 44 private static SimpleEHome home = null; 45 46 50 public F_TimerEC(String name) { 51 super(name); 52 } 53 54 57 protected SimpleEHome getHome() { 58 if (home == null) { 59 try { 60 home = (SimpleEHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), SimpleEHome.class); 61 } catch (NamingException e) { 62 fail("Cannot get bean home"); 63 } 64 } 65 return home; 66 } 67 68 71 public Simple getSimple(int i) throws Exception { 72 return getHome().create(i); 73 } 74 75 78 public static Test suite() { 79 return new TestSuite(F_TimerEC.class); 80 } 81 82 public static void main (String args[]) { 83 String testtorun = null; 84 for (int argn = 0; argn < args.length; argn++) { 86 String sarg = args[argn]; 87 if (sarg.equals("-n")) { 88 testtorun = args[++argn]; 89 } 90 } 91 if (testtorun == null) { 92 junit.textui.TestRunner.run(suite()); 93 } else { 94 junit.textui.TestRunner.run(new F_TimerEC(testtorun)); 95 } 96 } 97 } 98 | Popular Tags |