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_EtypeOintegerEC2.java 3185 2003-09-05 13:03:29Z joaninh $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.clients.entity;
027:
028: import javax.naming.NamingException;
029: import javax.rmi.PortableRemoteObject;
030: import junit.framework.Test;
031: import junit.framework.TestSuite;
032:
033: import org.objectweb.jonas.jtests.beans.etype.ointeger.OintegerHome;
034:
035: /**
036: * This is a test suite about java.lang.Integer field of entity bean CMP version 2.
037: * Beans used: etype/ointeger
038: * @author Helene Joanin
039: */
040:
041: public class F_EtypeOintegerEC2 extends A_EtypeOinteger {
042:
043: private static String BEAN_HOME = "EtypeOintegerEC2Home";
044: protected static OintegerHome home = null;
045:
046: public F_EtypeOintegerEC2(String name) {
047: super (name);
048: }
049:
050: protected void setUp() {
051: super .setUp();
052: }
053:
054: public OintegerHome getHome() {
055: if (home == null) {
056: try {
057: home = (OintegerHome) PortableRemoteObject.narrow(ictx
058: .lookup(BEAN_HOME), OintegerHome.class);
059: } catch (NamingException e) {
060: fail("Cannot get bean home: " + BEAN_HOME);
061: }
062: // init here tables if CMP2
063: try {
064: home.create("pk1", new Integer("1"));
065: home.create("pk2", new Integer("2"));
066: home.create("pk3", new Integer("3"));
067: home.create("pk4", new Integer("4"));
068: home.create("pk5", new Integer("5"));
069: home.create("pk5bis", new Integer("5"));
070: home.create("pktoremove", new Integer("10000"));
071: home.create("pknull", (Integer) null);
072: home.create("pkchangenull", new Integer("10000"));
073: } catch (Exception i) {
074: }
075: }
076: return home;
077: }
078:
079: public static Test suite() {
080: return new TestSuite(F_EtypeOintegerEC2.class);
081: }
082:
083: public static void main(String args[]) {
084: String testtorun = null;
085: // Get args
086: for (int argn = 0; argn < args.length; argn++) {
087: String s_arg = args[argn];
088: Integer i_arg;
089: if (s_arg.equals("-n")) {
090: testtorun = args[++argn];
091: }
092: }
093: if (testtorun == null) {
094: junit.textui.TestRunner.run(suite());
095: } else {
096: junit.textui.TestRunner.run(new F_EtypeOintegerEC2(
097: testtorun));
098: }
099: }
100: }
|