1 25 26 package org.objectweb.jonas.jtests.clients.entity; 27 28 import java.math.BigDecimal ; 29 30 import javax.naming.NamingException ; 31 import javax.rmi.PortableRemoteObject ; 32 33 import junit.framework.Test; 34 import junit.framework.TestSuite; 35 36 import org.objectweb.jonas.jtests.beans.etype.obigd.ObigdecimalHome; 37 38 43 44 public class F_EtypeObigdecimalEC2 extends A_EtypeObigdecimal { 45 46 private static String BEAN_HOME = "EtypeObigdecimalEC2Home"; 47 protected static ObigdecimalHome home = null; 48 49 public F_EtypeObigdecimalEC2(String name) { 50 super(name); 51 } 52 53 protected void setUp() { 54 super.setUp(); 55 } 56 57 public ObigdecimalHome getHome() { 58 if (home == null) { 59 try { 60 home = (ObigdecimalHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), 61 ObigdecimalHome.class); 62 } catch (NamingException e) { 63 fail("Cannot get bean home: "+BEAN_HOME); 64 } 65 try { 67 home.create("pk1", new BigDecimal (1)); 68 home.create("pk2", new BigDecimal (2)); 69 home.create("pk3", new BigDecimal (3)); 70 home.create("pk4", new BigDecimal (4)); 71 home.create("pk5", new BigDecimal (5)); 72 home.create("pk5bis", new BigDecimal (5)); 73 home.create("pktoremove", new BigDecimal (10000)); 74 home.create("pknull", (BigDecimal ) null); 75 home.create("pkchangenull", new BigDecimal (10000)); 76 } catch (Exception i) { 77 } 78 } 79 return home; 80 } 81 82 public static Test suite() { 83 return new TestSuite(F_EtypeObigdecimalEC2.class); 84 } 85 86 public static void main (String args[]) { 87 String testtorun = null; 88 for (int argn = 0; argn < args.length; argn++) { 90 String s_arg = args[argn]; 91 Integer i_arg; 92 if (s_arg.equals("-n")) { 93 testtorun = args[++argn]; 94 } 95 } 96 if (testtorun == null) { 97 junit.textui.TestRunner.run(suite()); 98 } else { 99 junit.textui.TestRunner.run(new F_EtypeObigdecimalEC2(testtorun)); 100 } 101 } 102 } 103 | Popular Tags |