1 25 26 package org.objectweb.jonas.jtests.clients.exception; 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.beanexc.AccountSHome; 35 36 public class F_CatcherSF extends A_CatcherSession { 37 38 private static String BEAN_HOME = "AccountSFHome"; 41 protected static AccountSHome home = null; 42 43 public F_CatcherSF(String name) { 44 super(name); 45 } 46 47 public AccountSHome getHome() { 48 if (home == null) { 49 try { 50 home = (AccountSHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), AccountSHome.class); 51 } catch (NamingException e) { 52 fail("Cannot get bean home"); 53 } 54 } 55 return home; 56 } 57 58 61 public static Test suite() { 62 return new TestSuite(F_CatcherSF.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_CatcherSF(testtorun)); 79 } 80 } 81 82 } 83 | Popular Tags |