KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > entity > TestCascadeOperation


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@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: TestCascadeOperation.java 977 2006-07-28 13:18:26Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.entity;
26
27 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.cascadeoperation.ItfCascadeTester;
28 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.cascadeoperation.SFSBCascadeTester;
29 import org.objectweb.easybeans.tests.common.helper.EJBHelper;
30 import org.testng.annotations.BeforeMethod;
31 import org.testng.annotations.Test;
32
33 /**
34  * Verifies if the container manages the different cascade types in the relationships mapping.
35  * The items 3.2.1 e 3.2.2 (Persistence doc)
36  * @reference JSR 220-FINAL RELEASE
37  * @requirement Application Server must be running; the bean
38  * SFSBCascadeTester must be deployed.
39  * @setup gets the reference of SFSBCascadeTester
40  * @author Gisele Pinheiro Souza
41  * @author Eduardo Studzinski Estima de Castro
42  */

43 public class TestCascadeOperation {
44
45     /**
46      * Bean used during the tests.
47      */

48     private ItfCascadeTester sfsbCascadeTester;
49
50     /**
51      * Creates the stateful bean used during the tests.
52      * @throws Exception if an error occurs during the lookup.
53      */

54     @BeforeMethod
55     public void setup() throws Exception JavaDoc {
56         sfsbCascadeTester = EJBHelper.getBeanRemoteInstance(SFSBCascadeTester.class,
57                 ItfCascadeTester.class);
58         sfsbCascadeTester.startup();
59     }
60
61     /**
62      * Verifies if the container manages the cascade refresh properly.
63      * @input -
64      * @output the method execution without error.
65      */

66     @Test
67     public void verifyCascadeTypeRefresh(){
68         sfsbCascadeTester.verifyCascadeTypeRefresh();
69     }
70
71
72     /**
73      * Verifies if the container manages the cascade remove properly.
74      * @input -
75      * @output the method execution without error.
76      */

77     @Test
78     public void verifyCascadeTypeRemove(){
79         sfsbCascadeTester.verifyCascadeTypeRemove();
80     }
81
82     /**
83      * Verifies if the container manages the cascade merge properly.
84      * @input -
85      * @output the method execution without error.
86      */

87     @Test
88     public void verifyCascadeTypeMerge(){
89         sfsbCascadeTester.verifyCascadeTypeMerge();
90     }
91
92     /**
93      * Verifies if the container manages the cascade persist properly.
94      * @input -
95      * @output the method execution without error.
96      */

97     @Test
98     public void verifyCascadeTypePersist(){
99         sfsbCascadeTester.verifyCascadeTypePersist();
100     }
101 }
102
Popular Tags