From jdo-commits-return-1811-apmail-db-jdo-commits-archive=www.apache.org@db.apache.org Mon Jul 02 23:10:21 2007 Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 9893 invoked from network); 2 Jul 2007 23:10:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 23:10:20 -0000 Received: (qmail 64307 invoked by uid 500); 2 Jul 2007 23:10:23 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 64261 invoked by uid 99); 2 Jul 2007 23:10:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 16:10:23 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 16:10:13 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 39F401A981A; Mon, 2 Jul 2007 16:09:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r552622 [1/5] - in /db/jdo/trunk/tck2: ./ src/conf/ src/java/org/apache/jdo/tck/pc/company/ src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/ src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/ Date: Mon, 02 Jul 2007 23:09:48 -0000 To: jdo-commits@db.apache.org From: mcaisse@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070702230953.39F401A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mcaisse Date: Mon Jul 2 16:09:43 2007 New Revision: 552622 URL: http://svn.apache.org/viewvc?view=rev&rev=552622 Log: JDO-503 New annotations tests Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-1Relationships.conf db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-MRelationships.conf db/jdo/trunk/tck2/src/conf/companyFCAnnotatedAllRelationships.conf db/jdo/trunk/tck2/src/conf/companyFCAnnotatedEmbedded.conf db/jdo/trunk/tck2/src/conf/companyFCAnnotatedM-MRelationships.conf db/jdo/trunk/tck2/src/conf/companyFCAnnotatedNoRelationships.conf db/jdo/trunk/tck2/src/conf/companyPIAnnotatedNoRelationships.conf db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMFieldClass.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMInterface.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCProject.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIAddress.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIDentalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIDepartment.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIFullTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIMedicalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPartTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIProject.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCAddress.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCDentalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCDepartment.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCFullTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCMedicalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPartTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCProject.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIAddress.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIDentalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIDepartment.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIFullTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIMedicalInsurance.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPartTimeEmployee.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java (with props) db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIProject.java (with props) Modified: db/jdo/trunk/tck2/maven.xml db/jdo/trunk/tck2/project.properties db/jdo/trunk/tck2/project.xml db/jdo/trunk/tck2/src/conf/configurations.list db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMClass.java db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java Modified: db/jdo/trunk/tck2/maven.xml URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/maven.xml?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/maven.xml (original) +++ db/jdo/trunk/tck2/maven.xml Mon Jul 2 16:09:43 2007 @@ -587,6 +587,10 @@ + jpox.enhancer.jarfile is ${jpox.enhancer.jarfile} + jpox.javafive.jarfile is ${jpox.javafive.jarfile} + jdori.enhancer.classpath is ${jdori.enhancer.classpath} + enhance.classpath is ${enhance.classpath} + @@ -682,6 +687,8 @@ + + Modified: db/jdo/trunk/tck2/project.properties URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/project.properties?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/project.properties (original) +++ db/jdo/trunk/tck2/project.properties Mon Jul 2 16:09:43 2007 @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Build properties maven.compile.source = 1.5 maven.compile.target = 1.5 @@ -59,6 +58,7 @@ jdo.api.jarfile = ${pom.getDependencyPath('javax.jdo:jdo2-api')} jpox.jdori.jarfile = ${pom.getDependencyPath('jpox:jpox-core')} jpox.enhancer.jarfile = ${pom.getDependencyPath('jpox:jpox-enhancer')} +jpox.javafive.jarfile = ${pom.getDependencyPath('jpox:jpox-java5')} bcel.jarfile = ${pom.getDependencyPath('org.apache.bcel:bcel')} junit.jarfile = ${pom.getDependencyPath('junit:junit')} jta.jarfile = ${pom.getDependencyPath('javax.transaction:transaction-api')} @@ -89,6 +89,7 @@ # jpox dependencies + jdo.tck.pcclasses.sources = \ org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerAttach.java \ org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerClear.java \ @@ -119,6 +120,50 @@ org/apache/jdo/tck/pc/company/IMedicalInsurance.java \ org/apache/jdo/tck/pc/company/IPartTimeEmployee.java \ org/apache/jdo/tck/pc/company/IProject.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCProject.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIAddress.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIDepartment.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIFullTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIDentalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIMedicalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIPartTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIProject.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCAddress.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCDepartment.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCFullTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCDentalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCMedicalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCPartTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCProject.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIAddress.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIDepartment.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIFullTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIDentalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIMedicalInsurance.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIPartTimeEmployee.java \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIProject.java \ org/apache/jdo/tck/pc/companyMapWithoutJoin/Company.java \ org/apache/jdo/tck/pc/companyMapWithoutJoin/Department.java \ org/apache/jdo/tck/pc/companyMapWithoutJoin/Person.java \ @@ -268,6 +313,50 @@ org/apache/jdo/tck/pc/company/IMedicalInsurance.class \ org/apache/jdo/tck/pc/company/IPartTimeEmployee.class \ org/apache/jdo/tck/pc/company/IProject.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCDepartment.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCFullTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCDentalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCMedicalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCPartTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FCProject.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIAddress.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIDepartment.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIFullTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIDentalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIMedicalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIPartTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedApp/PIProject.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCAddress.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCDepartment.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCFullTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCDentalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCMedicalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCPartTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FCProject.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIAddress.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIDepartment.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIFullTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIDentalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIMedicalInsurance.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIPartTimeEmployee.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PIProject.class \ org/apache/jdo/tck/pc/companyMapWithoutJoin/Company.class \ org/apache/jdo/tck/pc/companyMapWithoutJoin/Department.class \ org/apache/jdo/tck/pc/companyMapWithoutJoin/Person.class \ @@ -426,48 +515,7 @@ org/apache/jdo/tck/pc/companyMapWithoutJoin/package.jdo \ org/apache/jdo/tck/pc/companyListWithoutJoin/package.jdo \ org/apache/jdo/tck/pc/order/package.jdo \ - org/apache/jdo/tck/pc/fieldtypes/AllTypes.jdo \ - org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/ArrayListCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/CollectionCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigDecimal.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigInteger.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfBoolean.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfByte.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfCharacter.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfDate.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfDouble.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfFloat.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfInteger.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfLocale.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfLong.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfObject.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivebyte.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivechar.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveint.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivelong.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfShort.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleClass.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface.jdo \ - org/apache/jdo/tck/pc/fieldtypes/FieldsOfString.jdo \ - org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/HashSetCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/LinkedListCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/ListCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/SetCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/TreeSetCollections.jdo \ - org/apache/jdo/tck/pc/fieldtypes/VectorCollections.jdo \ + org/apache/jdo/tck/pc/fieldtypes/*.jdo \ org/apache/jdo/tck/pc/inheritance/package.jdo \ org/apache/jdo/tck/pc/instancecallbacks/package.jdo \ org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.jdo \ @@ -479,4 +527,11 @@ org/apache/jdo/tck/pc/query/package.jdo \ org/apache/jdo/tck/pc/singlefieldidentity/package.jdo \ org/apache/jdo/tck/pc/shoppingcart/package.jdo \ - org/apache/jdo/tck/package.jdo + org/apache/jdo/tck/package.jdo \ + org/apache/jdo/tck/pc/companyAnnotatedApp/FC*.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/FC*.class \ + +#Add these when jpox support is ready: + org/apache/jdo/tck/pc/companyAnnotatedApp/PI*.class \ + org/apache/jdo/tck/pc/companyAnnotatedDS/PI*.class \ + Modified: db/jdo/trunk/tck2/project.xml URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/project.xml?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/project.xml (original) +++ db/jdo/trunk/tck2/project.xml Mon Jul 2 16:09:43 2007 @@ -69,6 +69,12 @@ http://www.jpox.org/downloads/maven-nightly + jpox + jpox-java5 + 1.2-SNAPSHOT + http://www.jpox.org/downloads/maven-nightly + + org.apache.derby derby 10.2.1.6 Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-1Relationships.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-1Relationships.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-1Relationships.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-1Relationships.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with 1-1 relationships, annotations. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMFieldClass +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-1Relationships.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-MRelationships.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-MRelationships.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-MRelationships.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyFCAnnotated1-MRelationships.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with 1-M relationships, annotations. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMFieldClass +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-MRelationships.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotatedAllRelationships.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyFCAnnotatedAllRelationships.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyFCAnnotatedAllRelationships.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyFCAnnotatedAllRelationships.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with all relationships \ +and embedded objects, annotations. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMFieldClass +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotatedEmbedded.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyFCAnnotatedEmbedded.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyFCAnnotatedEmbedded.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyFCAnnotatedEmbedded.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships \ +and embedded objects, annotations. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMFieldClass +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotatedM-MRelationships.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyFCAnnotatedM-MRelationships.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyFCAnnotatedM-MRelationships.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyFCAnnotatedM-MRelationships.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMFieldClass +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Added: db/jdo/trunk/tck2/src/conf/companyFCAnnotatedNoRelationships.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyFCAnnotatedNoRelationships.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyFCAnnotatedNoRelationships.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyFCAnnotatedNoRelationships.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMFieldClass +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Added: db/jdo/trunk/tck2/src/conf/companyPIAnnotatedNoRelationships.conf URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/companyPIAnnotatedNoRelationships.conf?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/companyPIAnnotatedNoRelationships.conf (added) +++ db/jdo/trunk/tck2/src/conf/companyPIAnnotatedNoRelationships.conf Mon Jul 2 16:09:43 2007 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. +jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedPMInterface +jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest +jdo.tck.testdata = org/apache/jdo/tck/pc/companyAnnotated/companyNoRelationships.xml +jdo.tck.mapping = 0 +jdo.tck.requiredOptions = Modified: db/jdo/trunk/tck2/src/conf/configurations.list URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/conf/configurations.list?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/src/conf/configurations.list (original) +++ db/jdo/trunk/tck2/src/conf/configurations.list Mon Jul 2 16:09:43 2007 @@ -38,6 +38,12 @@ companyListWithoutJoin.conf \ companyPMClass.conf \ companyPMInterface.conf \ + companyFCAnnotatedNoRelationships.conf \ + companyFCAnnotated1-1Relationships.conf \ + companyFCAnnotated1-MRelationships.conf \ + companyFCAnnotatedM-MRelationships.conf \ + companyFCAnnotatedAllRelationships.conf \ + companyPIAnnotatedNoRelationships.conf \ inheritance1.conf \ inheritance2.conf \ inheritance3.conf \ Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java (original) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java Mon Jul 2 16:09:43 2007 @@ -43,17 +43,26 @@ public CompanyFactoryAbstractImpl(PersistenceManager pm) { this.pm = pm; } - - abstract IAddress newAddress(); - abstract ICompany newCompany(); - abstract IDentalInsurance newDentalInsurance(); - abstract IDepartment newDepartment(); - abstract IFullTimeEmployee newFullTimeEmployee(); - abstract IMedicalInsurance newMedicalInsurance(); - abstract IPartTimeEmployee newPartTimeEmployee(); - abstract IProject newProject(); + + /** + * String indicating the type of identity used for the current test case. + * The value is either "applicationidentity" or "datastoreidentity". + */ + protected final String identitytype = + System.getProperty("jdo.tck.identitytype"); + boolean isAppIdentity = "applicationidentity".equals(identitytype); + + abstract public IAddress newAddress(); + abstract public ICompany newCompany(); + abstract public IDentalInsurance newDentalInsurance(); + abstract public IDepartment newDepartment(); + abstract public IFullTimeEmployee newFullTimeEmployee(); + abstract public IMedicalInsurance newMedicalInsurance(); + abstract public IPartTimeEmployee newPartTimeEmployee(); + abstract public IProject newProject(); - public IAddress newAddress(long addrid, String street, String city, String state, String zipcode, String country) { + public IAddress newAddress(long addrid, String street, String city, + String state, String zipcode, String country) { IAddress result = newAddress(); if (debug) logger.debug("newAddress returned" + result); result.setAddrid(addrid); @@ -65,7 +74,8 @@ return result; } - public ICompany newCompany(long companyid, String name, java.util.Date founded) { + public ICompany newCompany(long companyid, String name, + java.util.Date founded) { ICompany result = newCompany(); if (debug) logger.debug("newCompany returned" + result); result.setCompanyid(companyid); @@ -74,7 +84,8 @@ return result; } - public ICompany newCompany(long companyid, String name, java.util.Date founded, IAddress addr) { + public ICompany newCompany(long companyid, String name, + java.util.Date founded, IAddress addr) { ICompany result = newCompany(); if (debug) logger.debug("newCompany returned" + result); result.setCompanyid(companyid); @@ -84,7 +95,8 @@ return result; } - public IDentalInsurance newDentalInsurance(long insid, String carrier, java.math.BigDecimal lifetimeOrthoBenefit) { + public IDentalInsurance newDentalInsurance(long insid, String carrier, + java.math.BigDecimal lifetimeOrthoBenefit) { IDentalInsurance result = newDentalInsurance(); if (debug) logger.debug("newDentalInsurance returned" + result); result.setInsid(insid); @@ -93,7 +105,8 @@ return result; } - public IDentalInsurance newDentalInsurance(long insid, String carrier, IEmployee employee, java.math.BigDecimal lifetimeOrthoBenefit) { + public IDentalInsurance newDentalInsurance(long insid, String carrier, + IEmployee employee, java.math.BigDecimal lifetimeOrthoBenefit) { IDentalInsurance result = newDentalInsurance(); if (debug) logger.debug("newDentalInsurance returned" + result); result.setInsid(insid); @@ -111,7 +124,8 @@ return result; } - public IDepartment newDepartment(long deptid, String name, ICompany company) { + public IDepartment newDepartment(long deptid, String name, + ICompany company) { IDepartment result = newDepartment(); if (debug) logger.debug("newDepartment returned" + result); result.setDeptid(deptid); @@ -120,7 +134,8 @@ return result; } - public IDepartment newDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { + public IDepartment newDepartment(long deptid, String name, ICompany company, + IEmployee employeeOfTheMonth) { IDepartment result = newDepartment(); if (debug) logger.debug("newDepartment returned" + result); result.setDeptid(deptid); @@ -130,7 +145,9 @@ return result; } - public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double sal) { + public IFullTimeEmployee newFullTimeEmployee(long personid, String first, + String last, String middle, java.util.Date born, + java.util.Date hired, double sal) { IFullTimeEmployee result = newFullTimeEmployee(); if (debug) logger.debug("newFullTimeEmployee returned" + result); result.setPersonid(personid); @@ -143,7 +160,9 @@ return result; } - public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double sal) { + public IFullTimeEmployee newFullTimeEmployee(long personid, String first, + String last, String middle, java.util.Date born, IAddress addr, + java.util.Date hired, double sal) { IFullTimeEmployee result = newFullTimeEmployee(); if (debug) logger.debug("newFullTimeEmployee returned" + result); result.setPersonid(personid); @@ -157,7 +176,8 @@ return result; } - public IMedicalInsurance newMedicalInsurance(long insid, String carrier, String planType) { + public IMedicalInsurance newMedicalInsurance(long insid, String carrier, + String planType) { IMedicalInsurance result = newMedicalInsurance(); if (debug) logger.debug("newMedicalInsurance returned" + result); result.setInsid(insid); @@ -166,7 +186,8 @@ return result; } - public IMedicalInsurance newMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { + public IMedicalInsurance newMedicalInsurance(long insid, String carrier, + IEmployee employee, String planType) { IMedicalInsurance result = newMedicalInsurance(); if (debug) logger.debug("newMedicalInsurance returned" + result); result.setInsid(insid); @@ -176,7 +197,9 @@ return result; } - public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double wage) { + public IPartTimeEmployee newPartTimeEmployee(long personid, String first, + String last, String middle, java.util.Date born, + java.util.Date hired, double wage) { IPartTimeEmployee result = newPartTimeEmployee(); if (debug) logger.debug("newPartTimeEmployee returned" + result); result.setPersonid(personid); @@ -189,7 +212,9 @@ return result; } - public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double wage) { + public IPartTimeEmployee newPartTimeEmployee(long personid, String first, + String last, String middle, java.util.Date born, IAddress addr, + java.util.Date hired, double wage) { IPartTimeEmployee result = newPartTimeEmployee(); if (debug) logger.debug("newPartTimeEmployee returned" + result); result.setPersonid(personid); @@ -203,13 +228,13 @@ return result; } - public IProject newProject(long projid, String name, java.math.BigDecimal budget) { + public IProject newProject(long projid, String name, + java.math.BigDecimal budget) { IProject result = newProject(); if (debug) logger.debug("newProject returned" + result); result.setProjid(projid); result.setName(name); result.setBudget(budget); return result; - } - + } } Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMFieldClass.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMFieldClass.java?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMFieldClass.java (added) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMFieldClass.java Mon Jul 2 16:09:43 2007 @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.pc.company; + +import javax.jdo.PersistenceManager; + +/* + * CompanyFactoryAnnotatedPMFieldClass.java + * + * This class uses the PersistenceManager.newInstance method with the concrete + * class as a parameter. + */ +public class CompanyFactoryAnnotatedPMFieldClass + extends org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl { + + Class addressClass = null; + Class dentalInsuranceClass = null; + Class medicalInsuranceClass = null; + Class partTimeEmployeeClass = null; + Class fullTimeEmployeeClass = null; + Class projectClass = null; + Class departmentClass = null; + Class companyClass = null; + + /** + * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass + */ + public CompanyFactoryAnnotatedPMFieldClass(PersistenceManager pm) { + super(pm); + if (isAppIdentity){ + addressClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCAddress.class; + dentalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCDentalInsurance.class; + medicalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCMedicalInsurance.class; + partTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCPartTimeEmployee.class; + fullTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCFullTimeEmployee.class; + projectClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCProject.class; + departmentClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCDepartment.class; + companyClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.FCCompany.class; + } else { //datastoreidentity + addressClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCAddress.class; + dentalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCDentalInsurance.class; + medicalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCMedicalInsurance.class; + partTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCPartTimeEmployee.class; + fullTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCFullTimeEmployee.class; + projectClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCProject.class; + departmentClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCDepartment.class; + companyClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.FCCompany.class; + } + + } + + public Class[] getTearDownClasses() { + return new Class[] { + dentalInsuranceClass, + medicalInsuranceClass, + partTimeEmployeeClass, + fullTimeEmployeeClass, + projectClass, + departmentClass, + companyClass + }; + } + + public IAddress newAddress() { + return (IAddress)pm.newInstance(addressClass); + } + + public ICompany newCompany() { + return (ICompany)pm.newInstance(companyClass); + } + + public IDentalInsurance newDentalInsurance() { + return (IDentalInsurance)pm.newInstance(dentalInsuranceClass); + } + + public IDepartment newDepartment() { + return (IDepartment)pm.newInstance(departmentClass); + } + + public IFullTimeEmployee newFullTimeEmployee() { + return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass); + } + + public IMedicalInsurance newMedicalInsurance() { + return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass); + } + + public IPartTimeEmployee newPartTimeEmployee() { + return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass); + } + + public IProject newProject() { + return (IProject)pm.newInstance(projectClass); + } +} Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMFieldClass.java ------------------------------------------------------------------------------ svn:eol-style = LF Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMInterface.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMInterface.java?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMInterface.java (added) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMInterface.java Mon Jul 2 16:09:43 2007 @@ -0,0 +1,127 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.pc.company; + +import javax.jdo.PersistenceManager; + +/* + * CompanyFactoryAnnotatedPMInterface.java + * + */ +public class CompanyFactoryAnnotatedPMInterface + extends CompanyFactoryAbstractImpl { + + Class addressClass = null; + Class dentalInsuranceClass = null; + Class medicalInsuranceClass = null; + Class partTimeEmployeeClass = null; + Class fullTimeEmployeeClass = null; + Class projectClass = null; + Class departmentClass = null; + Class companyClass = null; + + /** */ + public final Class[] tearDownClasses = new Class[] { + dentalInsuranceClass, + medicalInsuranceClass, + partTimeEmployeeClass, + fullTimeEmployeeClass, + projectClass, + departmentClass, + companyClass + }; + + /** + * Creates a new instance of CompanyFactoryAnnotatedPMInterface + */ + public CompanyFactoryAnnotatedPMInterface(PersistenceManager pm) { + super(pm); + + if (isAppIdentity){ + addressClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIAddress.class; + dentalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIDentalInsurance.class; + medicalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIMedicalInsurance.class; + partTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIPartTimeEmployee.class; + fullTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIFullTimeEmployee.class; + projectClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIProject.class; + departmentClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PIDepartment.class; + companyClass = + org.apache.jdo.tck.pc.companyAnnotatedApp.PICompany.class; + } else { //datastoreidentity + addressClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIAddress.class; + dentalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIDentalInsurance.class; + medicalInsuranceClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIMedicalInsurance.class; + partTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIPartTimeEmployee.class; + fullTimeEmployeeClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIFullTimeEmployee.class; + projectClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIProject.class; + departmentClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PIDepartment.class; + companyClass = + org.apache.jdo.tck.pc.companyAnnotatedDS.PICompany.class; + } + } + + public IAddress newAddress() { + return (IAddress)pm.newInstance(addressClass); + } + + public ICompany newCompany() { + return (ICompany)pm.newInstance(companyClass); + } + + public IDentalInsurance newDentalInsurance() { + return (IDentalInsurance)pm.newInstance(dentalInsuranceClass); + } + + public IDepartment newDepartment() { + return (IDepartment)pm.newInstance(departmentClass); + } + + public IFullTimeEmployee newFullTimeEmployee() { + return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass); + } + + public IMedicalInsurance newMedicalInsurance() { + return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass); + } + + public IPartTimeEmployee newPartTimeEmployee() { + return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass); + } + + public IProject newProject() { + return (IProject)pm.newInstance(projectClass); + } + + public Class[] getTearDownClasses() { + return tearDownClasses; + } +} Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedPMInterface.java ------------------------------------------------------------------------------ svn:eol-style = LF Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMClass.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMClass.java?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMClass.java (original) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMClass.java Mon Jul 2 16:09:43 2007 @@ -42,35 +42,35 @@ super(pm); } - IAddress newAddress() { + public IAddress newAddress() { return (IAddress)pm.newInstance(Address.class); } - ICompany newCompany() { + public ICompany newCompany() { return (ICompany)pm.newInstance(Company.class); } - IDentalInsurance newDentalInsurance() { + public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(DentalInsurance.class); } - IDepartment newDepartment() { + public IDepartment newDepartment() { return (IDepartment)pm.newInstance(Department.class); } - IFullTimeEmployee newFullTimeEmployee() { + public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(FullTimeEmployee.class); } - IMedicalInsurance newMedicalInsurance() { + public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(MedicalInsurance.class); } - IPartTimeEmployee newPartTimeEmployee() { + public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PartTimeEmployee.class); } - IProject newProject() { + public IProject newProject() { return (IProject)pm.newInstance(Project.class); } Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java (original) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java Mon Jul 2 16:09:43 2007 @@ -42,35 +42,35 @@ super(pm); } - IAddress newAddress() { + public IAddress newAddress() { return (IAddress)pm.newInstance(IAddress.class); } - ICompany newCompany() { + public ICompany newCompany() { return (ICompany)pm.newInstance(ICompany.class); } - IDentalInsurance newDentalInsurance() { + public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(IDentalInsurance.class); } - IDepartment newDepartment() { + public IDepartment newDepartment() { return (IDepartment)pm.newInstance(IDepartment.class); } - IFullTimeEmployee newFullTimeEmployee() { + public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(IFullTimeEmployee.class); } - IMedicalInsurance newMedicalInsurance() { + public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(IMedicalInsurance.class); } - IPartTimeEmployee newPartTimeEmployee() { + public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(IPartTimeEmployee.class); } - IProject newProject() { + public IProject newProject() { return (IProject)pm.newInstance(IProject.class); } Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java?view=diff&rev=552622&r1=552621&r2=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java (original) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java Mon Jul 2 16:09:43 2007 @@ -102,6 +102,24 @@ addSingleton(BEAN_FACTORY_NAME, companyFactory); } + /** + * @return Returns the tearDownClasses. + */ + public Class[] getTearDownClassesFromFactory() { + return companyFactory.getTearDownClasses(); + } + + /** + * @return Returns the tearDownClasses. + */ + public static Class[] getTearDownClasses() { + return CompanyFactoryConcreteClass.tearDownClasses; + } + + public static Date stringToUtilDate(String value) { + return ConversionHelper.toUtilDate(DATE_PATTERN, "America/New_York", Locale.US, value); + } + // Convenience methods /** @@ -236,22 +254,5 @@ return (Project)getBean(name, Project.class); } - /** - * @return Returns the tearDownClasses. - */ - public Class[] getTearDownClassesFromFactory() { - return companyFactory.getTearDownClasses(); - } - - /** - * @return Returns the tearDownClasses. - */ - public static Class[] getTearDownClasses() { - return CompanyFactoryConcreteClass.tearDownClasses; - } - - public static Date stringToUtilDate(String value) { - return ConversionHelper.toUtilDate(DATE_PATTERN, "America/New_York", Locale.US, value); - } } Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java (added) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java Mon Jul 2 16:09:43 2007 @@ -0,0 +1,344 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.pc.companyAnnotatedApp; + +import java.io.Serializable; +import java.util.Comparator; + +import javax.jdo.annotations.*; + +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.util.DeepEquality; +import org.apache.jdo.tck.util.EqualityHelper; + +/** + * This class represents a postal address. + */ +@PersistenceCapable(embeddedOnly="true", requiresExtent="false") +@Implements ("org.apache.jdo.tck.pc.company.IAddress") +public class FCAddress + implements IAddress, Serializable, Comparable, Comparator, DeepEquality { + + private long addrid; + private String street; + private String city; + private String state; + private String zipcode; + private String country; + + /** This is the JDO-required no-args constructor. The TCK relies on + * this constructor for testing PersistenceManager.newInstance(PCClass). + */ + public FCAddress() {} + + /** + * This constructor initializes the FCAddress components. + * @param addrid The address ID. + * @param street The street address. + * @param city The city. + * @param state The state. + * @param zipcode The zip code. + * @param country The zip country. + */ + public FCAddress(long addrid, String street, String city, + String state, String zipcode, String country) + { + this.addrid = addrid; + this.street = street; + this.city = city; + this.state = state; + this.zipcode = zipcode; + this.country = country; + } + + /** + * Get the addrid associated with this object. + * @return the addrid. + */ + public long getAddrid() { + return addrid; + } + + /** + * Set the id associated with this object. + * @param id the id. + */ + public void setAddrid(long id) { + if (this.addrid != 0) + throw new IllegalStateException("Id is already set."); + this.addrid = id; + } + + /** + * Get the street component of the address. + * @return The street component of the address. + */ + public String getStreet() { + return street; + } + + /** + * Set the street component of the address. + * @param street The street component. + */ + public void setStreet(String street) { + this.street = street; + } + + /** + * Get the city. + * @return The city component of the address. + */ + public String getCity() { + return city; + } + + /** + * Set the city component of the address. + * @param city The city. + */ + public void setCity(String city) { + this.city = city; + } + + /** + * Get the state component of the address. + * @return The state. + */ + public String getState() { + return state; + } + + /** + * Set the state component of the address. + * @param state The state. + */ + public void setState(String state) { + this.state = state; + } + + /** + * Get the zipcode component of the address. + * @return The zipcode. + */ + public String getZipcode() { + return zipcode; + } + + /** + * Set the zip code component of the address. + * @param zipcode The zipcode. + */ + public void setZipcode(String zipcode) { + this.zipcode = zipcode; + } + + /** + * Get the country component of the address. + * @return The country. + */ + public String getCountry() { + return country; + } + + /** + * Set the country component of the address. + * @param country The country. + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * Returns a String representation of a Address object. + * @return a String representation of a Address object. + */ + public String toString() { + return "Address(" + getFieldRepr() + ")"; + } + + /** + * Returns a String representation of the non-relationship fields. + * @return a String representation of the non-relationship fields. + */ + protected String getFieldRepr() { + StringBuffer rc = new StringBuffer(); + rc.append(addrid); + rc.append(", street ").append(street); + rc.append(", city ").append(city); + rc.append(", state ").append(state); + rc.append(", zipcode ").append(zipcode); + rc.append(", country ").append(country); + return rc.toString(); + } + + /** + * Returns true if all the fields of this instance are + * deep equal to the coresponding fields of the specified Person. + * @param other the object with which to compare. + * @param helper EqualityHelper to keep track of instances that have + * already been processed. + * @return true if all the fields are deep equal; + * false otherwise. + * @throws ClassCastException if the specified instances' type prevents + * it from being compared to this instance. + */ + public boolean deepCompareFields(Object other, + EqualityHelper helper) { + IAddress otherAddress = (IAddress)other; + String where = "Address<" + addrid + ">"; + return + helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & + helper.equals(street, otherAddress.getStreet(), where + ".street") & + helper.equals(city, otherAddress.getCity(), where + ".city") & + helper.equals(state, otherAddress.getState(), where + ".state") & + helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & + helper.equals(country, otherAddress.getCountry(), where + ".country"); + } + + /** + * Compares this object with the specified object for order. Returns a + * negative integer, zero, or a positive integer as this object is less + * than, equal to, or greater than the specified object. + * @param o The Object to be compared. + * @return a negative integer, zero, or a positive integer as this + * object is less than, equal to, or greater than the specified object. + * @throws ClassCastException - if the specified object's type prevents + * it from being compared to this Object. + */ + public int compareTo(Object o) { + return compareTo((IAddress)o); + } + + /** + * Compare two instances. This is a method in Comparator. + */ + public int compare(Object o1, Object o2) { + return compare((IAddress)o1, (IAddress)o2); + } + + /** + * Compares this object with the specified Address object for + * order. Returns a negative integer, zero, or a positive integer as + * this object is less than, equal to, or greater than the specified + * object. + * @param other The Address object to be compared. + * @return a negative integer, zero, or a positive integer as this + * object is less than, equal to, or greater than the specified Address + * object. + */ + public int compareTo(IAddress other) { + return compare(this, other); + } + + /** + * Compares its two IAddress arguments for order. Returns a negative + * integer, zero, or a positive integer as the first argument is less + * than, equal to, or greater than the second. + * @param o1 the first IAddress object to be compared. + * @param o2 the second IAddress object to be compared. + * @return a negative integer, zero, or a positive integer as the first + * object is less than, equal to, or greater than the second object. + */ + public static int compare(IAddress o1, IAddress o2) { + return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); + } + + /** + * Indicates whether some other object is "equal to" this one. + * @param obj the object with which to compare. + * @return true if this object is the same as the obj + * argument; false otherwise. + */ + public boolean equals(Object obj) { + if (obj instanceof IAddress) { + return compareTo((IAddress)obj) == 0; + } + return false; + } + + /** + * Returns a hash code value for the object. + * @return a hash code value for this object. + */ + public int hashCode() { + return (int)addrid; + } + + /** + * This class is used to represent the application identifier + * for the Address class. + */ + public static class Oid implements Serializable, Comparable { + + /** + * This is the identifier field for Address and must + * correspond in type and name to the field in + * Address. + */ + public long addrid; + + /** The required public, no-arg constructor. */ + public Oid() + { + addrid = 0; + } + + /** + * A constructor to initialize the identifier field. + * @param addrid the id of the Address. + */ + public Oid(long addrid) { + this.addrid = addrid; + } + + public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } + + public String toString() { return this.getClass().getName() + ": " + addrid;} + + + /** */ + public boolean equals(java.lang.Object obj) { + if( obj==null || !this.getClass().equals(obj.getClass()) ) + return( false ); + Oid o = (Oid) obj; + if( this.addrid != o.addrid ) return( false ); + return( true ); + } + + /** */ + public int hashCode() { + return( (int) addrid ); + } + + protected static String justTheId(String str) { + return str.substring(str.indexOf(':') + 1); + } + + /** */ + public int compareTo(Object obj) { + // may throw ClassCastException which the user must handle + Oid other = (Oid) obj; + if( addrid < other.addrid ) return -1; + if( addrid > other.addrid ) return 1; + return 0; + } + + } + +} Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCAddress.java ------------------------------------------------------------------------------ svn:eol-style = LF Added: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java?view=auto&rev=552622 ============================================================================== --- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java (added) +++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java Mon Jul 2 16:09:43 2007 @@ -0,0 +1,389 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.pc.companyAnnotatedApp; + +import javax.jdo.annotations.*; + +import java.io.Serializable; +import java.io.ObjectInputStream; +import java.io.IOException; + +import java.text.SimpleDateFormat; + +import java.util.Collections; +import java.util.Comparator; +import java.util.Set; +import java.util.HashSet; +import java.util.Date; + +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.util.DeepEquality; +import org.apache.jdo.tck.util.EqualityHelper; + +/** + * This class represents information about a company. + */ +@PersistenceCapable(identityType=IdentityType.APPLICATION) +@Implements ("org.apache.jdo.tck.pc.company.ICompany") +@Table(table="companies") +@Inheritance(strategy=InheritanceStrategy.NEW_TABLE) +@Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, + column="DISCRIMINATOR") + public class FCCompany + implements ICompany, Serializable, Comparable, Comparator, DeepEquality { + + @Field(primaryKey="true") + @Column(name="ID") + private long companyid; + @Column(name="NAME", jdbcType="VARCHAR") + private String name; + @Column(name="FOUNDEDDATE") + private Date founded; + @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT) + @Embedded(nullIndicatorColumn="COUNTRY", + fields={ + @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")), + @Field(embeddedFieldName="street", columns=@Column(name="STREET")), + @Field(embeddedFieldName="city", columns=@Column(name="CITY")), + @Field(embeddedFieldName="state", columns=@Column(name="STATE")), + @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")), + @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY")) + }) + private FCAddress address; + @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT, + mappedBy="company") + @Element(types=org.apache.jdo.tck.pc.companyAnnotatedApp.FCDepartment.class) + private transient Set departments = new HashSet(); + + protected static SimpleDateFormat formatter = + new SimpleDateFormat("d/MMM/yyyy"); + + /** This is the JDO-required no-args constructor. The TCK relies on + * this constructor for testing PersistenceManager.newInstance(PCClass). + */ + public FCCompany() {} + + /** + * Initialize the FCCompany instance. + * @param companyid The company id. + * @param name The company name. + * @param founded The date the company was founded. + */ + public FCCompany(long companyid, String name, Date founded) { + this.companyid = companyid; + this.name = name; + this.founded = founded; + } + + /** + * Initialize the Company instance. + * @param companyid The company id. + * @param name The company name. + * @param founded The date the company was founded. + * @param addr The company's address. + */ + public FCCompany(long companyid, String name, Date founded, IAddress addr) { + this(companyid, name, founded); + this.address = (FCAddress)addr; + } + + /** + * Get the company id. + * @return The company id. + */ + public long getCompanyid() { + return companyid; + } + + /** + * Set the id associated with this object. + * @param id the id. + */ + public void setCompanyid(long id) { + if (this.companyid != 0) + throw new IllegalStateException("Id is already set."); + this.companyid = id; + } + + /** + * Get the name of the company. + * @return The name of the company. + */ + public String getName() { + return name; + } + + /** + * Set the name of the company. + * @param name The value to use for the name of the company. + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the date that the company was founded. + * @return The date the company was founded. + */ + public Date getFounded() { + return founded; + } + + /** + * Set the date that the company was founded. + * @param founded The date to set that the company was founded. + */ + public void setFounded(Date founded) { + this.founded = founded; + } + + /** + * Get the address of the company. + * @return The primary address of the company. + */ + public IAddress getAddress() { + return address; + } + + /** + * Set the primary address for the company. + * @param address The address to set for the company. + */ + public void setAddress(IAddress address) { + this.address = (FCAddress)address; + } + + /** + * Get the departments contained in the company. + * @return An unmodifiable Set that contains all the + * FCDepartments of the company. + */ + public Set getDepartments() { + return Collections.unmodifiableSet(departments); + } + + /** + * Add a FCDepartment instance to the company. + * @param dept The FCDepartment instance to add. + */ + public void addDepartment(FCDepartment dept) { + departments.add(dept); + } + + /** + * Remove a FCDepartment instance from the company. + * @param dept The FCDepartment instance to remove. + */ + public void removeDepartment(FCDepartment dept) { + departments.remove(dept); + } + + /** + * Initialize the set of FCDepartments in the company to the + * parameter. + * @param departments The set of FCDepartments for the + * company. + */ + public void setDepartments(Set departments) { + // workaround: create a new HashSet, because fostore does not + // support LinkedHashSet + this.departments = + (departments != null) ? new HashSet(departments) : null; + } + + /** Serialization support: initialize transient fields. */ + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + in.defaultReadObject(); + departments = new HashSet(); + } + + /** + * Returns a String representation of a Company object. + * @return a String representation of a Company object. + */ + public String toString() { + return "Company(" + getFieldRepr()+ ")"; + } + + /** + * Returns a String representation of the non-relationship fields. + * @return a String representation of the non-relationship fields. + */ + protected String getFieldRepr() { + StringBuffer rc = new StringBuffer(); + rc.append(companyid); + rc.append(", name ").append(name); + rc.append(", founded ").append(formatter.format(founded)); + return rc.toString(); + } + + /** + * Returns true if all the fields of this instance are + * deep equal to the coresponding fields of the specified Person. + * @param other the object with which to compare. + * @param helper EqualityHelper to keep track of instances that have + * already been processed. + * @return true if all the fields are deep equal; + * false otherwise. + * @throws ClassCastException if the specified instances' type prevents + * it from being compared to this instance. + */ + public boolean deepCompareFields(Object other, + EqualityHelper helper) { + ICompany otherCompany = (ICompany)other; + String where = "Company<" + companyid + ">"; + return + helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & + helper.equals(name, otherCompany.getName(), where + ".name") & + helper.equals(founded, otherCompany.getFounded(), where + ".founded") & + helper.deepEquals(address, otherCompany.getAddress(), where + ".address") & + helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); + } + + /** + * Compares this object with the specified object for order. Returns a + * negative integer, zero, or a positive integer as this object is less + * than, equal to, or greater than the specified object. + * @param o The Object to be compared. + * @return a negative integer, zero, or a positive integer as this + * object is less than, equal to, or greater than the specified object. + * @throws ClassCastException - if the specified object's type prevents + * it from being compared to this Object. + */ + public int compareTo(Object o) { + return compareTo((ICompany)o); + } + + /** + * Compare two instances. This is a method in Comparator. + */ + public int compare(Object o1, Object o2) { + return compare((ICompany)o1, (ICompany)o2); + } + + /** + * Compares this object with the specified Company object for + * order. Returns a negative integer, zero, or a positive integer as + * this object is less than, equal to, or greater than the specified + * object. + * @param other The Company object to be compared. + * @return a negative integer, zero, or a positive integer as this + * object is less than, equal to, or greater than the specified Company + * object. + */ + public int compareTo(ICompany other) { + return compare(this, other); + } + + /** + * Compares its two ICompany arguments for order. Returns a negative + * integer, zero, or a positive integer as the first argument is less + * than, equal to, or greater than the second. + * @param o1 the first ICompany object to be compared. + * @param o2 the second ICompany object to be compared. + * @return a negative integer, zero, or a positive integer as the first + * object is less than, equal to, or greater than the second object. + */ + public static int compare(ICompany o1, ICompany o2) { + return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); + } + + /** + * Indicates whether some other object is "equal to" this one. + * @param obj the object with which to compare. + * @return true if this object is the same as the obj + * argument; false otherwise. + */ + public boolean equals(Object obj) { + if (obj instanceof ICompany) { + return compareTo((ICompany)obj) == 0; + } + return false; + } + + /** + * Returns a hash code value for the object. + * @return a hash code value for this object. + */ + public int hashCode() { + return (int)companyid; + } + + /** + * The class to be used as the application identifier + * for the Company class. It consists of both the company + * name and the date that the company was founded. + */ + public static class Oid implements Serializable, Comparable { + + /** + * This field is part of the identifier and should match in name + * and type with a field in the Company class. + */ + public long companyid; + + /** The required public no-arg constructor. */ + public Oid() { } + + /** + * Initialize the identifier. + * @param companyid The id of the company. + */ + public Oid(long companyid) { + this.companyid = companyid; + } + + public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } + + public String toString() { return this.getClass().getName() + ": " + companyid;} + + + /** */ + public boolean equals(Object obj) { + if (obj==null || !this.getClass().equals(obj.getClass())) + return false; + Oid o = (Oid) obj; + if (this.companyid != o.companyid) + return false; + return true; + } + + /** */ + public int hashCode() { + return (int)companyid; + } + + protected static String justTheId(String str) { + return str.substring(str.indexOf(':') + 1); + } + + /** */ + public int compareTo(Object obj) { + // may throw ClassCastException which the user must handle + Oid other = (Oid) obj; + if( companyid < other.companyid ) return -1; + if( companyid > other.companyid ) return 1; + return 0; + } + + } + +} + Propchange: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java ------------------------------------------------------------------------------ svn:eol-style = LF