db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject svn commit: r349919 - in /incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query: ./ api/ jdoql/ jdoql/keywords/ jdoql/methods/ jdoql/operators/ jdoql/parameters/ jdoql/variables/
Date Wed, 30 Nov 2005 10:53:47 GMT
Author: brazil
Date: Wed Nov 30 02:53:33 2005
New Revision: 349919

URL: http://svn.apache.org/viewcvs?rev=349919&view=rev
Log:
JDO-217: The expected result in JDO2 query test cases should have the exact runtime type of
the query.

Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/QueryTest.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/QueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/QueryTest.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/QueryTest.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/QueryTest.java Wed Nov 30
02:53:33 2005
@@ -865,41 +865,6 @@
      * @param assertion the assertion to prompt if the test case fails.
      * @param queryElementHolder the query to execute.
      * @param expectedResult the expected query result.
-     * @deprecated
-     */
-    protected void executeAPIQuery(String assertion,
-            QueryElementHolder queryElementHolder, Object[] expectedResult) {
-        executeAPIQuery(assertion, queryElementHolder, null, expectedResult);
-    }
-
-    /**
-     * Executes the given query element holder instance as a JDO API query.
-     * The result of that query is compared against the given argument 
-     * <code>expectedResult</code>. 
-     * If the expected result does not match the returned query result,
-     * then the test case fails prompting argument <code>assertion</code>.
-     * @param assertion the assertion to prompt if the test case fails.
-     * @param queryElementHolder the query to execute.
-     * @param parameters the parmaters of the query.
-     * @param expectedResult the expected query result.
-     * @deprecated
-     */
-    protected void executeAPIQuery(String assertion,
-            QueryElementHolder queryElementHolder, 
-            Object[] parameters, Object[] expectedResult) {
-        executeAPIQuery(assertion, queryElementHolder, 
-                parameters, Arrays.asList(expectedResult));
-    }
-    
-    /**
-     * Executes the given query element holder instance as a JDO API query.
-     * The result of that query is compared against the given argument 
-     * <code>expectedResult</code>. 
-     * If the expected result does not match the returned query result,
-     * then the test case fails prompting argument <code>assertion</code>.
-     * @param assertion the assertion to prompt if the test case fails.
-     * @param queryElementHolder the query to execute.
-     * @param expectedResult the expected query result.
      */
     protected void executeAPIQuery(String assertion,
             QueryElementHolder queryElementHolder, Object expectedResult) {
@@ -925,44 +890,6 @@
         }
         execute(assertion, queryElementHolder, false, 
                 parameters, expectedResult);
-    }
-    
-    /**
-     * Executes the given query element holder instance 
-     * as a JDO single string query.
-     * The result of that query is compared against the given argument 
-     * <code>expectedResult</code>. 
-     * If the expected result does not match the returned query result,
-     * then the test case fails prompting argument <code>assertion</code>.
-     * @param assertion the assertion to prompt if the test case fails.
-     * @param queryElementHolder the query to execute.
-     * @param expectedResult the expected query result.
-     * @deprecated
-     */
-    protected void executeSingleStringQuery(String assertion,
-            QueryElementHolder queryElementHolder, Object[] expectedResult) {
-        executeSingleStringQuery(assertion, queryElementHolder, 
-                null, expectedResult);
-    }
-    
-    /**
-     * Executes the given query element holder instance 
-     * as a JDO single string query.
-     * The result of that query is compared against the given argument 
-     * <code>expectedResult</code>. 
-     * If the expected result does not match the returned query result,
-     * then the test case fails prompting argument <code>assertion</code>.
-     * @param assertion the assertion to prompt if the test case fails.
-     * @param queryElementHolder the query to execute.
-     * @param parameters the parmaters of the query.
-     * @param expectedResult the expected query result.
-     * @deprecated
-     */
-    protected void executeSingleStringQuery(String assertion,
-            QueryElementHolder queryElementHolder, 
-            Object[] parameters, Object[] expectedResult) {
-        executeSingleStringQuery(assertion, queryElementHolder, 
-                parameters, Arrays.asList(expectedResult));
     }
     
     /**

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java
Wed Nov 30 02:53:33 2005
@@ -17,7 +17,6 @@
 package org.apache.jdo.tck.query.api;
 
 import java.math.BigDecimal;
-import java.util.Arrays;
 
 import javax.jdo.Query;
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java
Wed Nov 30 02:53:33 2005
@@ -114,9 +114,12 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"primitiveTypesCharacterStringLiterals"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getMylibInstancesAsList(new String[]{
+            "primitiveTypesCharacterStringLiterals"})
     };
     
     /**
@@ -132,12 +135,10 @@
     public void testPositive() {
         if (isUnconstrainedVariablesSupported()) {
             for (int i = 0; i < VALID_QUERIES.length; i++) {
-                Object[] expectedResultValues = 
-                    getMylibInstances(expectedResult[i]);
                 executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                        expectedResultValues);
+                        expectedResult[i]);
                 executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                        expectedResultValues);
+                        expectedResult[i]);
             }
         }
     }

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java
Wed Nov 30 02:53:33 2005
@@ -76,10 +76,13 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp1"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp1"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"})
     };
             
     /**
@@ -94,12 +97,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java
Wed Nov 30 02:53:33 2005
@@ -102,12 +102,18 @@
         /*TO*/          4)
     };
 
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1", "emp2", "emp3", "emp4"},
-        {"emp2", "emp3", "emp4", "emp5"},
-        {"emp2", "emp3", "emp4"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp2", "emp3", "emp4"})
     };
             
     /**
@@ -122,12 +128,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java
Wed Nov 30 02:53:33 2005
@@ -102,12 +102,18 @@
         /*TO*/          "4")
     };
 
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1", "emp2", "emp3", "emp4"},
-        {"emp2", "emp3", "emp4", "emp5"},
-        {"emp2", "emp3", "emp4"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp2", "emp3", "emp4"})
     };
             
     /**
@@ -122,12 +128,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java
Wed Nov 30 02:53:33 2005
@@ -17,6 +17,7 @@
 package org.apache.jdo.tck.query.jdoql.keywords;
 
 import java.math.BigDecimal;
+import java.util.Arrays;
 
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
@@ -66,11 +67,14 @@
         /*TO*/          3)
     };
     
-    /** The expected results of valid queries. */
-    private static Object[][] expectedResult = {
-        {new FullName("emp1First", "emp1Last"), 
-         new FullName("emp2First", "emp2Last"),
-         new FullName("emp5First", "emp5Last")}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        Arrays.asList(new Object[]{
+                new FullName("emp1First", "emp1Last"), 
+                new FullName("emp2First", "emp2Last"),
+                new FullName("emp5First", "emp5Last")})
     };
             
     /** Parameters of valid queries. */

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java
Wed Nov 30 02:53:33 2005
@@ -16,8 +16,10 @@
 
 package org.apache.jdo.tck.query.jdoql.methods;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 
 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManager;
@@ -98,7 +100,7 @@
     public void testGetObjectById() {
         // query 1
         int index = 0;
-        Object[] expectedResult = getExpectedResult(true, Person.class);
+        List expectedResult = getExpectedResult(true, Person.class);
         executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], 
                 expectedResult);
         executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], 
@@ -108,9 +110,10 @@
         index = 1;
         expectedResult = getExpectedResult(false, Person.class, "personid == 1");
         // The query above returns a collection of size 1.
-        // The collection element is the parameter of the query below.
+        // The collection element is a pc instances 
+        // whose oid is the parameter of the query below.
         Object[] parameters = new Object[]{
-                JDOHelper.getObjectId(expectedResult[0])};
+                JDOHelper.getObjectId(expectedResult.get(0))};
         executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], 
                 parameters, expectedResult);
         executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], 
@@ -126,14 +129,14 @@
     }
 
     /** */
-    private Object[] getExpectedResult(boolean oidsWanted, Class candidateClass) {
+    private List getExpectedResult(boolean oidsWanted, Class candidateClass) {
         return getExpectedResult(oidsWanted, candidateClass, null);
     }
     
     /** */
-    private Object[] getExpectedResult(boolean oidsWanted, 
+    private List getExpectedResult(boolean oidsWanted, 
             Class candidateClass, String filter) {
-        Object[] expectedResult;
+        List expectedResult;
         PersistenceManager pm = getPM();
         Transaction transaction = pm.currentTransaction();
         transaction.begin();
@@ -142,15 +145,13 @@
                 pm.newQuery(candidateClass, filter);
             try {
                 Collection result = (Collection) query.execute();
-                expectedResult = new Object[result.size()];
-                int j = 0;
-                for (Iterator i = result.iterator(); i.hasNext(); ) {
-                    Object o = i.next();
-                    if (oidsWanted) {
-                        expectedResult[j++] = JDOHelper.getObjectId(o);
-                    } else {
-                        expectedResult[j++] = o;
+                if (oidsWanted) {
+                    expectedResult = new ArrayList();
+                    for (Iterator i = result.iterator(); i.hasNext(); ) {
+                        expectedResult.add(JDOHelper.getObjectId(i.next()));
                     }
+                } else {
+                    expectedResult = new ArrayList(result);
                 }
             } finally {
                 query.closeAll();

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java
Wed Nov 30 02:53:33 2005
@@ -239,28 +239,46 @@
                 /*TO*/          null),
     };
 
-    /** The expected results of valid queries testing Math.abs. */
-    private static String[][] expectedResultABS = {
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"},
-        {"primitiveTypesPositive", "primitiveTypesNegative"}
+    /** 
+     * The expected results of valid queries testing Math.abs.
+     */
+    private Object[] expectedResultABS = {
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive", "primitiveTypesNegative"})
     };
         
     /** The expected results of valid queries testing Math.sqrt. */
-    private static String[][] expectedResultSQRT = {
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"},
-        {"primitiveTypesPositive"}
+    private Object[] expectedResultSQRT = {
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"}),
+            getMylibInstancesAsList(new String[]{
+                    "primitiveTypesPositive"})
     };
             
     /**
@@ -275,24 +293,20 @@
     /** */
     public void testAbs() {
         for (int i = 0; i < VALID_QUERIES_ABS.length; i++) {
-            Object[] expectedResultValues = 
-                getMylibInstances(expectedResultABS[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES_ABS[i], 
-                    expectedResultValues);
+                    expectedResultABS[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES_ABS[i], 
-                    expectedResultValues);
+                    expectedResultABS[i]);
         }
     }
     
     /** */
     public void testSqrt() {
         for (int i = 0; i < VALID_QUERIES_SQRT.length; i++) {
-            Object[] expectedResultValues = 
-                getMylibInstances(expectedResultSQRT[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES_SQRT[i], 
-                    expectedResultValues);
+                    expectedResultSQRT[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES_SQRT[i], 
-                    expectedResultValues);
+                    expectedResultSQRT[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java
Wed Nov 30 02:53:33 2005
@@ -214,20 +214,25 @@
 
     /** 
      * The expected results of valid queries.
-     * The strings are names of bean instances loaded by spring.  
      */
-    private static String[][] expectedResult = {
-        {"emp1"},
-        {"emp1"},
-        {"dept1"},
-        {"dept1"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"},
-        {"emp1", "emp2", "emp3", "emp4", "emp5"}
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp1"}),
+        getCompanyModelInstancesAsList(new String[]{"emp1"}),
+        getCompanyModelInstancesAsList(new String[]{"dept1"}),
+        getCompanyModelInstancesAsList(new String[]{"dept1"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{"emp1"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"}),
+        getCompanyModelInstancesAsList(new String[]{
+                "emp1", "emp2", "emp3", "emp4", "emp5"})
     };
             
     /**
@@ -305,11 +310,9 @@
 
     /** */
     private void executeQuery(int index) {
-        Object[] expectedResultValues = 
-            getCompanyModelInstances(expectedResult[index]);
         executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], 
-                expectedResultValues);
+                expectedResult[index]);
         executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], 
-                expectedResultValues);
+                expectedResult[index]);
     }
 }

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java
Wed Nov 30 02:53:33 2005
@@ -75,10 +75,12 @@
         /*TO*/          null)
     };
 
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp2", "emp3"},
-        {"emp2", "emp3"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp2", "emp3"}),
+        getCompanyModelInstancesAsList(new String[]{"emp2", "emp3"})
     };
             
     /**
@@ -93,12 +95,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java
Wed Nov 30 02:53:33 2005
@@ -66,9 +66,11 @@
         /*TO*/          null)
     };
 
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-            {"emp2", "emp4"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp2", "emp4"})
     };
             
     /**
@@ -83,12 +85,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
         
         runTestUsingPrimitiveTypes();

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java
Wed Nov 30 02:53:33 2005
@@ -61,9 +61,11 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp1"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp1"})
     };
             
     /** Parameters of valid queries. */
@@ -83,12 +85,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    parameters[i], expectedResultValues);
+                    parameters[i], expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    parameters[i], expectedResultValues);
+                    parameters[i], expectedResult[i]);
         }
     }
     

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java
Wed Nov 30 02:53:33 2005
@@ -99,10 +99,12 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp2"},
-        {"emp2"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp2"}),
+        getCompanyModelInstancesAsList(new String[]{"emp2"})
     };
             
     /**
@@ -117,12 +119,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java
Wed Nov 30 02:53:33 2005
@@ -62,9 +62,12 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp2", "emp3", "emp4"}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{
+                "emp2", "emp3", "emp4"})
     };
             
     /** Parameters of valid queries. */
@@ -85,12 +88,10 @@
     public void testPositive() {
         if (isUnconstrainedVariablesSupported()) {
             for (int i = 0; i < VALID_QUERIES.length; i++) {
-                Object[] expectedResultValues = 
-                    getCompanyModelInstances(expectedResult[i]);
                 executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                        parameters[i], expectedResultValues);
+                        parameters[i], expectedResult[i]);
                 executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                        parameters[i], expectedResultValues);
+                        parameters[i], expectedResult[i]);
             }
         }
     }

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java
Wed Nov 30 02:53:33 2005
@@ -16,6 +16,8 @@
 
 package org.apache.jdo.tck.query.jdoql.variables;
 
+import java.util.LinkedList;
+
 import org.apache.jdo.tck.JDO_Test;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
 import org.apache.jdo.tck.pc.company.Employee;
@@ -124,13 +126,15 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {"emp2"},
-        {"emp2"},
-        {"emp1"},
-        {"emp2"},
-        {}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        getCompanyModelInstancesAsList(new String[]{"emp2"}),
+        getCompanyModelInstancesAsList(new String[]{"emp2"}),
+        getCompanyModelInstancesAsList(new String[]{"emp1"}),
+        getCompanyModelInstancesAsList(new String[]{"emp2"}),
+        new LinkedList()
     };
             
     /**
@@ -145,12 +149,10 @@
     /** */
     public void testPositive() {
         for (int i = 0; i < VALID_QUERIES.length; i++) {
-            Object[] expectedResultValues = 
-                getCompanyModelInstances(expectedResult[i]);
             executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
             executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], 
-                    expectedResultValues);
+                    expectedResult[i]);
         }
     }
 

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java?rev=349919&r1=349918&r2=349919&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java
(original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java
Wed Nov 30 02:53:33 2005
@@ -16,6 +16,8 @@
 
 package org.apache.jdo.tck.query.jdoql.variables;
 
+import java.util.LinkedList;
+
 import javax.jdo.PersistenceManager;
 import javax.jdo.Transaction;
 
@@ -65,9 +67,11 @@
         /*TO*/          null)
     };
     
-    /** The expected results of valid queries. */
-    private static String[][] expectedResult = {
-        {}
+    /** 
+     * The expected results of valid queries.
+     */
+    private Object[] expectedResult = {
+        new LinkedList()
     };
     
     /**



Mime
View raw message