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 33 import org.objectweb.jonas.jtests.beans.etype.ointeger.OintegerHome; 34 35 40 41 public class F_EtypeOintegerEC2 extends A_EtypeOinteger { 42 43 private static String BEAN_HOME = "EtypeOintegerEC2Home"; 44 protected static OintegerHome home = null; 45 46 public F_EtypeOintegerEC2(String name) { 47 super(name); 48 } 49 50 protected void setUp() { 51 super.setUp(); 52 } 53 54 public OintegerHome getHome() { 55 if (home == null) { 56 try { 57 home = (OintegerHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), 58 OintegerHome.class); 59 } catch (NamingException e) { 60 fail("Cannot get bean home: " + BEAN_HOME); 61 } 62 try { 64 home.create("pk1", new Integer ("1")); 65 home.create("pk2", new Integer ("2")); 66 home.create("pk3", new Integer ("3")); 67 home.create("pk4", new Integer ("4")); 68 home.create("pk5", new Integer ("5")); 69 home.create("pk5bis", new Integer ("5")); 70 home.create("pktoremove", new Integer ("10000")); 71 home.create("pknull", (Integer ) null); 72 home.create("pkchangenull", new Integer ("10000")); 73 } catch (Exception i) { 74 } 75 } 76 return home; 77 } 78 79 public static Test suite() { 80 return new TestSuite(F_EtypeOintegerEC2.class); 81 } 82 83 public static void main (String args[]) { 84 String testtorun = null; 85 for (int argn = 0; argn < args.length; argn++) { 87 String s_arg = args[argn]; 88 Integer i_arg; 89 if (s_arg.equals("-n")) { 90 testtorun = args[++argn]; 91 } 92 } 93 if (testtorun == null) { 94 junit.textui.TestRunner.run(suite()); 95 } else { 96 junit.textui.TestRunner.run(new F_EtypeOintegerEC2(testtorun)); 97 } 98 } 99 } 100 | Popular Tags |