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