Added: incubator/jdo/trunk/ri11/test/conf/jndi.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/conf/jndi.properties?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/conf/jndi.properties (added)
+++ incubator/jdo/trunk/ri11/test/conf/jndi.properties Fri Mar 18 17:02:29 2005
@@ -0,0 +1,17 @@
+#
+# 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.
+
+java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
+java.naming.provider.url=file:.
Added: incubator/jdo/trunk/ri11/test/conf/logging.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/conf/logging.properties?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/conf/logging.properties (added)
+++ incubator/jdo/trunk/ri11/test/conf/logging.properties Fri Mar 18 17:02:29 2005
@@ -0,0 +1,68 @@
+#
+# 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.
+
+#
+# This is a sample properties file to configure standard JDK 1.4 logging for
+# the JDO RI sources and test cases. Below you find an entry for each of the
+# JDO RI source and test logger instances. Please uncomment the line and adapt
+# the log level to your needs, in case to want to enable a particular logger.
+#
+# The following describes the mapping between the log level of JDK 1.4 logging
+# and apache commns logging:
+# JDK 1.4 Apache
+# FINEST trace
+# FINE, FINER debug
+# INFO, CONFIG info
+# WARNING warn
+# SEVERE error, fatal
+#
+
+######################
+# JDORI test cases
+######################
+
+#org.apache.jdo.test.level = FINE
+
+######################
+# JDORI sources
+######################
+
+# FOStore logger
+#org.apache.jdo.impl.fostore.level = FINE
+# JDOQL query logger
+#org.apache.jdo.impl.jdoql.level = FINE
+# JDOQL query compiler logger
+#org.apache.jdo.impl.jdoql.jdoqlc.level = FINE
+# JDOModel logger
+#org.apache.jdo.impl.model.jdo.level = FINE
+# XML parser logger
+#org.apache.jdo.impl.model.jdo.xml.level = FINE
+# PM and PMF logger
+#org.apache.jdo.impl.pm.level = FINE
+# SCO logger
+#org.apache.jdo.impl.sco.level = FINE
+# StateManager logger
+#org.apache.jdo.impl.state.level = FINE
+# Generic StoreManager logger
+#org.apache.jdo.store.level = FINE
+# Utility class logger
+#org.apache.jdo.util.level = FINE
+
+######################
+# JDK 1.4 logging properties
+######################
+
+handlers = java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level = FINEST
Added: incubator/jdo/trunk/ri11/test/conf/simplelog.properties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/conf/simplelog.properties?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/conf/simplelog.properties (added)
+++ incubator/jdo/trunk/ri11/test/conf/simplelog.properties Fri Mar 18 17:02:29 2005
@@ -0,0 +1,59 @@
+#
+# 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.
+
+#
+# This is a sample properties file to configure apache commons logging SimpleLog
+# implementation for the JDO RI sources and test cases. Below you find an entry
+# for each of the JDO RI source and test logger instances. Please uncomment the
+# line and adapt the log level to your needs, in case to want to enable
+# a particular logger.
+#
+
+######################
+# JDORI test cases
+######################
+
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.test = debug
+
+######################
+# JDORI sources
+######################
+
+# FOStore logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.fostore = debug
+# JDOQL query logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.jdoql = debug
+# JDOQL query compiler logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.jdoql.jdoqlc = debug
+# JDOModel logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo = debug
+# XML parser logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo.xml = debug
+# PM and PMF logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.pm = debug
+# SCO logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.sco = debug
+# StateManager logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.state = debug
+# Generic StoreManager logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.store = debug
+# Utility class logger
+#org.apache.commons.logging.simplelog.log.org.apache.jdo.util = debug
+
+######################
+# default logging level
+######################
+
+org.apache.commons.logging.simplelog.defaultlog = error
Added: incubator/jdo/trunk/ri11/test/conf/tests.list
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/conf/tests.list?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/conf/tests.list (added)
+++ incubator/jdo/trunk/ri11/test/conf/tests.list Fri Mar 18 17:02:29 2005
@@ -0,0 +1,97 @@
+#
+# Note the following tests should not be added to the list,
+# because they need to be run separately
+# (see target test.all in build.xml):
+#
+# - org.apache.jdo.test.Test_FetchInserted:
+# needs an existing datastore, created by a run in a separate JVM
+# - JNDI test and JNDICF test:
+# needs an existing datastore, created by a run in a separate JVM
+# - org.apache.jdo.test.Test_GetObjectById2
+# - NonExistent
+# - EmpDeptAppIdExt:
+# starts the EmpDeptAppId tests insert, update, delete in separate JVMs
+# implemented by Test_EmpDeptAppIdInsert, Test_EmpDeptAppIdUpadte, and
+# Test_EmpDeptAppIdDelete
+# - Generator
+# - Enhancer
+
+#fostore/Test_Dumper Test_Rect
+
+org.apache.jdo.test.Test_JDOModel
+org.apache.jdo.impl.fostore.Test_Transcriber
+org.apache.jdo.impl.fostore.Test_FSUID
+org.apache.jdo.test.Test_ActivateClass
+org.apache.jdo.test.Test_Insert
+org.apache.jdo.test.Test_Many
+org.apache.jdo.test.Test_RollbackFlushedNew
+org.apache.jdo.test.Test_Fetch
+org.apache.jdo.test.Test_Fetch2
+org.apache.jdo.test.Test_Arrays
+org.apache.jdo.test.Test_RefArrays
+org.apache.jdo.test.Test_Interfaces
+org.apache.jdo.test.Test_Rect
+org.apache.jdo.test.Test_Primitives
+org.apache.jdo.test.Test_Stroke
+org.apache.jdo.test.Test_Cycle
+org.apache.jdo.test.Test_SCO
+org.apache.jdo.test.Test_Collections
+org.apache.jdo.test.Test_SCORollback
+org.apache.jdo.test.Test_SCOArrayList
+org.apache.jdo.test.Test_SCOArrayListOptimistic
+org.apache.jdo.test.Test_SCODate
+org.apache.jdo.test.Test_SCOHashMap
+org.apache.jdo.test.Test_SCOHashSet
+org.apache.jdo.test.Test_SCOHashtable
+org.apache.jdo.test.Test_SCOLinkedList
+org.apache.jdo.test.Test_SCOSqlDate
+org.apache.jdo.test.Test_SCOTreeMap
+org.apache.jdo.test.Test_SCOTreeSet
+org.apache.jdo.test.Test_SCOVector
+org.apache.jdo.test.Test_GetObjectById
+org.apache.jdo.test.Test_SerialPMs
+org.apache.jdo.test.Test_ParallelPMs
+org.apache.jdo.test.Test_Delete
+org.apache.jdo.test.Test_RectAppId
+org.apache.jdo.test.Test_EmpDeptAppId
+org.apache.jdo.test.Test_Extent
+org.apache.jdo.test.Test_EmpDeptSerialization
+org.apache.jdo.test.Test_HollowUpdate
+org.apache.jdo.test.Test_Reachability
+org.apache.jdo.test.Test_EmpDept
+org.apache.jdo.test.Test_Navigate
+org.apache.jdo.test.Test_LargeObj
+org.apache.jdo.test.Test_Update
+org.apache.jdo.test.Test_Rollback
+org.apache.jdo.test.Test_Serialize
+org.apache.jdo.test.Test_SerializeInher
+org.apache.jdo.test.Test_SerializeComplex
+org.apache.jdo.test.Test_NonTxAccess
+org.apache.jdo.test.Test_Insert2
+org.apache.jdo.test.Test_ObjectId
+org.apache.jdo.test.Test_Container
+org.apache.jdo.test.Test_Inheritance
+org.apache.jdo.test.Test_StringOID
+org.apache.jdo.test.Test_Optimistic
+org.apache.jdo.test.Test_FSUID2
+org.apache.jdo.test.Test_LifeCycle
+org.apache.jdo.test.Test_LifeCycle_RetF
+org.apache.jdo.test.Test_LifeCycle_Opt
+org.apache.jdo.test.Test_LifeCycle_RetFOpt
+org.apache.jdo.test.Test_NegAll
+org.apache.jdo.test.Test_PMFProperties
+org.apache.jdo.test.Test_Query
+org.apache.jdo.test.Test_4510817
+org.apache.jdo.test.Test_4515265
+org.apache.jdo.test.Test_WeakHashSet
+org.apache.jdo.test.Test_WeakValueHashMap
+org.apache.jdo.test.Test_AppId
+org.apache.jdo.test.Test_DupAppId
+org.apache.jdo.test.Test_PCDerived
+org.apache.jdo.test.Test_ClosePMF
+org.apache.jdo.test.Test_KeyFieldNull
+org.apache.jdo.test.Test_UserHashCode
+org.apache.jdo.test.Test_OptimisticNullNotNull
+org.apache.jdo.test.Test_Freezer
+org.apache.jdo.test.Test_ClassRegistration
+org.apache.jdo.test.Test_6214617
Added: incubator/jdo/trunk/ri11/test/enhancer/common.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/common.xml?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/common.xml (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/common.xml Fri Mar 18 17:02:29 2005
@@ -0,0 +1,255 @@
+<!--
+ 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.
+-->
+
+ <!-- libs -->
+ <property name="jdo" value="../../../src/jdo.jar"/>
+ <property name="jdo-enhancer" value="../../../src/jdo-enhancer.jar"/>
+ <property name="logging" value="../../../release/lib/ext/commons-logging.jar"/>
+ <property name="xerces" value="../../../release/lib/ext/xerces.jar"/>
+
+ <!-- subdirectories -->
+ <property name="src" value="src"/>
+ <property name="cls" value="cls"/>
+ <property name="gen" value="gen"/>
+ <property name="enh" value="enh"/>
+
+ <!-- subdirectories -->
+ <property name="debug" value="on"/>
+
+ <!-- classpath -->
+ <path id="tools.class.path">
+ <pathelement location="${jdo}"/>
+ <pathelement location="${jdo-enhancer}"/>
+ <pathelement location="${logging}"/>
+ <pathelement location="${xerces}"/>
+ </path>
+
+ <target name="clean">
+ <delete dir="${cls}"/>
+ <delete dir="${gen}"/>
+ <delete dir="${enh}"/>
+ </target>
+
+ <target name="mrproper" depends="clean">
+ <delete>
+ <fileset dir="." defaultexcludes="no">
+ <include name="**/*.*~"/>
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="init_compile_common">
+ <mkdir dir="${cls}"/>
+ </target>
+
+ <target name="init_enhance_common">
+ <!-- <delete dir="${enh}"/> -->
+ <mkdir dir="${enh}"/>
+ </target>
+
+ <target name="init_generate_common">
+ <delete dir="${gen}"/>
+ <!-- <mkdir dir="${gen}"/> -->
+ </target>
+
+ <target name="compile_common" depends="init_compile_common">
+ <javac srcdir="${src}" destdir="${cls}" debug="${debug}"
+ classpathref="tools.class.path"/>
+ </target>
+
+ <target name="generate_common" depends="init_generate_common">
+ <java classname="org.apache.jdo.impl.enhancer.generator.Main"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="-d ${gen} --properties ${jdoproperties}"/>
+ </java>
+
+ <javac srcdir="${gen}" destdir="${gen}" debug="${debug}"
+ classpathref="tools.class.path"/>
+ </target>
+
+ <target name="enhance_common" depends="compile_common,init_enhance_common,arg.verbose">
+ <java classname="org.apache.jdo.enhancer.EnhancerMain"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-f -d ${enh}"/>
+<!-- disable calling the enhancer with jdopropeties for now
+ <arg line="- -properties ${jdoproperties}"/>
+-->
+ <arg line="-j"/>
+ <arg path="${src}:${cls}:${jdo}"/>
+ <arg line="-s"/>
+ <arg path="${cls}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="enh0_common" depends="compile_common,init_enhance_common,arg.verbose">
+ <java classname="org.apache.jdo.enhancer.Main"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-f -d ${enh}"/>
+<!-- disable calling the enhancer with jdopropeties for now
+ <arg line="- -properties ${jdoproperties}"/>
+-->
+ <arg line="-s ${cls}:${jdo}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="enh1_common" depends="compile_common,init_enhance_common,arg.verbose">
+ <java classname="org.apache.jdo.enhancer.Main"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-f -s ${src} -d ${enh} ${classes0}"/>
+ </java>
+ </target>
+
+ <target name="javap_src_common" depends="compile_common">
+ <exec executable="javap" dir="." output="${cls}/${outjavap}"
+ failonerror="yes">
+ <arg line="-classpath"/>
+ <arg path="${cls}:${jdo}"/>
+ <arg line="-c -private"/>
+ <arg line="${classes1}"/>
+ </exec>
+ </target>
+
+ <target name="javap_gen_common">
+ <exec executable="javap" dir="." output="${gen}/${outjavap}"
+ failonerror="yes">
+ <arg line="-classpath"/>
+ <arg path="${gen}:${jdo}"/>
+ <arg line="-c -private"/>
+ <arg line="${classes1}"/>
+ </exec>
+ </target>
+
+ <target name="javap_enh_common">
+ <exec executable="javap" dir="." output="${enh}/${outjavap}"
+ failonerror="yes">
+ <arg line="-classpath"/>
+ <arg path="${enh}:${jdo}"/>
+ <arg line="-c -private"/>
+ <arg line="${classes1}"/>
+ </exec>
+ </target>
+
+ <target name="dis_gen_common" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.Disassembler"
+ fork="yes" classpathref="tools.class.path" failonerror="yes"
+ output="${gen}/${outdis}">
+ <arg line="${arg.verbose}"/>
+ <arg line="-s"/>
+ <arg path="${gen}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="dis_enh_common" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.Disassembler"
+ fork="yes" classpathref="tools.class.path" failonerror="yes"
+ output="${enh}/${outdis}">
+ <arg line="${arg.verbose}"/>
+ <arg line="-s"/>
+ <arg path="${enh}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="test_aug_gen_common" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.AugmentationTest"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-j"/>
+ <arg path="${src}:${gen}:${jdo}"/>
+ <arg line="-s"/>
+ <arg path="${gen}:${jdo}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="test_aug_enh_common" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.AugmentationTest"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-j"/>
+ <arg path="${src}:${cls}:${jdo}"/>
+ <arg line="-s"/>
+ <arg path="${enh}:${jdo}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="test_ann_gen_common" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.AnnotationTest" fork="yes"
+ classpathref="tools.class.path" failonerror="yes">
+ <arg line="${arg.verbose}"/>
+ <arg line="-j"/>
+ <arg path="${src}:${gen}:${jdo}"/>
+ <arg line="-s"/>
+ <arg path="${gen}:${jdo}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="test_ann_enh_common" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.AnnotationTest" fork="yes"
+ classpathref="tools.class.path" failonerror="yes">
+ <arg line="${arg.verbose}"/>
+ <arg line="-j"/>
+ <arg path="${src}:${cls}:${jdo}"/>
+ <arg line="-s"/>
+ <arg path="${enh}:${jdo}"/>
+ <arg line="${classes0}"/>
+ </java>
+ </target>
+
+ <target name="test_aug_diff_common" depends="generate_common,enhance_common,arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.AugmentationDiffTest"
+ fork="yes" classpathref="tools.class.path" failonerror="yes">
+ <arg line="${arg.verbose}"/>
+ <arg line="${gen}/**/*.class"/>
+ <arg line="${enh}/**/*.class"/>
+ </java>
+ </target>
+
+ <target name="compile" depends="compile_common"/>
+ <target name="generate" depends="generate_common"/>
+ <target name="enhance" depends="enhance_common"/>
+ <target name="javap_gen" depends="javap_gen_common"/>
+ <target name="javap_enh" depends="javap_enh_common"/>
+ <target name="dis_gen" depends="dis_gen_common"/>
+ <target name="dis_enh" depends="dis_enh_common"/>
+ <target name="test_aug_gen" depends="test_aug_gen_common"/>
+ <target name="test_aug_enh" depends="test_aug_enh_common"/>
+ <target name="test_ann_gen" depends="test_ann_gen_common"/>
+ <target name="test_ann_enh" depends="test_ann_enh_common"/>
+
+ <target name="all_gen" depends="generate,javap_gen,dis_gen,test_aug_gen,test_ann_gen"/>
+ <target name="all_enh" depends="compile,enhance,javap_enh,dis_enh,test_aug_enh,test_ann_enh"/>
+ <target name="all" depends="all_gen,all_enh"/>
+
+ <target name="arg.verbose">
+ <condition property="arg.verbose" value="-v">
+ <or>
+ <istrue value="${verbose}"/>
+ <not> <isset property="verbose"/> </not>
+ </or>
+ </condition>
+ <condition property="arg.verbose" value="">
+ <isfalse value="${verbose}"/>
+ </condition>
+ </target>
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/build.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/build.xml?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/build.xml (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/build.xml Fri Mar 18 17:02:29 2005
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+
+<!--
+ 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.
+-->
+
+
+<!DOCTYPE project [ <!ENTITY IncludeCommonFile SYSTEM "../common.xml"> ]>
+
+<project name="SEmpDept" default="all" basedir=".">
+
+ <!-- include common.xml -->
+ &IncludeCommonFile;
+
+ <property name="classes0" value="empdept.Department empdept.Department$$Oid empdept.Employee empdept.Employee$$Oid empdept.FullTimeEmployee empdept.PartTimeEmployee empdept.PartTimeEmployee$$Oid"/>
+
+ <property name="classes1" value="empdept.Department empdept.Department.Oid empdept.Employee empdept.Employee.Oid empdept.PartTimeEmployee empdept.PartTimeEmployee.Oid"/>
+
+ <property name="jdoproperties" value="${src}/empdept.jdoproperties"/>
+ <property name="jdo" value="${src}/empdept/package.jdo"/>
+
+ <property name="outjavap" value="output.javap"/>
+ <property name="outdis" value="output.dis"/>
+
+ <target name="enhance_files" depends="compile_common,init_enhance_common,arg.verbose">
+ <java classname="org.apache.jdo.enhancer.EnhancerMain"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-f -d ${enh}"/>
+ <arg line="-j"/>
+ <arg path="${src}:${cls}:${jdo}"/>
+<!-- disable calling the enhancer with jdopropeties for now
+ <arg line="- -properties ${jdoproperties}"/>
+-->
+ <arg line="${cls}/empdept/Department.class ${cls}/empdept/Department$$Oid.class ${cls}/empdept/Employee.class ${cls}/empdept/Employee$$Oid.class"/>
+ </java>
+ </target>
+
+ <target name="dis_enh_files" depends="arg.verbose">
+ <java classname="org.apache.jdo.impl.enhancer.util.Disassembler"
+ fork="yes" classpathref="tools.class.path" failonerror="yes"
+ output="${enh}/${outdis}">
+ <arg line="${arg.verbose}"/>
+ <arg line="${enh}/empdept/Department.class ${enh}/empdept/Department$$Oid.class ${enh}/empdept/Employee.class ${enh}/empdept/Employee$$Oid.class"/>
+ </java>
+ </target>
+
+ <target name="test_ann_enh_files" depends="arg.verbose">
+ <java classname="org.apache.jdo.enhancer.util.AnnotationTest"
+ fork="yes" failonerror="yes" classpathref="tools.class.path">
+ <arg line="${arg.verbose}"/>
+ <arg line="-j"/>
+ <arg path="${src}:${cls}:${jdo}"/>
+ <arg line="${enh}/empdept/Department.class ${enh}/empdept/Department$$Oid.class ${enh}/empdept/Employee.class ${enh}/empdept/Employee$$Oid.class"/>
+ </java>
+ </target>
+
+</project>
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept.jdoproperties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept.jdoproperties?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept.jdoproperties (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept.jdoproperties Fri Mar 18 17:02:29 2005
@@ -0,0 +1,35 @@
+# Classnames can have the following attributes:
+# jdo:{persistent|transactional}
+# super: <classname>
+# oid: <classname>
+# access: {public|protected|package|private}
+# Fieldnames can have the following attributes:
+# type:<type>
+# access: {public|protected|package|private}
+# jdo:{persistent|transactional|transient}
+# annotation:{key|dfg|mediated}
+
+empdept.Department=jdo:persistent,oid:empdept.Department$Oid,access:public
+empdept.Department#deptid=type:int,jdo:persistent,access:private,annotation:key
+empdept.Department#name=type:String,jdo:persistent,access:private,annotation:dfg
+empdept.Department#employees=type:java.util.Collection,jdo:persistent,access:private,annotation:mediated
+
+empdept.Employee=jdo:persistent,oid:empdept.Employee$Oid,access:public
+empdept.Employee#empid=type:long,jdo:persistent,access:private,annotation:key
+empdept.Employee#name=type:String,jdo:persistent,access:private,annotation:dfg
+empdept.Employee#department=type:empdept.Department,jdo:persistent,access:private,annotation:mediated
+empdept.Employee#birthdate=type:java.util.Date,jdo:persistent,access:private,annotation:mediated
+
+empdept.FullTimeEmployee=jdo:persistent,super:empdept.Employee,access:public
+empdept.FullTimeEmployee#salary=type:double,jdo:persistent,access:private,annotation:dfg
+
+empdept.PartTimeEmployee=jdo:persistent,super:empdept.Employee,oid:empdept.PartTimeEmployee$Oid,access:public
+empdept.PartTimeEmployee#cid=type:int,jdo:persistent,access:private,annotation:key
+empdept.PartTimeEmployee#wage=type:double,jdo:persistent,access:private,annotation:dfg
+
+empdept.Department$Oid=jdo:transient,access:public
+empdept.Department$Oid#deptid=type:int,jdo:transient,access:public
+empdept.Employee$Oid=jdo:transient,access:public
+empdept.Employee$Oid#empid=type:long,jdo:transient,access:public
+empdept.PartTimeEmployee$Oid=jdo:transient,super:empdept.Employee$Oid,access:public
+empdept.PartTimeEmployee$Oid#cid=type:long,jdo:transient,access:public
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Department.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Department.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Department.java (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Department.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,99 @@
+/*
+ * 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 empdept;
+
+import java.util.Collection;
+
+
+/**
+ * A sample department class.
+ */
+public class Department {
+ private int deptid;
+ private String name;
+ private Collection employees;
+
+ public Department() {
+ }
+
+ public Department(String str) {
+ super();
+ }
+
+ public Object clone() throws java.lang.CloneNotSupportedException {
+ // clone() method for enhancer testing purpose
+ final empdept.Department pc = (empdept.Department)super.clone();
+ pc.deptid = this.deptid;
+ pc.employees = this.employees;
+ pc.name = this.name;
+ return pc;
+ }
+
+ public int getDeptid() {
+ return deptid;
+ }
+
+ public void setDeptid(int deptid) {
+ this. deptid = deptid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this. name = name;
+ }
+
+ public Collection getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(Collection employees) {
+ this. employees = employees;
+ }
+
+ public static class Oid
+ implements java.io.Serializable {
+ public int deptid;
+
+ public Oid() {
+ super();
+ }
+
+ public Oid(String str) {
+ // not implemented yet
+ throw new UnsupportedOperationException();
+ }
+
+ public int hashCode() {
+ int hash = 0;
+ hash += (int)deptid;
+ return hash;
+ }
+
+ public boolean equals(java.lang.Object pk) {
+ if (pk == null || !this.getClass().equals(pk.getClass())) {
+ return false;
+ }
+ Oid oid = (Oid)pk;
+ if (this.deptid != oid.deptid) return false;
+ return true;
+ }
+ }
+}
+
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Employee.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Employee.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Employee.java (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/Employee.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,110 @@
+/*
+ * 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 empdept;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * A sample employee class.
+ */
+public class Employee {
+ private long empid;
+ private String name;
+ private Date birthdate;
+ private Department department;
+
+ public Employee() {
+ }
+
+ public Employee(String str) {
+ super();
+ }
+
+ public Object clone() throws java.lang.CloneNotSupportedException {
+ // clone() method for enhancer testing purpose
+ final empdept.Employee pc = (empdept.Employee)super.clone();
+ pc.birthdate = this.birthdate;
+ pc.department = this.department;
+ pc.empid = this.empid;
+ pc.name = this.name;
+ return pc;
+ }
+
+ public long getEmpid() {
+ return empid;
+ }
+
+ public void setEmpid(long empid) {
+ this.empid = empid;
+ }
+
+ public String setName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public java.util.Date getBirthdate() {
+ return birthdate;
+ }
+
+ public void setBirthdate(Date birthdate) {
+ this.birthdate = birthdate;
+ }
+
+ public Department getDepartment() {
+ return department;
+ }
+
+ public void setDepartment(Department department) {
+ this.department = department;
+ }
+
+ public static class Oid
+ implements java.io.Serializable {
+ public long empid;
+
+ public Oid() {
+ super();
+ }
+
+ public Oid(String str) {
+ // not implemented yet
+ throw new UnsupportedOperationException();
+ }
+
+ public int hashCode() {
+ int hash = 0;
+ hash += (int)empid;
+ return hash;
+ }
+
+ public boolean equals(java.lang.Object pk) {
+ if (pk == null || !this.getClass().equals(pk.getClass())) {
+ return false;
+ }
+ Oid oid = (Oid)pk;
+ if (this.empid != oid.empid) return false;
+ return true;
+ }
+
+ }
+}
+
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/FullTimeEmployee.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/FullTimeEmployee.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/FullTimeEmployee.java (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/FullTimeEmployee.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,47 @@
+/*
+ * 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 empdept;
+
+
+/**
+ * A sample employee subclass.
+ */
+public class FullTimeEmployee extends Employee {
+ private double salary;
+
+ public FullTimeEmployee() {
+ }
+
+ public FullTimeEmployee(String str) {
+ super();
+ }
+
+ public Object clone() throws java.lang.CloneNotSupportedException {
+ // clone() method for enhancer testing purpose
+ final empdept.FullTimeEmployee pc = (empdept.FullTimeEmployee)super.clone();
+ pc.salary = this.salary;
+ return pc;
+ }
+
+ public double getSalary() {
+ return salary;
+ }
+
+ public void setSalary(double salary) {
+ this.salary = salary;
+ }
+}
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/PartTimeEmployee.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/PartTimeEmployee.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/PartTimeEmployee.java (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/PartTimeEmployee.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,90 @@
+/*
+ * 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 empdept;
+
+
+/**
+ * A sample employee subclass.
+ */
+public class PartTimeEmployee extends Employee {
+ private int cid;
+ private double wage;
+
+ public PartTimeEmployee() {
+ }
+
+ public PartTimeEmployee(String str) {
+ super();
+ }
+
+ public Object clone() throws java.lang.CloneNotSupportedException {
+ // clone() method for enhancer testing purpose
+ final empdept.PartTimeEmployee pc = (empdept.PartTimeEmployee)super.clone();
+ pc.cid = this.cid;
+ pc.wage = this.wage;
+ return pc;
+ }
+
+ public int getCid()
+ {
+ return this.cid;
+ }
+
+ public void setCid(int cid)
+ {
+ this.cid = cid;
+ }
+
+ public double getWage() {
+ return wage;
+ }
+
+ public void setWage(double wage) {
+ this.wage = wage;
+ }
+
+ public static class Oid
+ extends empdept.Employee.Oid
+ implements java.io.Serializable {
+ public int cid;
+
+ public Oid() {
+ super();
+ }
+
+ public Oid(String str) {
+ super(str);
+ // not implemented yet
+ throw new UnsupportedOperationException();
+ }
+
+ public int hashCode() {
+ int hash = super.hashCode();
+ hash += (int)cid;
+ return hash;
+ }
+
+ public boolean equals(java.lang.Object pk) {
+ if (!super.equals(pk)) {
+ return false;
+ }
+ Oid oid = (Oid)pk;
+ if (this.cid != oid.cid) return false;
+ return true;
+ }
+ }
+}
Added: incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/package.jdo
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/package.jdo?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/package.jdo (added)
+++ incubator/jdo/trunk/ri11/test/enhancer/sempdept/src/empdept/package.jdo Fri Mar 18 17:02:29 2005
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 1.0//EN" "http://java.sun.com/dtd/jdo_1_0.dtd">
+<jdo>
+ <package name="empdept">
+
+ <class name="Department"
+ objectid-class="empdept.Department$Oid"
+ identity-type="application">
+ <field name="deptid"
+ primary-key="true"
+ default-fetch-group="false"
+ persistence-modifier="persistent"/>
+ <field name="name"
+ default-fetch-group="true"
+ persistence-modifier="persistent"/>
+ <field name="employees"
+ persistence-modifier="persistent">
+ <collection element-type="Employee"/>
+ </field>
+ </class>
+
+ <class name="Employee"
+ objectid-class="empdept.Employee$Oid"
+ identity-type="application">
+ <field name="empid"
+ primary-key="true"
+ default-fetch-group="false"
+ persistence-modifier="persistent"/>
+ <field name="name"
+ default-fetch-group="true"
+ persistence-modifier="persistent"/>
+ <field name="birthdate"
+ default-fetch-group="false"
+ persistence-modifier="persistent"/>
+ <field name="department"
+ persistence-modifier="persistent"/>
+ </class>
+
+ <class name="FullTimeEmployee"
+ identity-type="application"
+ persistence-capable-superclass="Employee">
+ <field name="salary"
+ default-fetch-group="true"
+ persistence-modifier="persistent"/>
+ </class>
+
+ <class name="PartTimeEmployee"
+ identity-type="application"
+ objectid-class="empdept.PartTimeEmployee$Oid"
+ persistence-capable-superclass="Employee">
+ <field name="cid"
+ primary-key="true"
+ default-fetch-group="false"
+ persistence-modifier="persistent"/>
+ <field name="wage"
+ default-fetch-group="true"
+ persistence-modifier="persistent"/>
+ </class>
+
+ </package>
+</jdo>
Added: incubator/jdo/trunk/ri11/test/fsuid2/build.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/fsuid2/build.xml?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/fsuid2/build.xml (added)
+++ incubator/jdo/trunk/ri11/test/fsuid2/build.xml Fri Mar 18 17:02:29 2005
@@ -0,0 +1,84 @@
+<!--
+ 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.
+-->
+
+<project name="fsuid2" default="build" basedir=".">
+
+<property name="jdoapi" value="../../src/jdo.jar"/>
+<property name="jdori" value="../../src/jdo-ri.jar"/>
+<property name="enhancer" value="org.apache.jdo.enhancer.Main"/>
+<property name="destdir" value=".."/>
+<property name="fsuid2.jarfile" value="${destdir}/fsuid2.jar"/>
+<property name="xerces" value="../../release/lib/ext/xerces.jar"/>
+<property name="antlr" value="${java.class.path}"/>
+<property name="logging" value="../../release/lib/ext/commons-logging.jar"/>
+<property name="enhanceDir" value="enhance.out"/>
+
+<target name="build" depends="fsuid2.uptodate, fsuid2.jar"/>
+
+<target name="fsuid2.uptodate">
+ <uptodate property="fsuid2.enhancement.notRequired" targetfile="${fsuid2.jarfile}">
+ <srcfiles dir="org/apache/jdo/pc" includes="*.jdo, *.jdoproperties, PC*.java"/>
+ </uptodate>
+</target>
+
+<target name="fsuid2.jar" unless="fsuid2.enhancement.notRequired">
+ <javac srcdir="org/apache/jdo/pc" debug="on" includes="PCPoint.java"/>
+
+ <mkdir dir="${enhanceDir}"/>
+ <java fork="yes" failonerror="yes"
+ classname="${enhancer}"
+ classpath="${jdoapi};${jdori};${xerces};${antlr};${logging}">
+ <arg line="-f -d ${enhanceDir} -s . org/apache/jdo/pc/PCPoint.class"/>
+ </java>
+
+ <move todir="org/apache/jdo/pc">
+ <fileset dir="${enhanceDir}/org/apache/jdo/pc">
+ <include name="*.class"/>
+ </fileset>
+ </move>
+
+ <java fork="yes" failonerror="yes"
+ classname="org.apache.jdo.impl.enhancer.util.AugmentationTest"
+ classpath=".;${jdoapi};${jdori}">
+ <arg line="-s"/>
+ <arg path=".;${jdoapi};${jdori}"/>
+ <arg line="--properties org/apache/jdo/pc/fsuid2.jdoproperties org.apache.jdo.pc.PCPoint"/>
+ </java>
+
+ <java fork="yes" failonerror="yes"
+ classname="org.apache.jdo.impl.enhancer.util.AnnotationTest"
+ classpath="${jdori}">
+ <arg line="--properties org/apache/jdo/pc/fsuid2.jdoproperties org/apache/jdo/pc/PCPoint.class"/>
+ </java>
+
+ <delete file="${fsuid2.jarfile}"/>
+ <jar jarfile="${fsuid2.jarfile}">
+ <fileset dir="." includes="org/apache/jdo/pc/**/*.class,
+ org/apache/jdo/pc/**/*.jdo"/>
+ </jar>
+</target>
+
+<target name="clean">
+ <delete>
+ <fileset dir="." includes="**/*.class"/>
+ </delete>
+ <delete file="${fsuid2.jarfile}"/>
+ <delete dir="${enhanceDir}"/>
+</target>
+
+<target name="clobber" depends="clean"/>
+
+</project>
Added: incubator/jdo/trunk/ri11/test/fsuid2/dist.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/fsuid2/dist.xml?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/fsuid2/dist.xml (added)
+++ incubator/jdo/trunk/ri11/test/fsuid2/dist.xml Fri Mar 18 17:02:29 2005
@@ -0,0 +1,64 @@
+<!--
+ 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.
+-->
+
+<project name="fsuid2" default="build" basedir=".">
+
+<property name="jdo.fsuid2" value="../../../jdo.jar"/>
+<property name="jdo-enhancer.fsuid2" value="../../../jdo-enhancer.jar"/>
+<property name="enhancer.fsuid2" value="org.apache.jdo.enhancer.Main"/>
+<property name="jarfile.fsuid2" value="../../fsuid2.jar"/>
+<property name="xerces.fsuid2"
+ value="../../../../lib/xerces.jar"/>
+
+<target name="build" depends="fsuid2.uptodate, fsuid2.jar">
+</target>
+
+<target name="fsuid2.uptodate">
+ <uptodate property="fsuid2.enhancement.notRequired" targetfile="${jarfile.fsuid2}">
+ <srcfiles dir="." includes="*.jdoproperties, PC*.java"/>
+ </uptodate>
+</target>
+
+<target name="fsuid2.jar" unless="fsuid2enhancement.notRequired">
+ <javac srcdir="." debug="on" includes="PCPoint.java"/>
+
+ <mkdir dir="enhance.out"/>
+ <java fork="yes" failonerror="yes"
+ classname="${enhancer.fsuid2}"
+ classpath="${jdo.fsuid2};${jdo-enhancer.fsuid2};${xerces.fsuid2}">
+ <arg line="-f -d enhance.out PCPoint.jdo PCPoint.class"/>
+ </java>
+
+ <move todir=".">
+ <fileset dir="enhance.out/test">
+ <include name="*.class"/>
+ </fileset>
+ </move>
+
+ <delete file="${jarfile.fsuid2}"/>
+ <jar jarfile="${jarfile.fsuid2}" basedir=".." includes="test/*.class, test/*.jdo"/>
+</target>
+
+<target name="clean">
+ <delete includeEmptyDirs="true">
+ <fileset dir="." includes="*.class, enhance.out"/>
+ </delete>
+ <delete file="${jarfile.fsuid2}"/>
+</target>
+
+<target name="clobber" depends="clean"/>
+
+</project>
Added: incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.java (added)
+++ incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,97 @@
+/*
+ * 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.pc;
+
+/**
+* A simple class with two fields
+*
+* @author Dave Bristor
+*/
+public class PCPoint {
+ public int x;
+ public Integer y;
+ float z;
+
+ public PCPoint() { }
+
+ public PCPoint(int x, int y, float z) {
+ this.x = x;
+ this.y = new Integer(y);
+ this.z = z;
+ }
+
+ public PCPoint(int x, Integer y, float z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ public String toString() {
+ String rc = null;
+ try {
+ rc = this.getClass().getName() + name();
+ } catch (NullPointerException ex) {
+ rc = "NPE getting PCPoint's values";
+ }
+ return rc;
+ }
+
+ public boolean equals(Object o) {
+ if ((o == null) || !(o instanceof PCPoint))
+ return false;
+ PCPoint other = (PCPoint)o;
+ if (x != other.x)
+ return false;
+ // Caution: comparing floats
+ if (z != other.z)
+ return false;
+ if (y == null)
+ return other.y == null;
+ else if (other.y == null)
+ return y == null;
+ else
+ return y.intValue() == other.y.intValue();
+ }
+
+ void setX(int x) {
+ this.x = x;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ void setY(Integer y) {
+ this.y = y;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ void setZ(float z) {
+ this.z = z;
+ }
+
+ float getZ() {
+ return z;
+ }
+
+ public String name() {
+ return " x: " + getX() + ", y: " + getY().intValue() + ", z: " + z;
+ }
+}
Added: incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.jdo
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.jdo?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.jdo (added)
+++ incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/PCPoint.jdo Fri Mar 18 17:02:29 2005
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 1.0//EN" "http://java.sun.com/dtd/jdo_1_0.dtd">
+<jdo>
+ <package name="org.apache.jdo.pc">
+
+ <!-- This will not be required once the JDOModel is fixed so that
+ the defaults defined in section 18.4 of the spec are working
+ -->
+ <class name="PCPoint"
+ identity-type="datastore">
+ <field name="x" persistence-modifier="persistent"/>
+ <field name="y" persistence-modifier="persistent"/>
+ <field name="z" persistence-modifier="persistent"/>
+ </class>
+
+ </package>
+</jdo>
+
Added: incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/fsuid2.jdoproperties
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/fsuid2.jdoproperties?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/fsuid2.jdoproperties (added)
+++ incubator/jdo/trunk/ri11/test/fsuid2/org/apache/jdo/pc/fsuid2.jdoproperties Fri Mar 18 17:02:29 2005
@@ -0,0 +1,15 @@
+# Classnames can have the following attributes:
+# jdo:{persistent|transactional}
+# super: <classname>
+# oid: <classname>
+# access: {public|protected|package|private}
+# Fieldnames can have the following attributes:
+# type:<type>
+# access: {public|protected|package|private}
+# jdo:{persistent|transactional|transient}
+# annotation:{key|dfg|mediated}
+
+org.apache.jdo.pc.PCPoint=jdo:persistent
+org.apache.jdo.pc.PCPoint#x=jdo:persistent,annotation:mediated
+org.apache.jdo.pc.PCPoint#y=jdo:persistent,annotation:mediated
+org.apache.jdo.pc.PCPoint#z=jdo:persistent,annotation:mediated
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_FSUID.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_FSUID.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_FSUID.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_FSUID.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,103 @@
+/*
+ * 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.impl.fostore;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.jdo.JDOUserException;
+
+import org.apache.jdo.test.util.AbstractTest;
+import org.apache.jdo.test.util.JDORITestRunner;
+
+/**
+* Test that FOStoreSchemaUID works as expected.
+*
+* @author Dave Bristor
+*/
+public class Test_FSUID extends AbstractTest {
+ /** */
+ private FOStorePMF pmf;
+
+ /** */
+ private FOStoreModel model;
+
+
+ /** */
+ public static void main(String args[]) {
+ JDORITestRunner.run(Test_FSUID.class);
+ }
+
+ /** Sets up the PMF for the test. */
+ protected void setUp() throws Exception
+ {
+ pmf = new FOStorePMF();
+ model = pmf.getModel();
+ }
+
+ /** */
+ protected void tearDown()
+ {
+ if (pmf != null) {
+ AccessController.doPrivileged(
+ new PrivilegedAction () {
+ public Object run () {
+ try {
+ pmf.close();
+ } catch (JDOUserException ex) {
+ System.out.println("pmf.close threw " + ex);
+ System.out.println("forcing close");
+ if( pmf instanceof FOStorePMF )
+ ((FOStorePMF)pmf).close(true);
+ }
+ return null;
+ }});
+ }
+ pmf = null;
+ model = null;
+ }
+
+ /**
+ * TestCase:
+ */
+ public void test() throws Exception
+ {
+ check("org.apache.jdo.pc.PCPoint",
+ "8956920886101650067");
+ check("org.apache.jdo.pc.PCRect",
+ "-8480732594287021208");
+ check("org.apache.jdo.pc.PCArrays",
+ "-8444984152061270200");
+ check("org.apache.jdo.pc.empdept.PCPerson",
+ "-6869885283474787185");
+ check("org.apache.jdo.pc.empdept.PCEmployee",
+ "-9214907875158685");
+ check("org.apache.jdo.pc.empdept.PCPartTimeEmployee",
+ "-7548523301931157884");
+ }
+
+ /** */
+ private void check(String className, String expected)
+ throws ClassNotFoundException
+ {
+ Class cls = Class.forName(className);
+ FOStoreSchemaUID fsuid = FOStoreSchemaUID.lookup(cls, model);
+ assertNotNull("FSUID for class " + className + " is null", fsuid);
+ assertEquals("Wrong FSUID", expected, fsuid.toString());
+ }
+
+}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_Transcriber.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_Transcriber.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_Transcriber.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/impl/fostore/Test_Transcriber.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,279 @@
+/*
+ * 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.
+ */
+
+// Note the package: This way, we can access things the way we want the rest
+// of JDO to do so, and don't have to "publicize" any classes nor methods for
+// the sake of testing.
+//
+package org.apache.jdo.impl.fostore;
+
+import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.jdo.JDOUserException;
+
+import org.apache.jdo.test.util.AbstractTest;
+import org.apache.jdo.test.util.JDORITestRunner;
+
+/**
+* This test is FOStore-specific; it tests only those transcribers. It does
+* not test for the ability to transcribe null values for objects; for that
+* see Test_Primitives which tests transcribing *and* storing of nulls. Also
+* see Test_Collections, which tests transcribing and storing of collections.
+*/
+public class Test_Transcriber extends AbstractTest {
+ //
+ // Transcribe these
+ // For now, don't transcribe object (we don't do objects yet), just
+ // transcribe their fields.
+ //
+ static boolean primitiveBoolean = true;
+ static char primitiveChar = 'z';
+ static byte primitiveByte = 0xf;
+ static short primitiveShort = 12;
+ static int primitiveInt = 42;
+ static long primitiveLong = Long.MAX_VALUE;
+ static float primitiveFloat = 123.45f;
+ static double primitiveDouble = 3.14159;
+ static String primitiveObject = "hello, world";
+
+ private FOStorePMF pmf;
+
+ /** */
+ public static void main(String args[]) {
+ JDORITestRunner.run(Test_Transcriber.class);
+ }
+
+ /** Sets up the PMF for the test. */
+ protected void setUp() throws Exception
+ {
+ pmf = new FOStorePMF();
+ }
+
+ /** */
+ protected void tearDown()
+ {
+ if (pmf != null) {
+ AccessController.doPrivileged(
+ new PrivilegedAction () {
+ public Object run () {
+ try {
+ pmf.close();
+ } catch (JDOUserException ex) {
+ System.out.println("pmf.close threw " + ex);
+ System.out.println("forcing close");
+ if( pmf instanceof FOStorePMF )
+ ((FOStorePMF)pmf).close(true);
+ }
+ return null;
+ }});
+ }
+ pmf = null;
+ }
+
+ // The idea is that we're going to write a bunch of stuff to a data
+ // output stream, then read it back in; we should get the same data
+ // back.
+ public void test() throws Exception {
+ // Step 1: store
+ //
+ FOStoreOutput fos = new FOStoreOutput();
+ storePrimitives(fos);
+
+ // Step 2: fetch
+ //
+ byte data[] = fos.getBuf();
+ FOStoreInput fis = new FOStoreInput(data, 0, data.length);
+ fetchPrimitives(fis);
+ }
+
+ void storePrimitives(FOStoreOutput fos) throws Exception {
+ FOStoreTranscriberFactory tf = FOStoreTranscriberFactory.getInstance();
+ FOStoreTranscriber t = null;
+
+ try {
+ t = (FOStoreTranscriber)tf.getTranscriber(boolean.class)[0];
+ t.storeBoolean(primitiveBoolean, fos);
+ assertEquals("Stored primitiveBoolean transcriber",
+ "org.apache.jdo.impl.fostore.BooleanTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(char.class)[0];
+ t.storeChar(primitiveChar, fos);
+ assertEquals("Stored primitiveChar transcriber",
+ "org.apache.jdo.impl.fostore.CharTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(byte.class)[0];
+ t.storeByte(primitiveByte, fos);
+ assertEquals("Stored primitiveByte transcriber ",
+ "org.apache.jdo.impl.fostore.ByteTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(short.class)[0];
+ t.storeShort(primitiveShort, fos);
+ assertEquals("Stored primitiveShort transcriber ",
+ "org.apache.jdo.impl.fostore.ShortTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(int.class)[0];
+ t.storeInt(primitiveInt, fos);
+ assertEquals("Stored primitiveInt transcriber ",
+ "org.apache.jdo.impl.fostore.IntTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(long.class)[0];
+ t.storeLong(primitiveLong, fos);
+ assertEquals("Stored primitiveLong transcriber ",
+ "org.apache.jdo.impl.fostore.LongTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(float.class)[0];
+ t.storeFloat(primitiveFloat, fos);
+ assertEquals("Stored primitiveFloat transcriber ",
+ "org.apache.jdo.impl.fostore.FloatTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(double.class)[0];
+ t.storeDouble(primitiveDouble, fos);
+ assertEquals("Stored primitiveDouble transcriber ",
+ "org.apache.jdo.impl.fostore.DoubleTranscriber",
+ t.getClass().getName());
+
+ t = (FOStoreTranscriber)tf.getTranscriber(primitiveObject.getClass())[0];
+ t.storeObject(primitiveObject, fos);
+ assertEquals("Stored primitiveObject transcriber ",
+ "org.apache.jdo.impl.fostore.ObjectTranscriber",
+ t.getClass().getName());
+ } catch (IOException ex) {
+ throw new Exception("Couldn't store a primitive: " + ex);
+ }
+ }
+
+ void fetchPrimitives(FOStoreInput fis) throws Exception {
+ FOStoreTranscriberFactory tf = FOStoreTranscriberFactory.getInstance();
+ FOStoreTranscriber t;
+ boolean aBoolean;
+ char aChar;
+ byte aByte;
+ short aShort;
+ int anInt;
+ long aLong;
+ float aFloat;
+ double aDouble;
+ Object anObject;
+
+ try {
+ t = (BooleanTranscriber)tf.getTranscriber(boolean.class)[0];
+ aBoolean = t.fetchBoolean(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveBoolean: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveBoolean", primitiveBoolean, aBoolean);
+ assertEquals("Fetched primitiveBoolean transcriber",
+ "org.apache.jdo.impl.fostore.BooleanTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (CharTranscriber)tf.getTranscriber(char.class)[0];
+ aChar = t.fetchChar(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveChar: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveChar", primitiveChar, aChar);
+ assertEquals("Fetched primitiveChar transcriber",
+ "org.apache.jdo.impl.fostore.CharTranscriber",
+ t.getClass().getName());
+ try {
+ t = (ByteTranscriber)tf.getTranscriber(byte.class)[0];
+ aByte = t.fetchByte(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveByte: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveByte", primitiveByte, aByte);
+ assertEquals("Fetched primitiveByte transcriber",
+ "org.apache.jdo.impl.fostore.ByteTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (ShortTranscriber)tf.getTranscriber(short.class)[0];
+ aShort = t.fetchShort(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveShort: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveShort", primitiveShort, aShort);
+ assertEquals("Fetched primitiveShort transcriber",
+ "org.apache.jdo.impl.fostore.ShortTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (IntTranscriber)tf.getTranscriber(int.class)[0];
+ anInt = t.fetchInt(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveInt: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveInt", primitiveInt, anInt);
+ assertEquals("Fetched primitiveInt transcriber",
+ "org.apache.jdo.impl.fostore.IntTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (LongTranscriber)tf.getTranscriber(long.class)[0];
+ aLong = t.fetchLong(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveLong: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveLong", primitiveLong, aLong);
+ assertEquals("Fetched primitiveLong transcribers",
+ "org.apache.jdo.impl.fostore.LongTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (FloatTranscriber)tf.getTranscriber(float.class)[0];
+ aFloat = t.fetchFloat(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveFloat: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveFloat", primitiveFloat, aFloat, 1e-2f);
+ assertEquals("Fetched primitiveFloat transcriber",
+ "org.apache.jdo.impl.fostore.FloatTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (DoubleTranscriber)tf.getTranscriber(double.class)[0];
+ aDouble = t.fetchDouble(fis);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveDouble: " + ex);
+ }
+ assertEquals("Wrong value retrieving primitiveDouble", primitiveDouble, aDouble, 1e-4);
+ assertEquals("Fetched primitiveDouble transcriber",
+ "org.apache.jdo.impl.fostore.DoubleTranscriber",
+ t.getClass().getName());
+
+ try {
+ t = (ObjectTranscriber)tf.getTranscriber(Object.class)[0];
+ anObject = t.fetchObject(fis, null, -1);
+ } catch (IOException ex) {
+ throw new Exception("Couldn't fetch primitiveObject: " + ex);
+ }
+
+ assertEquals("Wrong value retrieving primitiveObject", primitiveObject, anObject);
+ assertEquals("Fetched primitiveObject transcriber",
+ "org.apache.jdo.impl.fostore.ObjectTranscriber",
+ t.getClass().getName());
+ }
+}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/DepartmentFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/DepartmentFactory.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/DepartmentFactory.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/DepartmentFactory.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.pc;
+
+import org.apache.jdo.test.util.Factory;
+
+/**
+* Provides a means to create objects that are inserted into a database, and
+* for verifying that they've been retrieved OK.
+*
+* @author Dave Bristor
+*/
+public class DepartmentFactory implements Factory {
+ /**
+ * Returns the class instance of the pc class of this factory.
+ */
+ public Class getPCClass()
+ {
+ return PCDepartment.class;
+ }
+
+ public Object create(int index) {
+ return null; // Not needed for current tests.
+ }
+
+ // Not needed by this implementation.
+ public void setVerify(int x) { }
+
+ public boolean verify(int i, Object pc) {
+ return true;
+ }
+}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/EmployeeFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/EmployeeFactory.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/EmployeeFactory.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/EmployeeFactory.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.pc;
+
+import org.apache.jdo.test.util.Factory;
+
+/**
+* Provides a means to create objects that are inserted into a database, and
+* for verifying that they've been retrieved OK.
+*
+* @author Dave Bristor
+*/
+public class EmployeeFactory implements Factory {
+ /**
+ * Returns the class instance of the pc class of this factory.
+ */
+ public Class getPCClass()
+ {
+ return PCEmployee.class;
+ }
+
+ public Object create(int index) {
+ return null; // Not needed for current tests.
+ }
+
+ // Not needed by this implementation.
+ public void setVerify(int x) { }
+
+ public boolean verify(int i, Object pc) {
+ return true;
+ }
+}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InsuranceFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InsuranceFactory.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InsuranceFactory.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InsuranceFactory.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.pc;
+
+import org.apache.jdo.test.util.Factory;
+
+/**
+* Provides a means to create objects that are inserted into a database, and
+* for verifying that they've been retrieved OK.
+*
+* @author Dave Bristor
+*/
+public class InsuranceFactory implements Factory {
+ /**
+ * Returns the class instance of the pc class of this factory.
+ */
+ public Class getPCClass()
+ {
+ return PCInsurance.class;
+ }
+
+ public Object create(int index) {
+ return null; // Not needed for current tests.
+ }
+
+ // Not needed by this implementation.
+ public void setVerify(int x) { }
+
+ public boolean verify(int i, Object pc) {
+ return true;
+ }
+}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InterfacesFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InterfacesFactory.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InterfacesFactory.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/InterfacesFactory.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,50 @@
+/*
+ * 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.pc;
+
+import org.apache.jdo.test.util.Factory;
+
+
+/**
+* Provides a means to create objects that are inserted into a database, and
+* for verifying that they've been retrieved OK.
+*
+* @author Dave Bristor
+*/
+public class InterfacesFactory implements Factory {
+ /**
+ * Returns the class instance of the pc class of this factory.
+ */
+ public Class getPCClass()
+ {
+ return PCInterfaces.class;
+ }
+
+ public Object create(int index) {
+ PCInterfaces rc = new PCInterfaces();
+ rc.init();
+ return rc;
+ }
+
+ // Not needed by this implementation.
+ public void setVerify(int x) { }
+
+ // Not needed by this implementation.
+ public boolean verify(int i, Object pc) {
+ return true;
+ }
+}
Added: incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/LargeObjFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/LargeObjFactory.java?view=auto&rev=158176
==============================================================================
--- incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/LargeObjFactory.java (added)
+++ incubator/jdo/trunk/ri11/test/java/org/apache/jdo/pc/LargeObjFactory.java Fri Mar 18 17:02:29 2005
@@ -0,0 +1,59 @@
+/*
+ * 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.pc;
+
+import org.apache.jdo.test.util.Factory;
+
+
+/**
+* Provides a means to create objects that are inserted into a database, and
+* for verifying that they've been retrieved OK.
+*
+* @author Dave Bristor
+*/
+public class LargeObjFactory implements Factory {
+ private int size;
+
+ public LargeObjFactory() { }
+
+ public LargeObjFactory(int size) {
+ this.size = size;
+ }
+
+ /**
+ * Returns the class instance of the pc class of this factory.
+ */
+ public Class getPCClass()
+ {
+ return PCLargeObj.class;
+ }
+
+ public Object create(int index) {
+ PCLargeObj rc = new PCLargeObj();
+ rc.init(size);
+ return rc;
+ }
+
+ public void setVerify(int verify) {
+ size = verify;
+ }
+
+ public boolean verify(int i, Object pc) {
+ PCLargeObj o = (PCLargeObj)pc;
+ return o.verify(false);
+ }
+}
|