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.ebasic.SimpleHome; 35 36 37 41 public class F_BasicHomeSharedEB extends A_BasicHomeInterface { 42 43 private static String BEAN_HOME = "ebasicSharedEBHome"; 44 45 public F_BasicHomeSharedEB(String name) { 46 super(name); 47 } 48 49 public SimpleHome getHome() { 50 if (home == null) { 51 try { 52 home = (SimpleHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), SimpleHome.class); 53 } catch (NamingException e) { 54 fail("Cannot get bean home"); 55 } 56 } 57 return home; 58 } 59 60 63 public static Test suite() { 64 return new TestSuite(F_BasicHomeSharedEB.class); 65 } 66 67 68 public static void main (String args[]) throws Exception { 69 String testtorun = null; 70 for (int argn = 0; argn < args.length; argn++) { 72 String s_arg = args[argn]; 73 Integer i_arg; 74 if (s_arg.equals("-n")) { 75 testtorun = args[++argn]; 76 } 77 } 78 if (testtorun == null) { 79 junit.textui.TestRunner.run(suite()); 80 } else { 81 82 junit.textui.TestRunner.run(new F_BasicHomeSharedEB(testtorun)); 83 84 } 85 } 86 } 87 | Popular Tags |