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.SimpleSHome; 36 37 40 public class F_TimerSL extends A_TimerSession { 41 42 private static String BEAN_HOME = "transactedSimpleSLHome"; 43 protected static SimpleSHome home = null; 44 45 49 public F_TimerSL(String name) { 50 super(name); 51 } 52 53 56 public Simple getSimple(int i) throws Exception { 57 return home.create(); 58 } 59 60 65 protected void setUp() { 66 super.setUp(); 67 if (home == null) { 68 try { 69 home = (SimpleSHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), SimpleSHome.class); 70 } catch (NamingException e) { 71 fail("Cannot get Home:" + e); 72 } 73 } 74 } 75 76 79 public static Test suite() { 80 return new TestSuite(F_TimerSL.class); 81 } 82 83 public static void main (String args[]) { 84 String testtorun = null; 85 for (int argn = 0; argn < args.length; argn++) { 87 String sarg = args[argn]; 88 if (sarg.equals("-n")) { 89 testtorun = args[++argn]; 90 } 91 } 92 if (testtorun == null) { 93 junit.textui.TestRunner.run(suite()); 94 } else { 95 junit.textui.TestRunner.run(new F_TimerSL(testtorun)); 96 } 97 } 98 } 99 | Popular Tags |