Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java
===================================================================
--- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java (Revision 0)
+++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java (Revision 0)
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.query.jdoql.methods;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.CompanyModelReader;
+import org.apache.jdo.tck.pc.company.Person;
+import org.apache.jdo.tck.query.QueryElementHolder;
+import org.apache.jdo.tck.query.QueryTest;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *Title: Supported Map methods.
+ *
+ *Keywords: query
+ *
+ *Assertion ID: A14.6.2-47.
+ *
+ *Assertion Description:
+ * New supported String methods:
+ *
main is called when the class
+ * is directly executed from the command line.
+ * @param args The arguments passed to the program.
+ */
+ public static void main(String[] args) {
+ BatchTestRunner.run(SupportedStringMethods.class);
+ }
+
+ /** */
+ public void testToLowerCase() {
+ int index = 0;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testToUpperCase() {
+ int index = 1;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testIndexOfString() {
+ int index = 2;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testIndexOfStringInt() {
+ int index = 3;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testMatches() {
+ int index = 4;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testSubstringInt() {
+ int index = 5;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testSubstringIntInt() {
+ int index = 6;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testStartsWith() {
+ int index = 7;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testEndsWith() {
+ int index = 8;
+ executeQuery(index);
+ }
+
+ /**
+ * @see JDO_Test#localSetUp()
+ */
+ protected void localSetUp() {
+ loadCompanyModel(getPM(), COMPANY_TESTDATA);
+ addTearDownClass(CompanyModelReader.getTearDownClasses());
+ }
+
+ /** */
+ private void executeQuery(int index) {
+ Object[] expectedResultValues =
+ getCompanyModelInstances(expectedResult[index]);
+ executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResultValues);
+ executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResultValues);
+ }
+
+}
Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java
===================================================================
--- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java (Revision 0)
+++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java (Revision 0)
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.query.jdoql.methods;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.CompanyModelReader;
+import org.apache.jdo.tck.pc.company.FullTimeEmployee;
+import org.apache.jdo.tck.query.QueryElementHolder;
+import org.apache.jdo.tck.query.QueryTest;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *Title: Supported Math methods.
+ *main is called when the class
+ * is directly executed from the command line.
+ * @param args The arguments passed to the program.
+ */
+ public static void main(String[] args) {
+ BatchTestRunner.run(SupportedMathMethods.class);
+ }
+
+ /** */
+ public void testAbs() {
+ int index = 0;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testSqrt() {
+ int index = 1;
+ executeQuery(index);
+ }
+
+ /**
+ * @see JDO_Test#localSetUp()
+ */
+ protected void localSetUp() {
+ loadCompanyModel(getPM(), COMPANY_TESTDATA);
+ addTearDownClass(CompanyModelReader.getTearDownClasses());
+ }
+
+ /** */
+ private void executeQuery(int index) {
+ Object[] expectedResultValues =
+ getCompanyModelInstances(expectedResult[index]);
+ executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResultValues);
+ executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResultValues);
+ }
+
+}
Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java
===================================================================
--- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java (Revision 0)
+++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java (Revision 0)
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.query.jdoql.methods;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManager;
+import javax.jdo.Query;
+import javax.jdo.Transaction;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.CompanyModelReader;
+import org.apache.jdo.tck.pc.company.Person;
+import org.apache.jdo.tck.query.QueryElementHolder;
+import org.apache.jdo.tck.query.QueryTest;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *Title: Supported JDOHelper methods.
+ *main is called when the class
+ * is directly executed from the command line.
+ * @param args The arguments passed to the program.
+ */
+ public static void main(String[] args) {
+ BatchTestRunner.run(SupportedJDOHelperMethods.class);
+ }
+
+ /** */
+ public void testGetObjectById() {
+ int index = 0;
+ Object[] expectedResult = getExpectedResult();
+ executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResult);
+ executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResult);
+ }
+
+ /**
+ * @see JDO_Test#localSetUp()
+ */
+ protected void localSetUp() {
+ loadCompanyModel(getPM(), COMPANY_TESTDATA);
+ addTearDownClass(CompanyModelReader.getTearDownClasses());
+ }
+
+ /** */
+ private Object[] getExpectedResult() {
+ Object[] expectedResult;
+ PersistenceManager pm = getPM();
+ Transaction transaction = pm.currentTransaction();
+ transaction.begin();
+ try {
+ Query query = pm.newQuery(Person.class);
+ try {
+ Collection result = (Collection) query.execute();
+ expectedResult = new Object[result.size()];
+ int j = 0;
+ for (Iterator i = result.iterator(); i.hasNext(); ) {
+ expectedResult[j++] = JDOHelper.getObjectId(i.next());
+ }
+ } finally {
+ query.closeAll();
+ }
+ } finally {
+ if (transaction.isActive()) {
+ transaction.rollback();
+ }
+ }
+ return expectedResult;
+ }
+
+}
Index: test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMapMethods.java
===================================================================
--- test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMapMethods.java (Revision 0)
+++ test/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMapMethods.java (Revision 0)
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.query.jdoql.methods;
+
+import org.apache.jdo.tck.JDO_Test;
+import org.apache.jdo.tck.pc.company.CompanyModelReader;
+import org.apache.jdo.tck.pc.company.Person;
+import org.apache.jdo.tck.query.QueryElementHolder;
+import org.apache.jdo.tck.query.QueryTest;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *Title: Supported Map methods.
+ *main is called when the class
+ * is directly executed from the command line.
+ * @param args The arguments passed to the program.
+ */
+ public static void main(String[] args) {
+ BatchTestRunner.run(SupportedMapMethods.class);
+ }
+
+ /** */
+ public void testGet() {
+ int index = 0;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testContainsKey() {
+ int index = 1;
+ executeQuery(index);
+ }
+
+ /** */
+ public void testContainsValue() {
+ int index = 2;
+ executeQuery(index);
+ }
+
+ /**
+ * @see JDO_Test#localSetUp()
+ */
+ protected void localSetUp() {
+ loadCompanyModel(getPM(), COMPANY_TESTDATA);
+ addTearDownClass(CompanyModelReader.getTearDownClasses());
+ }
+
+ /** */
+ private void executeQuery(int index) {
+ Object[] expectedResultValues =
+ getCompanyModelInstances(expectedResult[index]);
+ executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResultValues);
+ executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index],
+ expectedResultValues);
+ }
+
+}
Index: test/conf/alltests.conf
===================================================================
--- test/conf/alltests.conf (Revision 306550)
+++ test/conf/alltests.conf (Arbeitskopie)
@@ -302,6 +302,10 @@
org.apache.jdo.tck.query.jdoql.methods.MethodsAndObjectConstructionNotSupported \
org.apache.jdo.tck.query.jdoql.methods.StartsWithAndEndsWith \
org.apache.jdo.tck.query.jdoql.methods.SupportedCollectionMethods \
+org.apache.jdo.tck.query.jdoql.methods.SupportedJDOHelperMethods \
+org.apache.jdo.tck.query.jdoql.methods.SupportedMapMethods \
+org.apache.jdo.tck.query.jdoql.methods.SupportedMathMethods \
+org.apache.jdo.tck.query.jdoql.methods.SupportedStringMethods \
org.apache.jdo.tck.query.jdoql.operators.BinaryAddition \
org.apache.jdo.tck.query.jdoql.operators.BinarySubtraction \
org.apache.jdo.tck.query.jdoql.operators.BitwiseComplement \