001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.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: TestEjbql.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.entity;
025:
026: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.ejbql.ItfEjbqlTester;
027: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.ejbql.SLSBEjbqlTester;
028: import org.ow2.easybeans.tests.common.helper.EJBHelper;
029: import org.testng.annotations.BeforeMethod;
030: import org.testng.annotations.Test;
031:
032: /**
033: * Verifies if the container manages the most used EJB QL statement. The item 4
034: * (Persistence doc)
035: * @reference JSR 220-FINAL RELEASE
036: * @requirement Application Server must be running; the bean SLSBEjbqlTester and
037: * the entity package Customer must be deployed.
038: * @setup gets the reference of SLSBEjbqlTester
039: * @author Gisele Pinheiro Souza
040: * @author Eduardo Studzinski Estima de Castro
041: */
042: public class TestEjbql {
043:
044: /**
045: * Bean used during the tests.
046: */
047: private ItfEjbqlTester slsbEjbqlTester;
048:
049: /**
050: * Creates the stateless bean used during the tests.
051: * @throws Exception if an error occurs during the lookup.
052: */
053: @BeforeMethod
054: public void setup() throws Exception {
055: slsbEjbqlTester = EJBHelper.getBeanRemoteInstance(
056: SLSBEjbqlTester.class, ItfEjbqlTester.class);
057: }
058:
059: /**
060: * Verifies if the container manages a path expression.
061: * @input -
062: * @output the correct method execution.
063: *
064: */
065: @Test
066: public void testPathExpression() {
067: slsbEjbqlTester.testPathExpression();
068: }
069:
070: /**
071: * Verifies if the container manages an inner join.
072: * @input -
073: * @output the correct method execution.
074: *
075: */
076: @Test
077: public void testInnerJoin() {
078: slsbEjbqlTester.testInnerJoin();
079: }
080:
081: /**
082: * Verifies if the is empty statement work properly.
083: * @input -
084: * @output the correct method execution.
085: *
086: */
087: @Test
088: public void testIsEmpty() {
089: slsbEjbqlTester.testIsEmpty();
090: }
091:
092: /**
093: * Verifies if the container manages a group by and having statements.
094: * @input -
095: * @output the correct method execution.
096: *
097: */
098: @Test
099: 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: }
|