You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by cl...@apache.org on 2021/05/07 23:12:17 UTC

[db-jdo] 35/43: JDO-345: test class MethodsAndObjectConstructionNotSupported now checks for mutating Collection methods being called

This is an automated email from the ASF dual-hosted git repository.

clr pushed a commit to branch origin/2.0.1
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit 4db841cf7d1766aa7cfaec1eb9e7d13a7b1e2575
Author: Michael Bouschen <mb...@apache.org>
AuthorDate: Thu Oct 5 15:10:03 2006 +0000

    JDO-345: test class MethodsAndObjectConstructionNotSupported now checks for mutating Collection methods being called
---
 .../methods/MethodsAndObjectConstructionNotSupported.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java b/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
index 6908e0d..6274c16 100644
--- a/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
+++ b/tck20/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java
@@ -21,7 +21,7 @@ import javax.jdo.JDOUserException;
 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 class MethodsAndObjectConstructionNotSupported extends QueryTest {
     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);