1 25 26 package org.objectweb.jonas.jtests.clients.distribution; 27 28 import javax.rmi.PortableRemoteObject ; 29 30 import org.objectweb.jonas.jtests.beans.bank.Manager; 31 import org.objectweb.jonas.jtests.beans.bank.ManagerHome; 32 import org.objectweb.jonas.jtests.util.JTestCase; 33 34 import junit.framework.Test; 35 import junit.framework.TestSuite; 36 37 public class F_bankRO extends A_bankRead { 38 39 protected static ManagerHome homecs = null; 40 protected static Manager managercs = null; 41 public static boolean threadfail; 42 43 public F_bankRO(String name) { 44 super(name); 45 } 46 47 public String getManagerHomeName() { 48 return "bankManagerROHome"; 49 } 50 51 public boolean getPrefetch() { 52 return false; 53 } 54 55 protected void setUp() { 56 try { 57 if (home == null) { 58 useBeans("bank", false); 59 home = (ManagerHome) PortableRemoteObject.narrow(ictx.lookup(getManagerHomeName()), ManagerHome.class); 60 } 61 if (manager == null) { 62 manager = home.create(initialValue, getPrefetch()); 63 } 64 } catch (Exception e) { 65 fail("Exception raised in setup: " + e); 66 } 67 try { 68 if (homecs == null) { 70 homecs = (ManagerHome) PortableRemoteObject.narrow(ictx.lookup("bankManagerCSHome"), ManagerHome.class); 71 } 72 if (managercs == null) { 73 managercs = homecs.create(initialValue, false); 74 } 75 managercs.createAll(accountNb); 77 threadfail = false; 78 } catch (Exception e) { 79 fail("Exception raised in setup: " + e); 80 } 81 } 82 83 84 public static Test suite() { 85 return new TestSuite(F_bankRO.class); 86 } 87 88 public static void main (String args[]) { 89 String testtorun = null; 90 for (int argn = 0; argn < args.length; argn++) { 92 String sarg = args[argn]; 93 if (sarg.equals("-n")) { 94 testtorun = args[++argn]; 95 } 96 } 97 if (testtorun == null) { 98 junit.textui.TestRunner.run(suite()); 99 } else { 100 junit.textui.TestRunner.run(new F_bankRO(testtorun)); 101 } 102 } 103 } 104 | Popular Tags |