KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > clients > local > F_ClientViewSF


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: F_ClientViewSF.java,v 1.4 2004/03/19 11:57:18 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jtests.clients.local;
27
28 import junit.framework.Test;
29 import junit.framework.TestSuite;
30
31 import org.objectweb.jonas.jtests.beans.local.TargetSFLocalHome;
32 import org.objectweb.jonas.jtests.beans.local.TargetSLLocalHome;
33 import org.objectweb.jonas.jtests.beans.remoterunner.RSuite;
34 import org.objectweb.jonas.jtests.beans.remoterunner.RemoteRunner;
35
36
37 /**
38  * testcases specifics for stateful session beans must be here
39  *
40  * - isIdentical, create<Method>
41  */

42
43 public class F_ClientViewSF extends F_ClientViewSL {
44
45   
46     protected static String JavaDoc REMOTE_RUNNER_HOME = "EntrySLHome";
47     protected static String JavaDoc BEAN_LOCALHOME = "localTargetSFHome_L";
48     protected static TargetSFLocalHome lhome = null;
49
50     public F_ClientViewSF(String JavaDoc name) {
51     super(name);
52     }
53
54     /**
55      * init environment:
56      * - load beans
57      *
58      */

59     protected void setUp() {
60     super.setUp();
61
62     }
63
64     public TargetSLLocalHome getLocalHome() throws Exception JavaDoc {
65         if (lhome == null) {
66         useBeans("local", false);
67             lhome = (TargetSFLocalHome)ictx.lookup(BEAN_LOCALHOME);
68     }
69         assertTrue(lhome != null);
70         return lhome;
71     }
72
73     public static Test suite() {
74     return new TestSuite(F_ClientViewSF.class);
75     }
76
77     public static void main (String JavaDoc args[]) {
78         RSuite rs = new RSuite("unused");
79         rs.setRunnerHomeName(REMOTE_RUNNER_HOME);
80         rs.useBeans("local", false);
81         String JavaDoc rtesttorun = null;
82         // Get args
83
for (int argn = 0; argn < args.length; argn++) {
84         String JavaDoc s_arg = args[argn];
85         Integer JavaDoc i_arg;
86             if (s_arg.equals("-n")) {
87         rtesttorun = args[++argn];
88         }
89     }
90
91         try {
92             RemoteRunner tr = rs.getRemoteRunner();
93             String JavaDoc Result = null;
94             if (rtesttorun == null) {
95                 Result = tr.run(F_ClientViewSF.class);
96             } else {
97                 Result = tr.run(F_ClientViewSF.class, rtesttorun);
98             }
99             System.out.println(Result);
100             
101         } catch(Exception JavaDoc e) {
102             e.printStackTrace();
103             System.exit(2);
104         }
105
106             
107     }
108 }
109
Popular Tags