1 25 26 package org.objectweb.jonas.jtests.clients.entity; 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.annuaire.PersonneHome; 35 36 41 public class F_TimerEC extends A_Timer { 42 43 private static String BEAN_HOME = "annuairePersonneECHome"; 44 private static PersonneHome ehome = null; 45 46 public F_TimerEC(String name) { 47 super(name); 48 } 49 50 public PersonneHome getHome() { 51 if (ehome == null) { 52 try { 53 ehome = (PersonneHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), PersonneHome.class); 54 } catch (NamingException e) { 55 fail("Cannot get bean home"); 56 } 57 } 58 return ehome; 59 } 60 61 public static Test suite() { 62 return new TestSuite(F_TimerEC.class); 63 } 64 65 public static void main (String args[]) { 66 String testtorun = null; 67 for (int argn = 0; argn < args.length; argn++) { 69 String s_arg = args[argn]; 70 Integer i_arg; 71 if (s_arg.equals("-n")) { 72 testtorun = args[++argn]; 73 } 74 } 75 if (testtorun == null) { 76 junit.textui.TestRunner.run(suite()); 77 } else { 78 junit.textui.TestRunner.run(new F_TimerEC(testtorun)); 79 } 80 } 81 } 82 | Popular Tags |