gdamour 2005/03/02 06:43:18
Modified: modules/itests/src/itest/org/openejb/test/entity/cmp
CmpTestSuite.java
Added: modules/itests/src/itest/org/openejb/test/entity/cmp
CmpTransactionTests.java
Log:
GERONIMO-580
o add an itests test verifying the correct behavior of the implementation.
GERONIMO-598
o add the flush-cache-before-query optional element, which identifies if
the transactional cache should be flushed before the execution of the
associated finder or select operation; and
o update the various XValuedFinder and XValuedSelect in order to flush
the transaction cache if required.
Revision Changes Path
1.3 +4 -1
openejb/modules/itests/src/itest/org/openejb/test/entity/cmp/CmpTestSuite.java
Index: CmpTestSuite.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/itest/org/openejb/test/entity/cmp/CmpTestSuite.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CmpTestSuite.java 14 Oct 2004 07:07:17 -0000 1.2
+++ CmpTestSuite.java 2 Mar 2005 11:43:17 -0000 1.3
@@ -68,6 +68,7 @@
this.addTest(new CmpAllowedOperationsTests());
this.addTest(new CmpJndiEncTests());
this.addTest(new CmpRmiIiopTests());
+ this.addTest(new CmpTransactionTests());
}
@@ -87,6 +88,7 @@
/*[2] Create database table */
TestManager.getDatabase().createEntityTable();
+ TestManager.getDatabase().createEntityExplicitePKTable();
}
/**
@@ -96,5 +98,6 @@
protected void tearDown() throws Exception {
/*[1] Drop database table */
TestManager.getDatabase().dropEntityTable();
+ TestManager.getDatabase().dropEntityExplicitePKTable();
}
}
1.1
openejb/modules/itests/src/itest/org/openejb/test/entity/cmp/CmpTransactionTests.java
Index: CmpTransactionTests.java
===================================================================
/**
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain copyright
* statements and notices. Redistributions must also contain a
* copy of this document.
*
* 2. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. The name "Exolab" must not be used to endorse or promote
* products derived from this Software without prior written
* permission of Exoffice Technologies. For written permission,
* please contact [EMAIL PROTECTED]
*
* 4. Products derived from this Software may not be called "Exolab"
* nor may "Exolab" appear in their names without prior written
* permission of Exoffice Technologies. Exolab is a registered
* trademark of Exoffice Technologies.
*
* 5. Due credit should be given to the Exolab Project
* (http://www.exolab.org/).
*
* THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
*
* $Id: CmpTransactionTests.java,v 1.1 2005/03/02 11:43:17 gdamour Exp $
*/
package org.openejb.test.entity.cmp;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.openejb.test.TestManager;
/**
* @version $Revision: 1.1 $ $Date: 2005/03/02 11:43:17 $
*/
public class CmpTransactionTests extends org.openejb.test.NamedTestCase {
private InitialContext initialContext;
private SessionFacadeHome ejbHome;
private SessionFacadeObject ejbObject;
public CmpTransactionTests() {
super("Transaction.");
}
protected void setUp() throws Exception {
super.setUp();
Properties properties =
TestManager.getServer().getContextEnvironment();
properties.put(Context.SECURITY_PRINCIPAL, "ENTITY_TEST_CLIENT");
properties.put(Context.SECURITY_CREDENTIALS, "ENTITY_TEST_CLIENT");
initialContext = new InitialContext(properties);
Object obj =
initialContext.lookup("client/tests/entity/cmp/SessionFacadeBean");
ejbHome = (SessionFacadeHome)
javax.rmi.PortableRemoteObject.narrow(obj, SessionFacadeHome.class);
ejbObject = ejbHome.create();
}
//===============================
// Test ejb home methods
//
public void testInvokeCreateRemoveCreateSameCMP() {
try {
ejbObject.invokeCreateRemoveCreateSameCMP();
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " +
e.getMessage());
}
}
public void testInvokeCreateCreateSameCMP() {
try {
ejbObject.invokeCreateCreateSameCMP();
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " +
e.getMessage());
}
}
public void testInvokeCreateFindNoForceCacheFlush() {
try {
ejbObject.invokeCreateFindNoForceCacheFlush();
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " +
e.getMessage());
}
}
public void testInvokeCreateFindForceCacheFlush() {
try {
ejbObject.invokeCreateFindForceCacheFlush();
} catch (Exception e) {
fail("Received Exception " + e.getClass() + " : " +
e.getMessage());
}
}
//
// Test ejb home methods
//===============================
}