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_EtypeObooleanEC2.java 8669 2006-06-21 14:33:51Z durieuxp $
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.oboolean.ObooleanHome;
035:
036: /**
037: * This is a test suite about java.lang.Boolean field of entity bean CMP version 2.
038: * Beans used: etype/oboolean
039: * @author Helene Joanin
040: */
041: public class F_EtypeObooleanEC2 extends A_EtypeOboolean {
042:
043: private static String BEAN_HOME = "EtypeObooleanEC2Home";
044: protected static ObooleanHome home = null;
045:
046: public F_EtypeObooleanEC2(String name) {
047: super (name);
048: }
049:
050: protected void setUp() {
051: super .setUp();
052: useBeans("oboolean", false);
053: }
054:
055: public ObooleanHome getHome() {
056: if (home == null) {
057: try {
058: home = (ObooleanHome) PortableRemoteObject.narrow(ictx
059: .lookup(BEAN_HOME), ObooleanHome.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 Boolean(false));
066: home.create("pk2", new Boolean(true));
067: home.create("pk3", new Boolean(false));
068: home.create("pk4", new Boolean(true));
069: home.create("pk5", new Boolean(false));
070: home.create("pktoremove", new Boolean(true));
071: home.create("pknull", (Boolean) null);
072: home.create("pkchangenull", new Boolean(true));
073: } catch (Exception i) {
074: }
075: }
076: return home;
077: }
078:
079: public static Test suite() {
080: return new TestSuite(F_EtypeObooleanEC2.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_EtypeObooleanEC2(
097: testtorun));
098: }
099: }
100: }
|