db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [db-jdo] 35/43: JDO-345: test class MethodsAndObjectConstructionNotSupported now checks for mutating Collection methods being called
Date Fri, 07 May 2021 23:12:17 GMT
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 <mbo@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);                

Mime
View raw message