cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r478420 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access: UnitTestDomain.java UnitTestDomainQueryAction.java
Date Thu, 23 Nov 2006 01:17:17 GMT
Author: aadamchik
Date: Wed Nov 22 17:17:16 2006
New Revision: 478420

URL: http://svn.apache.org/viewvc?view=rev&rev=478420
Log:
more verbose error message during test failures

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomain.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomainQueryAction.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomain.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomain.java?view=diff&rev=478420&r1=478419&r2=478420
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomain.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomain.java
Wed Nov 22 17:17:16 2006
@@ -63,12 +63,14 @@
     }
 
     public void performQueries(Collection queries, OperationObserver callback) {
-        checkQueryAllowed();
+        checkQueryAllowed(queries);
         super.performQueries(queries, callback);
     }
 
-    public void checkQueryAllowed() throws AssertionFailedError {
-        Assert.assertFalse("Query is unexpected.", blockingQueries);
+    public void checkQueryAllowed(Collection queries) throws AssertionFailedError {
+        if (blockingQueries) {
+            Assert.fail("Query is unexpected: " + queries);
+        }
 
         queryCount++;
     }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomainQueryAction.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomainQueryAction.java?view=diff&rev=478420&r1=478419&r2=478420
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomainQueryAction.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/UnitTestDomainQueryAction.java
Wed Nov 22 17:17:16 2006
@@ -19,6 +19,9 @@
 
 package org.apache.cayenne.access;
 
+import java.util.Collection;
+import java.util.Collections;
+
 import junit.framework.AssertionFailedError;
 
 import org.apache.cayenne.ObjectContext;
@@ -46,11 +49,11 @@
     }
 
     void runQueryInTransaction() {
-        checkQueryAllowed();
+        checkQueryAllowed(Collections.singleton(query));
         super.runQueryInTransaction();
     }
 
-    protected void checkQueryAllowed() throws AssertionFailedError {
-        ((UnitTestDomain) domain).checkQueryAllowed();
+    protected void checkQueryAllowed(Collection queries) throws AssertionFailedError {
+        ((UnitTestDomain) domain).checkQueryAllowed(queries);
     }
 }



Mime
View raw message