Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 58434 invoked from network); 20 Sep 2005 21:29:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Sep 2005 21:29:45 -0000 Received: (qmail 30226 invoked by uid 500); 20 Sep 2005 21:29:44 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 30210 invoked by uid 99); 20 Sep 2005 21:29:44 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 20 Sep 2005 14:29:44 -0700 Received: (qmail 58298 invoked by uid 65534); 20 Sep 2005 21:29:34 -0000 Message-ID: <20050920212933.58218.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r290570 - in /incubator/jdo/trunk/tck20: assertions/ test/conf/ test/java/org/apache/jdo/tck/transactions/ Date: Tue, 20 Sep 2005 21:29:28 -0000 To: jdo-commits@db.apache.org From: mbo@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mbo Date: Tue Sep 20 14:29:12 2005 New Revision: 290570 URL: http://svn.apache.org/viewcvs?rev=290570&view=rev Log: JDO-139: Issues with tck20 test case transaction.GetOptimistic Removed: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/GetOptimistic.java Modified: incubator/jdo/trunk/tck20/assertions/JdoTckAssertionsTable.sxc incubator/jdo/trunk/tck20/test/conf/JDOTCKTestCases.list incubator/jdo/trunk/tck20/test/conf/alltests.conf incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/Rollback.java incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/SetOptimistic.java Modified: incubator/jdo/trunk/tck20/assertions/JdoTckAssertionsTable.sxc URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/assertions/JdoTckAssertionsTable.sxc?rev=290570&r1=290569&r2=290570&view=diff ============================================================================== Binary files - no diff available. Modified: incubator/jdo/trunk/tck20/test/conf/JDOTCKTestCases.list URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/JDOTCKTestCases.list?rev=290570&r1=290569&r2=290570&view=diff ============================================================================== --- incubator/jdo/trunk/tck20/test/conf/JDOTCKTestCases.list (original) +++ incubator/jdo/trunk/tck20/test/conf/JDOTCKTestCases.list Tue Sep 20 14:29:12 2005 @@ -364,7 +364,6 @@ org.apache.jdo.tck.transactions.BeforeCompletionMethodCalled org.apache.jdo.tck.transactions.BeforeCompletionMethodNotCalledBeforeRollback org.apache.jdo.tck.transactions.Commit -org.apache.jdo.tck.transactions.GetOptimistic org.apache.jdo.tck.transactions.GetPersistenceManager org.apache.jdo.tck.transactions.GetRetainValues org.apache.jdo.tck.transactions.GetSynchronization Modified: incubator/jdo/trunk/tck20/test/conf/alltests.conf URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/conf/alltests.conf?rev=290570&r1=290569&r2=290570&view=diff ============================================================================== --- incubator/jdo/trunk/tck20/test/conf/alltests.conf (original) +++ incubator/jdo/trunk/tck20/test/conf/alltests.conf Tue Sep 20 14:29:12 2005 @@ -336,7 +336,6 @@ org.apache.jdo.tck.transactions.BeforeCompletionMethodCalled \ org.apache.jdo.tck.transactions.BeforeCompletionMethodNotCalledBeforeRollback \ org.apache.jdo.tck.transactions.Commit \ -org.apache.jdo.tck.transactions.GetOptimistic \ org.apache.jdo.tck.transactions.GetPersistenceManager \ org.apache.jdo.tck.transactions.GetRetainValues \ org.apache.jdo.tck.transactions.GetSynchronization \ Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/Rollback.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/Rollback.java?rev=290570&r1=290569&r2=290570&view=diff ============================================================================== --- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/Rollback.java (original) +++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/Rollback.java Tue Sep 20 14:29:12 2005 @@ -25,7 +25,6 @@ import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; -import org.apache.jdo.tck.query.BoundParameterCheck; import org.apache.jdo.tck.util.BatchTestRunner; @@ -37,16 +36,15 @@ *Assertion ID: A13.4.4-2. *
*Assertion Description: - The commit method performs the following operations: + The rollback method performs the following operations:
    +
  • rolls back changes made in this transaction from the data store;
  • transitions persistent instances according to the life cycle specification;
  • -
  • rolls back changes made in this transaction from the data store;
  • calls the afterCompletion method of the Synchronization instance registered with the Transaction.
- */ @@ -65,7 +63,7 @@ /** */ private static final String ASSERTION_FAILED = - "Assertion A13.4.4-2 (BoundParameterCheck) failed: "; + "Assertion A13.4.4-2 (Rollback) failed: "; /** * The main is called when the class @@ -73,7 +71,7 @@ * @param args The arguments passed to the program. */ public static void main(String[] args) { - BatchTestRunner.run(BoundParameterCheck.class); + BatchTestRunner.run(Rollback.class); } /** Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/SetOptimistic.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/SetOptimistic.java?rev=290570&r1=290569&r2=290570&view=diff ============================================================================== --- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/SetOptimistic.java (original) +++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/transactions/SetOptimistic.java Tue Sep 20 14:29:12 2005 @@ -62,14 +62,51 @@ public void test() { pm = getPM(); - runTestSetOptimistic(pm); + runTestSetOptimistic(pm); + runTestSetOptimisticToInverse(pm); pm.close(); pm = null; } /** */ - void runTestSetOptimistic(PersistenceManager pm) { + public void runTestSetOptimistic(PersistenceManager pm) { + Transaction tx = pm.currentTransaction(); + try { + if (isOptimisticSupported()) { + tx.setOptimistic(true); + tx.begin(); + if (!tx.getOptimistic()) { + fail(ASSERTION_FAILED, + "tx.getOptimistic() returns false after setting the flag to true."); + } + tx.commit(); + if (!tx.getOptimistic()) { + fail(ASSERTION_FAILED, + "tx.getOptimistic() returns false after setting the flag to true."); + } + } + + tx.setOptimistic(false); + tx.begin(); + if (tx.getOptimistic()) { + fail(ASSERTION_FAILED, + "tx.getOptimistic() returns true after setting the flag to false."); + } + tx.commit(); + if (tx.getOptimistic()) { + fail(ASSERTION_FAILED, + "tx.getOptimistic() returns true after setting the flag to false."); + } + } + finally { + if ((tx != null) && tx.isActive()) + tx.rollback(); + } + } + + /** */ + void runTestSetOptimisticToInverse(PersistenceManager pm) { if (!isOptimisticSupported()) { if (debug) logger.debug("Optimistic not supported."); return;