KickJava   Java API By Example, From Geeks To Geeks.

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


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: TestEjbql.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.stateless.containermanaged.ejbql.ItfEjbqlTester;
28 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.ejbql.SLSBEjbqlTester;
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 most used EJB QL statement. The item 4
35  * (Persistence doc)
36  * @reference JSR 220-FINAL RELEASE
37  * @requirement Application Server must be running; the bean SLSBEjbqlTester and
38  * the entity package Customer must be deployed.
39  * @setup gets the reference of SLSBEjbqlTester
40  * @author Gisele Pinheiro Souza
41  * @author Eduardo Studzinski Estima de Castro
42  */

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

48     private ItfEjbqlTester slsbEjbqlTester;
49
50     /**
51      * Creates the stateless 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         slsbEjbqlTester = EJBHelper.getBeanRemoteInstance(SLSBEjbqlTester.class, ItfEjbqlTester.class);
57     }
58
59     /**
60      * Verifies if the container manages a path expression.
61      * @input -
62      * @output the correct method execution.
63      *
64      */

65     @Test
66     public void testPathExpression() {
67         slsbEjbqlTester.testPathExpression();
68     }
69
70     /**
71      * Verifies if the container manages an inner join.
72      * @input -
73      * @output the correct method execution.
74      *
75      */

76     @Test
77     public void testInnerJoin() {
78         slsbEjbqlTester.testInnerJoin();
79     }
80
81     /**
82      * Verifies if the is empty statement work properly.
83      * @input -
84      * @output the correct method execution.
85      *
86      */

87     @Test
88     public void testIsEmpty() {
89         slsbEjbqlTester.testIsEmpty();
90     }
91
92     /**
93      * Verifies if the container manages a group by and having statements.
94      * @input -
95      * @output the correct method execution.
96      *
97      */

98     @Test
99     public void testGroupByHaving() {
100         slsbEjbqlTester.testHaving();
101     }
102
103     /**
104      * Verifies if the container manages a bulk operation delete.
105      * @input -
106      * @output the correct method execution.
107      *
108      */

109     @Test
110     public void testDelete() {
111         slsbEjbqlTester.testDelete();
112     }
113
114     /**
115      * Verifies if the container manages a bulk operation update.
116      * @input -
117      * @output the correct method execution.
118      *
119      */

120     @Test
121     public void testUpdate() {
122         slsbEjbqlTester.testUpdate();
123     }
124
125 }
126
Popular Tags