001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: F_EtypeOdoubleEC2.java 4406 2004-03-19 11:57:20Z benoitf $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.clients.entity;
027:
028: import javax.naming.NamingException;
029: import javax.rmi.PortableRemoteObject;
030:
031: import junit.framework.Test;
032: import junit.framework.TestSuite;
033:
034: import org.objectweb.jonas.jtests.beans.etype.odouble.OdoubleHome;
035:
036: /**
037: * This is a test suite about java.lang.Double field of entity bean CMP version 2.
038: * Beans used: etype/odouble
039: * @author Helene Joanin
040: */
041:
042: public class F_EtypeOdoubleEC2 extends A_EtypeOdouble {
043:
044: private static String BEAN_HOME = "EtypeOdoubleEC2Home";
045: protected static OdoubleHome home = null;
046:
047: public F_EtypeOdoubleEC2(String name) {
048: super (name);
049: }
050:
051: protected void setUp() {
052: super .setUp();
053: }
054:
055: public OdoubleHome getHome() {
056: if (home == null) {
057: try {
058: home = (OdoubleHome) PortableRemoteObject.narrow(ictx
059: .lookup(BEAN_HOME), OdoubleHome.class);
060: } catch (NamingException e) {
061: fail("Cannot get bean home: " + BEAN_HOME);
062: }
063: // init here tables if CMP2
064: try {
065: home.create("pk1", new Double(1.0));
066: home.create("pk2", new Double(2.0));
067: home.create("pk3", new Double(3.0));
068: home.create("pk4", new Double(4.0));
069: home.create("pk5", new Double(5.0));
070: home.create("pk5bis", new Double(5.0));
071: home.create("pktoremove", new Double(10000.0));
072: home.create("pknull", (Double) null);
073: home.create("pkchangenull", new Double(1.0));
074: } catch (Exception i) {
075: }
076: }
077: return home;
078: }
079:
080: public static Test suite() {
081: return new TestSuite(F_EtypeOdoubleEC2.class);
082: }
083:
084: public static void main(String args[]) {
085: String testtorun = null;
086: // Get args
087: for (int argn = 0; argn < args.length; argn++) {
088: String s_arg = args[argn];
089: Integer i_arg;
090: if (s_arg.equals("-n")) {
091: testtorun = args[++argn];
092: }
093: }
094: if (testtorun == null) {
095: junit.textui.TestRunner.run(suite());
096: } else {
097: junit.textui.TestRunner
098: .run(new F_EtypeOdoubleEC2(testtorun));
099: }
100: }
101: }
|