1 25 26 package org.objectweb.jonas.jtests.clients.entity; 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.ebasic.SimpleHome; 33 34 40 public class F_IsolationEC2 extends A_Isolation { 41 42 private static String BEAN_HOME = "ebasicSimpleEC2Home"; 43 protected static SimpleHome home = null; 44 45 public F_IsolationEC2(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 try { 58 home.create("pk1", 10, 4); 59 home.create("pk2", 10, 4); 60 home.create("pk3", 10, 4); 61 home.create("pk4", 40, 8); 62 home.create("pk5", 50, 8); 63 home.create("pk6", 60, 8); 64 home.create("pk7", 70, 8); 65 home.create("pk8", 45, 20); 66 home.create("pk9", 55, 30); 67 home.create("pk10",80, 80); 68 home.create("pk11",80, 80); 69 home.create("pk12",90, 90); 70 home.create("pk13",100, 90); 71 home.create("pk14",110, 90); 72 } catch (Exception i) { 73 } 74 } 75 return home; 76 } 77 78 83 protected void setUp() { 84 super.setUp(); 85 } 86 87 90 public static Test suite() { 91 return new TestSuite(F_IsolationEC2.class); 92 } 93 94 public static void main (String args[]) { 95 String testtorun = null; 96 for (int argn = 0; argn < args.length; argn++) { 98 String s_arg = args[argn]; 99 Integer i_arg; 100 if (s_arg.equals("-n")) { 101 testtorun = args[++argn]; 102 } 103 } 104 if (testtorun == null) { 105 junit.textui.TestRunner.run(suite()); 106 } else { 107 junit.textui.TestRunner.run(new F_IsolationEC2(testtorun)); 108 } 109 } 110 } 111 | Popular Tags |