KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > clients > session > B_ClientView


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:
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jtests.clients.session;
27
28 import java.rmi.NoSuchObjectException JavaDoc;
29
30 import org.objectweb.jonas.jtests.beans.local.Target;
31 import org.objectweb.jonas.jtests.beans.local.TargetSLHome;
32 import org.objectweb.jonas.jtests.util.JTestCase;
33
34 /**
35  * This Class defines perf Test cases that can be run either SF or SL bean.
36  * These tests are related to the "Client View of a Session Bean"
37  * A session bean that supports both Local & Remote interface is used
38  * (TargetSL oe TargetSF in beans/local)
39  * But here are testcases that can be run via a non remote suite.
40  *
41  * @see EJB2.0 specification Chapter 6.
42  * @author Ph Coq, Ph Durieux
43  */

44
45 public abstract class B_ClientView extends JTestCase {
46
47     public B_ClientView(String JavaDoc name) {
48     super(name);
49     }
50
51     /**
52      * @return TargetSLHome, that can be either SF or SL bean.
53      */

54     public abstract TargetSLHome getHome() throws Exception JavaDoc;
55
56
57
58
59     /**
60      * This test verify we can create, access to the bean via
61      * its remote interface and remove it
62      * It verifies we cannot access to the bean after remove
63      */

64     public void testCreateAccessRemoteRemove() throws Exception JavaDoc {
65     Target tr = getHome().create();
66     assertEquals(10, tr.getTen());
67     tr.remove();
68         try {
69             tr.method2("Bye");
70             fail("NoSuchObjectException must be raised");
71             // } catch (NoSuchObjectException e) {
72
} catch (NoSuchObjectException JavaDoc e) {
73         }
74         System.out.println("create, access to the bean via its remote interface and remove it");
75     }
76
77
78
79
80
81 }
82
Popular Tags