1 25 26 package org.objectweb.jonas.jtests.clients.exception; 27 28 import javax.naming.NamingException ; 29 import javax.rmi.PortableRemoteObject ; 30 import junit.framework.Test; 31 import junit.framework.TestSuite; 32 import org.objectweb.jonas.jtests.beans.beanexc.AccountEHome; 33 34 public class F_CatcherEB extends A_CatcherEntity { 35 36 private static String BEAN_HOME = "beanexcAccountEBHome"; 37 protected static AccountEHome home = null; 38 39 public F_CatcherEB(String name) { 40 super(name); 41 } 42 43 public AccountEHome getHome() { 44 if (home == null) { 45 try { 46 home = (AccountEHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), AccountEHome.class); 47 } catch (NamingException e) { 48 fail("Cannot get bean home"); 49 } 50 } 51 return home; 52 } 53 54 57 public static Test suite() { 58 return new TestSuite(F_CatcherEB.class); 59 } 60 61 public static void main (String args[]) { 62 String testtorun = null; 63 for (int argn = 0; argn < args.length; argn++) { 65 String s_arg = args[argn]; 66 Integer i_arg; 67 if (s_arg.equals("-n")) { 68 testtorun = args[++argn]; 69 } 70 } 71 if (testtorun == null) { 72 junit.textui.TestRunner.run(suite()); 73 } else { 74 junit.textui.TestRunner.run(new F_CatcherEB(testtorun)); 75 } 76 } 77 } 78 | Popular Tags |