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_TimerEC2 extends A_Timer { 42 43 private static String BEAN_HOME = "annuairePersonneEC2Home"; 44 private static PersonneHome ehome = null; 45 46 public F_TimerEC2(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 try { 59 ehome.create("Philippe Coq", "1235456"); 60 ehome.create("Philippe Durieux", "638"); 61 ehome.create("Adriana Danes", "1233456"); 62 ehome.create("Helene Joanin", "1230456"); 63 ehome.create("Gerard Vandome", "1232456"); 64 ehome.create("Francois Exertier", "1323456"); 65 ehome.create("Emmanuel Facarde", "1234356"); 66 ehome.create("Charly Mingus", "1238456"); 67 ehome.create("Thelonious Monk", "1239456"); 68 ehome.create("Jean-Luc Richard", "1203456"); 69 } catch (Exception i) { 70 } 72 } 73 return ehome; 74 } 75 76 public static Test suite() { 77 return new TestSuite(F_TimerEC2.class); 78 } 79 80 public static void main (String args[]) { 81 String testtorun = null; 82 for (int argn = 0; argn < args.length; argn++) { 84 String s_arg = args[argn]; 85 Integer i_arg; 86 if (s_arg.equals("-n")) { 87 testtorun = args[++argn]; 88 } 89 } 90 if (testtorun == null) { 91 junit.textui.TestRunner.run(suite()); 92 } else { 93 junit.textui.TestRunner.run(new F_TimerEC2(testtorun)); 94 } 95 } 96 } 97 | Popular Tags |