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_ClientViewNoTxSL.java 8076 2006-03-01 09:23:33Z durieuxp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.clients.session;
027:
028: import javax.rmi.PortableRemoteObject;
029:
030: import junit.framework.Test;
031: import junit.framework.TestSuite;
032:
033: import org.objectweb.jonas.jtests.beans.local.Target;
034: import org.objectweb.jonas.jtests.beans.local.TargetSLHome;
035:
036: /**
037: * testcases specifics for stateless session beans must be here
038: */
039: public class F_ClientViewNoTxSL extends A_ClientView {
040:
041: protected static String BEAN_HOME = "EJB/localSimpleSessionSLHome";
042: protected static TargetSLHome home = null;
043:
044: public F_ClientViewNoTxSL(String name) {
045: super (name);
046: }
047:
048: /**
049: * test EJBObject.isIdentical on two beans
050: * @see Spec EJB2.0 6.9.2
051: */
052: public void testIsIdenticalOnBeans() throws Exception {
053: Target tr1 = getHome().create();
054: Target tr2 = getHome().create();
055: assertTrue(tr1.isIdentical(tr2));
056: tr1.remove();
057: tr2.remove();
058: }
059:
060: /**
061: * init environment:
062: * - load beans
063: */
064: protected void setUp() {
065: super .setUp();
066: useBeans("local", false);
067: }
068:
069: public TargetSLHome getHome() throws Exception {
070: if (home == null) {
071: home = (TargetSLHome) PortableRemoteObject.narrow(ictx
072: .lookup(BEAN_HOME), TargetSLHome.class);
073: }
074: assertTrue(home != null);
075: return home;
076: }
077:
078: public static Test suite() {
079: return new TestSuite(F_ClientViewNoTxSL.class);
080: }
081:
082: public static void main(String args[]) throws Exception {
083: String testtorun = null;
084: // Get args
085: for (int argn = 0; argn < args.length; argn++) {
086: String s_arg = args[argn];
087: Integer i_arg;
088: if (s_arg.equals("-n")) {
089: testtorun = args[++argn];
090: }
091: }
092: if (testtorun == null) {
093: junit.textui.TestRunner.run(suite());
094: } else {
095:
096: junit.textui.TestRunner.run(new F_ClientViewNoTxSL(
097: testtorun));
098:
099: }
100: }
101: }
|