Index: test/java/org/apache/jdo/tck/query/QueryTest.java =================================================================== --- test/java/org/apache/jdo/tck/query/QueryTest.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/QueryTest.java (Arbeitskopie) @@ -865,43 +865,8 @@ * @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 - * expectedResult. - * If the expected result does not match the returned query result, - * then the test case fails prompting argument assertion. - * @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 - * expectedResult. - * If the expected result does not match the returned query result, - * then the test case fails prompting argument assertion. - * @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) { executeAPIQuery(assertion, queryElementHolder, null, expectedResult); } @@ -937,46 +902,8 @@ * @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 - * expectedResult. - * If the expected result does not match the returned query result, - * then the test case fails prompting argument assertion. - * @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)); - } - - /** - * Executes the given query element holder instance - * as a JDO single string query. - * The result of that query is compared against the given argument - * expectedResult. - * If the expected result does not match the returned query result, - * then the test case fails prompting argument assertion. - * @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 executeSingleStringQuery(String assertion, QueryElementHolder queryElementHolder, Object expectedResult) { executeSingleStringQuery(assertion, queryElementHolder, null, expectedResult); Index: test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java =================================================================== --- test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/api/SingleStringQuery.java (Arbeitskopie) @@ -17,7 +17,6 @@ package org.apache.jdo.tck.query.api; import java.math.BigDecimal; -import java.util.Arrays; import javax.jdo.Query; Index: test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java (Arbeitskopie) @@ -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]); } } } Index: test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java (Arbeitskopie) @@ -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(); Index: test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java (Arbeitskopie) @@ -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. */ Index: test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java (Arbeitskopie) @@ -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]); } } } Index: test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java (Arbeitskopie) @@ -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() }; /** Index: test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java (Arbeitskopie) @@ -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(); Index: test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java (Arbeitskopie) @@ -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]); } } Index: test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java =================================================================== --- test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java (Revision 349718) +++ test/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java (Arbeitskopie) @@ -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]); } }