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_ClientViewSF.java 7540 2005-10-20 13:15:22Z durieuxp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.clients.local;
027:
028: import junit.framework.Test;
029: import junit.framework.TestSuite;
030:
031: import org.objectweb.jonas.jtests.beans.local.TargetSFLocalHome;
032: import org.objectweb.jonas.jtests.beans.local.TargetSLLocalHome;
033: import org.objectweb.jonas.jtests.beans.remoterunner.RSuite;
034: import org.objectweb.jonas.jtests.beans.remoterunner.RemoteRunner;
035:
036: /**
037: * testcases specifics for stateful session beans must be here
038: *
039: * - isIdentical, create<Method>
040: */
041:
042: public class F_ClientViewSF extends F_ClientViewSL {
043:
044: protected static String REMOTE_RUNNER_HOME = "EntrySLHome";
045: protected static String BEAN_LOCALHOME = "localTargetSFHome_L";
046: protected static TargetSFLocalHome lhome = null;
047:
048: public F_ClientViewSF(String name) {
049: super (name);
050: }
051:
052: /**
053: * init environment:
054: * - load beans
055: *
056: */
057: protected void setUp() {
058: super .setUp();
059: }
060:
061: public TargetSLLocalHome getLocalHome() throws Exception {
062: if (lhome == null) {
063: useBeans("local", false);
064: lhome = (TargetSFLocalHome) ictx.lookup(BEAN_LOCALHOME);
065: }
066: assertTrue(lhome != null);
067: return lhome;
068: }
069:
070: public static Test suite() {
071: return new TestSuite(F_ClientViewSF.class);
072: }
073:
074: public static void main(String args[]) {
075: RSuite rs = new RSuite("unused");
076: rs.setRunnerHomeName(REMOTE_RUNNER_HOME);
077: rs.useBeans("local", false);
078: String rtesttorun = null;
079: // Get args
080: for (int argn = 0; argn < args.length; argn++) {
081: String s_arg = args[argn];
082: Integer i_arg;
083: if (s_arg.equals("-n")) {
084: rtesttorun = args[++argn];
085: }
086: }
087:
088: try {
089: RemoteRunner tr = rs.getRemoteRunner();
090: String Result = null;
091: if (rtesttorun == null) {
092: Result = tr.run(F_ClientViewSF.class);
093: } else {
094: Result = tr.run(F_ClientViewSF.class, rtesttorun);
095: }
096: System.out.println(Result);
097:
098: } catch (Exception e) {
099: e.printStackTrace();
100: System.exit(2);
101: }
102:
103: }
104: }
|