01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999-2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: F_EtypeOfloat4pkEC2.java 5398 2004-09-09 13:59:14Z joaninh $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas.jtests.clients.entity;
25:
26: import javax.naming.NamingException;
27: import javax.rmi.PortableRemoteObject;
28:
29: import junit.framework.Test;
30: import junit.framework.TestSuite;
31:
32: import org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pkHome;
33:
34: /**
35: * This is a test suite about java.lang.Float field of entity bean CMP version 2.
36: * Beans used: etype/ofloat4pk
37: * @author Helene Joanin
38: */
39:
40: public class F_EtypeOfloat4pkEC2 extends A_EtypeOfloat4pk {
41:
42: private static String BEAN_HOME = "EtypeOfloat4pkEC2Home";
43: protected static Ofloat4pkHome home = null;
44:
45: public F_EtypeOfloat4pkEC2(String name) {
46: super (name);
47: }
48:
49: protected void setUp() {
50: super .setUp();
51: }
52:
53: public Ofloat4pkHome getHome() {
54: if (home == null) {
55: try {
56: home = (Ofloat4pkHome) PortableRemoteObject.narrow(ictx
57: .lookup(BEAN_HOME), Ofloat4pkHome.class);
58: } catch (NamingException e) {
59: fail("Cannot get bean home: " + BEAN_HOME);
60: }
61: // init here tables if CMP2
62: try {
63: home.create(new Float(1.0), new Float(1.0));
64: home.create(new Float(2.0), new Float(2.0));
65: home.create(new Float(3.0), new Float(3.0));
66: home.create(new Float(4.0), new Float(4.0));
67: home.create(new Float(5.0), new Float(5.0));
68: home.create(new Float(-5.0), new Float(5.0));
69: home.create(new Float(10000.0), new Float(10000.0));
70: } catch (Exception i) {
71: }
72: }
73: return home;
74: }
75:
76: public static Test suite() {
77: return new TestSuite(F_EtypeOfloat4pkEC2.class);
78: }
79:
80: public static void main(String args[]) {
81: String testtorun = null;
82: // Get args
83: for (int argn = 0; argn < args.length; argn++) {
84: String s_arg = args[argn];
85: Integer i_arg;
86: if (s_arg.equals("-n")) {
87: testtorun = args[++argn];
88: }
89: }
90: if (testtorun == null) {
91: junit.textui.TestRunner.run(suite());
92: } else {
93: junit.textui.TestRunner.run(new F_EtypeOfloat4pkEC2(
94: testtorun));
95: }
96: }
97: }
|