db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r453263 - in /db/jdo: branches/2.0.1/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
Date Thu, 05 Oct 2006 15:10:03 GMT
Author: mbo
Date: Thu Oct  5 08:10:03 2006
New Revision: 453263

URL: http://svn.apache.org/viewvc?view=rev&rev=453263
Log:
JDO-345: test class MethodsAndObjectConstructionNotSupported now checks for mutating Collection
methods being called

Modified:
    db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
    db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java

Modified: db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
URL: http://svn.apache.org/viewvc/db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java?view=diff&rev=453263&r1=453262&r2=453263
==============================================================================
--- db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
(original)
+++ db/jdo/branches/2.0.1/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
Thu Oct  5 08:10:03 2006
@@ -21,7 +21,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.Employee;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
@@ -56,17 +56,17 @@
     public void testNegative() {
         PersistenceManager pm = getPM();
 
-        runTestUnsupportedOperators01(pm, "this.getX() == 1");
-        runTestUnsupportedOperators01(pm, "y.intValue() == 1");
-        runTestUnsupportedOperators01(pm, "y == new Integer(1)");
+        runTestUnsupportedOperators01(pm, Employee.class, "this.team.add(this)");
+        runTestUnsupportedOperators01(pm, Employee.class, "this.team.remove(this)");
+        runTestUnsupportedOperators01(pm, PCPoint.class, "y == new Integer(1)");
     }
 
     /** */
-    void runTestUnsupportedOperators01(PersistenceManager pm, String filter) {
+    void runTestUnsupportedOperators01(PersistenceManager pm, 
+                                       Class candidateClass, String filter) {
         String expectedMsg = "setFilter: Invalid method call ....";
         Query query = pm.newQuery();
-        query.setClass(PCPoint.class);
-        query.setCandidates(pm.getExtent(PCPoint.class, false));
+        query.setClass(candidateClass);
         
         try {
             query.setFilter(filter);                

Modified: db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java?view=diff&rev=453263&r1=453262&r2=453263
==============================================================================
--- db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
(original)
+++ db/jdo/trunk/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
Thu Oct  5 08:10:03 2006
@@ -21,7 +21,7 @@
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
 
-import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.Employee;
 import org.apache.jdo.tck.pc.mylib.PCPoint;
 import org.apache.jdo.tck.query.QueryTest;
 import org.apache.jdo.tck.util.BatchTestRunner;
@@ -56,17 +56,17 @@
     public void testNegative() {
         PersistenceManager pm = getPM();
 
-        runTestUnsupportedOperators01(pm, "this.getX() == 1");
-        runTestUnsupportedOperators01(pm, "y.intValue() == 1");
-        runTestUnsupportedOperators01(pm, "y == new Integer(1)");
+        runTestUnsupportedOperators01(pm, Employee.class, "this.team.add(this)");
+        runTestUnsupportedOperators01(pm, Employee.class, "this.team.remove(this)");
+        runTestUnsupportedOperators01(pm, PCPoint.class, "y == new Integer(1)");
     }
 
     /** */
-    void runTestUnsupportedOperators01(PersistenceManager pm, String filter) {
+    void runTestUnsupportedOperators01(PersistenceManager pm, 
+                                       Class candidateClass, String filter) {
         String expectedMsg = "setFilter: Invalid method call ....";
         Query query = pm.newQuery();
-        query.setClass(PCPoint.class);
-        query.setCandidates(pm.getExtent(PCPoint.class, false));
+        query.setClass(candidateClass);
         
         try {
             query.setFilter(filter);                



Mime
View raw message