You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Michelle Caisse <Mi...@Sun.COM> on 2005/02/18 21:45:24 UTC

Steps to running the TCK against jpox & derby

Hi, Michael and others,

Here's what I've done to get jpox and derby to run against the TCK, to 
the point where they need to find tables in the database.

1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
3 Edit tck11/project.properties:
 # iut
 iut.properties = ${basedir}/jpox.properties
4. Create jpox.properties:
javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
#javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FOStorePMF
org.apache.jdo.ConnectionCreate=true
javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver
javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
#javax.jdo.option.ConnectionURL=fostore:database/fostore
javax.jdo.option.ConnectionUserName=tckuser
javax.jdo.option.ConnectionPassword=tckuser
javax.jdo.option.Optimistic=false
javax.jdo.option.RetainValues=false
javax.jdo.option.RestoreValues=false
5. In the classpath section of tck11/maven.xml, place these lines BEFORE 
the JDO jar file lines:
        <!-- Jar files for the implementation to be tested -->
        <path refid="test_iut_jars" />
 else  [java] 1) 
testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.JDOFatalUserException: 
JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
not have a JDO 1.0 jar in front of the JDO 2 classes in your CLASSPATH.
    [java]      at 
org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceManagerFactory.java:113)
6. Manually create a derby database.  I'm using iut_jars as the derby 
system directory, meaning that it looks there for databases and 
derby.properties. I wrote some scripts to create the db.  The procedure 
for deleting a derby database is an OS delete operation on the directory 
and files.
7. Add the following line to maven.xml in the <goal name="runtck.single" 
...> section:
            <sysproperty key="derby.system.home" 
value="${basedir}/iut_jars"/>

-- Michelle

Re: Steps to running the TCK against jpox & derby

Posted by Brian McCallister <br...@apache.org>.
If running on OS X, you will need this property in your  
derby.properties as well. HFS+ behaves oddly, apparently, so you need  
to tell it to use a slightly different locking system =(

This property works fine on non OS X systems as well.

derby.storage.fileSyncTransactionLog=true

-Brian

On Feb 18, 2005, at 3:52 PM, Michelle Caisse wrote:

> Michelle Caisse wrote:
>
>> Hi, Michael and others,
>>
>> Here's what I've done to get jpox and derby to run against the TCK,  
>> to the point where they need to find tables in the database.
>>
>> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
>
> and put derby.jar and derbytools.jar in tck11/iut_jars
>
>> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>> 3 Edit tck11/project.properties:
>> # iut
>> iut.properties = ${basedir}/jpox.properties
>> 4. Create jpox.properties:
>> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFa 
>> ctoryImpl
>> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore. 
>> FOStorePMF
>> org.apache.jdo.ConnectionCreate=true
>> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDr 
>> iver
>> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>> #javax.jdo.option.ConnectionURL=fostore:database/fostore
>> javax.jdo.option.ConnectionUserName=tckuser
>> javax.jdo.option.ConnectionPassword=tckuser
>> javax.jdo.option.Optimistic=false
>> javax.jdo.option.RetainValues=false
>> javax.jdo.option.RestoreValues=false
>> 5. In the classpath section of tck11/maven.xml, place these lines  
>> BEFORE the JDO jar file lines:
>>        <!-- Jar files for the implementation to be tested -->
>>        <path refid="test_iut_jars" />
>> else  [java] 1)  
>> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo 
>> .JDOFatalUserException: JDO 2.0 capabilities cannot be accessed!  
>> Please make sure that you do not have a JDO 1.0 jar in front of the  
>> JDO 2 classes in your CLASSPATH.
>>    [java]      at  
>> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceM 
>> anagerFactory.java:113)
>> 6. Manually create a derby database.  I'm using iut_jars as the derby  
>> system directory, meaning that it looks there for databases and  
>> derby.properties. I wrote some scripts to create the db.  The  
>> procedure for deleting a derby database is an OS delete operation on  
>> the directory and files.
>> 7. Add the following line to maven.xml in the <goal  
>> name="runtck.single" ...> section:
>>            <sysproperty key="derby.system.home"  
>> value="${basedir}/iut_jars"/>
>>
>> -- Michelle
>>
>
>


Re: Steps to running the TCK against jpox & derby

Posted by Michelle Caisse <Mi...@Sun.COM>.
Good point.  Let's talk at the meeting about what we can do to get the 
Apache repository to happen.

-- Michelle

Michael Bouschen wrote:

> Hi Michelle,
>
>> It may be time to set up a JDO 2 repository.  There JPOX will be the 
>> RI, not an iut. Is there anything stopping us from doing this now, 
>> Michael?  
>
>
> AFAIK, the subversion repository is not yet setup. So I have the maven 
> jdo projects on my local machine and post new versions to the wiki 
> from time to time.
>
> I think almost all the tck tests from JDO 1 will be JDO 2 tests too. 
> We could copy them over as astrat of the tck20 subproject. But then we 
> would need to maintain them in two places. I really like to have some 
> source code version control support when doing this.
>
> I think this is an important topic for the JDO TCK conference call 
> next Friday.
>
>> I think everything would be simpler if we had a real Apache 
>> repository now.
>
>
> Correct.
>
> Regards Michael
>
>>
>> -- Michelle
>>
>> erik@jpox.org wrote:
>>
>>>> thanks for the maven.xml file with the JPOX enhancer update. The JPOX
>>>> enhancer takes .jdo files as arguments and not the .class files of the
>>>> pc classes, correct?
>>>>   
>>>
>>>
>>>
>>> Correct.
>>>
>>>  
>>>
>>>> My idea is to use the JDORI enhancer during build.
>>>>   
>>>
>>>
>>>
>>> In the JPOX Enhancer for JDO 2 we implement the Detachable interface 
>>> in enhanced
>>> files. That's ok to use the JDORI enhancer if there are no 
>>> detach/attach tests,
>>> but I can recall from the latest times we tried the JDORI enhancer, 
>>> there were
>>> still some bugs there. Don't ask me what are they, I can't describe.
>>>
>>> Running the TCK for a
>>>  
>>>
>>>> particular JDO implementation is a separate step having special goals:
>>>> (1) Call 'maven useapplicationidentity' or 'maven 
>>>> usedatastoreidentity'
>>>> to copy the corresponding JDO metadata files.
>>>> (2) Run the enhancer.
>>>> (3) Call 'maven runtck' to start the TCK.
>>>> The project.properties files allows to specify an enhancer different
>>>> from the JDORI enhancer to be called in step (2). I think in your case
>>>> this would be the JPOX enhancer. Today there are only two properties:
>>>> enhancer.main and enhancer.options. So the maven enhancer goal assumes
>>>> the JDO implementation enhancer takes the class files as arguments. 
>>>> The
>>>> maven.xml you sent show that this was a wrong assumption. I will 
>>>> change
>>>> this and add a property enhancer.args to specify class files or 
>>>> metadata
>>>> files.
>>>>
>>>> I know the current documentation is poor, so I need to improve 
>>>> there :-).
>>>>
>>>> Regards Michael
>>>>
>>>>  
>>>>
>>>>> Hi,
>>>>>
>>>>> Here is the tck11/maven.xml file updated to use the JPOX enhancer.
>>>>>
>>>>> I still can't run the tck because JPOX has a strictly validation 
>>>>> of the
>>>>> metadata, and one of these checks needs removal as it was 
>>>>> clarified some
>>>>> time ago by the EG that it's not needed.
>>>>>
>>>>> Erik Bengtson
>>>>>
>>>>> -----Original Message-----
>>>>> From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM]
>>>>> Sent: Friday, February 18, 2005 9:52 PM
>>>>> To: jdo-dev@db.apache.org
>>>>> Subject: Re: Steps to running the TCK against jpox & derby
>>>>>
>>>>> Michelle Caisse wrote:
>>>>>
>>>>>
>>>>>    
>>>>>
>>>>>> Hi, Michael and others,
>>>>>>
>>>>>> Here's what I've done to get jpox and derby to run against the 
>>>>>> TCK, to
>>>>>>       
>>>>>
>>>>>
>>>>>    
>>>>>
>>>>>> the point where they need to find tables in the database.
>>>>>>
>>>>>> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
>>>>>>       
>>>>>
>>>>>
>>>>> and put derby.jar and derbytools.jar in tck11/iut_jars
>>>>>
>>>>>
>>>>>    
>>>>>
>>>>>> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>>>>>> 3 Edit tck11/project.properties:
>>>>>> # iut
>>>>>> iut.properties = ${basedir}/jpox.properties
>>>>>> 4. Create jpox.properties:
>>>>>>
>>>>>>       
>>>>>
>>>>>
>>>>> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact 
>>>>>
>>>>> oryImpl
>>>>>
>>>>>     
>>>>> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO 
>>>>>
>>>>> StorePMF
>>>>>
>>>>>    
>>>>>
>>>>>> org.apache.jdo.ConnectionCreate=true
>>>>>>
>>>>>>       
>>>>>
>>>>>
>>>>> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv 
>>>>>
>>>>> er
>>>>>
>>>>>    
>>>>>
>>>>>> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>>>>>> #javax.jdo.option.ConnectionURL=fostore:database/fostore
>>>>>> javax.jdo.option.ConnectionUserName=tckuser
>>>>>> javax.jdo.option.ConnectionPassword=tckuser
>>>>>> javax.jdo.option.Optimistic=false
>>>>>> javax.jdo.option.RetainValues=false
>>>>>> javax.jdo.option.RestoreValues=false
>>>>>> 5. In the classpath section of tck11/maven.xml, place these lines
>>>>>> BEFORE the JDO jar file lines:
>>>>>>      <!-- Jar files for the implementation to be tested -->
>>>>>>      <path refid="test_iut_jars" />
>>>>>> else  [java] 1)
>>>>>>
>>>>>>       
>>>>>
>>>>>
>>>>> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J 
>>>>>
>>>>> DOFatalUserException:
>>>>>
>>>>>    
>>>>>
>>>>>> JDO 2.0 capabilities cannot be accessed! Please make sure that 
>>>>>> you do
>>>>>> not have a JDO 1.0 jar in front of the JDO 2 classes in your
>>>>>>       
>>>>>
>>>>>
>>>>> CLASSPATH.
>>>>>
>>>>>    
>>>>>
>>>>>>  [java]      at
>>>>>>
>>>>>>       
>>>>>
>>>>>
>>>>> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan 
>>>>>
>>>>> agerFactory.java:113)
>>>>>
>>>>>    
>>>>>
>>>>>> 6. Manually create a derby database.  I'm using iut_jars as the 
>>>>>> derby
>>>>>> system directory, meaning that it looks there for databases and
>>>>>> derby.properties. I wrote some scripts to create the db.  The
>>>>>> procedure for deleting a derby database is an OS delete operation on
>>>>>> the directory and files.
>>>>>> 7. Add the following line to maven.xml in the <goal
>>>>>> name="runtck.single" ...> section:
>>>>>>          <sysproperty key="derby.system.home"
>>>>>> value="${basedir}/iut_jars"/>
>>>>>>
>>>>>> -- Michelle
>>>>>>
>>>>>>       
>>>>>
> [...]
>
>


Re: Steps to running the TCK against jpox & derby

Posted by Michael Bouschen <mb...@spree.de>.
Hi Michelle,

> It may be time to set up a JDO 2 repository.  There JPOX will be the RI, 
> not an iut. Is there anything stopping us from doing this now, Michael?  

AFAIK, the subversion repository is not yet setup. So I have the maven 
jdo projects on my local machine and post new versions to the wiki from 
time to time.

I think almost all the tck tests from JDO 1 will be JDO 2 tests too. We 
could copy them over as astrat of the tck20 subproject. But then we 
would need to maintain them in two places. I really like to have some 
source code version control support when doing this.

I think this is an important topic for the JDO TCK conference call next 
Friday.

> I think everything would be simpler if we had a real Apache repository now.

Correct.

Regards Michael

> 
> -- Michelle
> 
> erik@jpox.org wrote:
> 
>>> thanks for the maven.xml file with the JPOX enhancer update. The JPOX
>>> enhancer takes .jdo files as arguments and not the .class files of the
>>> pc classes, correct?
>>>   
>>
>>
>> Correct.
>>
>>  
>>
>>> My idea is to use the JDORI enhancer during build.
>>>   
>>
>>
>> In the JPOX Enhancer for JDO 2 we implement the Detachable interface 
>> in enhanced
>> files. That's ok to use the JDORI enhancer if there are no 
>> detach/attach tests,
>> but I can recall from the latest times we tried the JDORI enhancer, 
>> there were
>> still some bugs there. Don't ask me what are they, I can't describe.
>>
>> Running the TCK for a
>>  
>>
>>> particular JDO implementation is a separate step having special goals:
>>> (1) Call 'maven useapplicationidentity' or 'maven usedatastoreidentity'
>>> to copy the corresponding JDO metadata files.
>>> (2) Run the enhancer.
>>> (3) Call 'maven runtck' to start the TCK.
>>> The project.properties files allows to specify an enhancer different
>>> from the JDORI enhancer to be called in step (2). I think in your case
>>> this would be the JPOX enhancer. Today there are only two properties:
>>> enhancer.main and enhancer.options. So the maven enhancer goal assumes
>>> the JDO implementation enhancer takes the class files as arguments. The
>>> maven.xml you sent show that this was a wrong assumption. I will change
>>> this and add a property enhancer.args to specify class files or metadata
>>> files.
>>>
>>> I know the current documentation is poor, so I need to improve there 
>>> :-).
>>>
>>> Regards Michael
>>>
>>>   
>>>
>>>> Hi,
>>>>
>>>> Here is the tck11/maven.xml file updated to use the JPOX enhancer.
>>>>
>>>> I still can't run the tck because JPOX has a strictly validation of the
>>>> metadata, and one of these checks needs removal as it was clarified 
>>>> some
>>>> time ago by the EG that it's not needed.
>>>>
>>>> Erik Bengtson
>>>>
>>>> -----Original Message-----
>>>> From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM]
>>>> Sent: Friday, February 18, 2005 9:52 PM
>>>> To: jdo-dev@db.apache.org
>>>> Subject: Re: Steps to running the TCK against jpox & derby
>>>>
>>>> Michelle Caisse wrote:
>>>>
>>>>
>>>>     
>>>>
>>>>> Hi, Michael and others,
>>>>>
>>>>> Here's what I've done to get jpox and derby to run against the TCK, to
>>>>>       
>>>>
>>>>     
>>>>
>>>>> the point where they need to find tables in the database.
>>>>>
>>>>> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
>>>>>       
>>>>
>>>> and put derby.jar and derbytools.jar in tck11/iut_jars
>>>>
>>>>
>>>>     
>>>>
>>>>> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>>>>> 3 Edit tck11/project.properties:
>>>>> # iut
>>>>> iut.properties = ${basedir}/jpox.properties
>>>>> 4. Create jpox.properties:
>>>>>
>>>>>       
>>>>
>>>> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact 
>>>>
>>>> oryImpl
>>>>
>>>>     
>>>> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO 
>>>>
>>>> StorePMF
>>>>
>>>>     
>>>>
>>>>> org.apache.jdo.ConnectionCreate=true
>>>>>
>>>>>       
>>>>
>>>> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv 
>>>>
>>>> er
>>>>
>>>>     
>>>>
>>>>> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>>>>> #javax.jdo.option.ConnectionURL=fostore:database/fostore
>>>>> javax.jdo.option.ConnectionUserName=tckuser
>>>>> javax.jdo.option.ConnectionPassword=tckuser
>>>>> javax.jdo.option.Optimistic=false
>>>>> javax.jdo.option.RetainValues=false
>>>>> javax.jdo.option.RestoreValues=false
>>>>> 5. In the classpath section of tck11/maven.xml, place these lines
>>>>> BEFORE the JDO jar file lines:
>>>>>      <!-- Jar files for the implementation to be tested -->
>>>>>      <path refid="test_iut_jars" />
>>>>> else  [java] 1)
>>>>>
>>>>>       
>>>>
>>>> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J 
>>>>
>>>> DOFatalUserException:
>>>>
>>>>     
>>>>
>>>>> JDO 2.0 capabilities cannot be accessed! Please make sure that you do
>>>>> not have a JDO 1.0 jar in front of the JDO 2 classes in your
>>>>>       
>>>>
>>>> CLASSPATH.
>>>>
>>>>     
>>>>
>>>>>  [java]      at
>>>>>
>>>>>       
>>>>
>>>> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan 
>>>>
>>>> agerFactory.java:113)
>>>>
>>>>     
>>>>
>>>>> 6. Manually create a derby database.  I'm using iut_jars as the derby
>>>>> system directory, meaning that it looks there for databases and
>>>>> derby.properties. I wrote some scripts to create the db.  The
>>>>> procedure for deleting a derby database is an OS delete operation on
>>>>> the directory and files.
>>>>> 7. Add the following line to maven.xml in the <goal
>>>>> name="runtck.single" ...> section:
>>>>>          <sysproperty key="derby.system.home"
>>>>> value="${basedir}/iut_jars"/>
>>>>>
>>>>> -- Michelle
>>>>>
>>>>>       
[...]


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Re: Steps to running the TCK against jpox & derby

Posted by Michelle Caisse <Mi...@Sun.COM>.
It may be time to set up a JDO 2 repository.  There JPOX will be the RI, 
not an iut. Is there anything stopping us from doing this now, Michael?  
I think everything would be simpler if we had a real Apache repository now.

-- Michelle

erik@jpox.org wrote:

>>thanks for the maven.xml file with the JPOX enhancer update. The JPOX
>>enhancer takes .jdo files as arguments and not the .class files of the
>>pc classes, correct?
>>    
>>
>
>Correct.
>
>  
>
>>My idea is to use the JDORI enhancer during build.
>>    
>>
>
>In the JPOX Enhancer for JDO 2 we implement the Detachable interface in enhanced
>files. That's ok to use the JDORI enhancer if there are no detach/attach tests,
>but I can recall from the latest times we tried the JDORI enhancer, there were
>still some bugs there. Don't ask me what are they, I can't describe.
>
> Running the TCK for a
>  
>
>>particular JDO implementation is a separate step having special goals:
>>(1) Call 'maven useapplicationidentity' or 'maven usedatastoreidentity'
>>to copy the corresponding JDO metadata files.
>>(2) Run the enhancer.
>>(3) Call 'maven runtck' to start the TCK.
>>The project.properties files allows to specify an enhancer different
>>from the JDORI enhancer to be called in step (2). I think in your case
>>this would be the JPOX enhancer. Today there are only two properties:
>>enhancer.main and enhancer.options. So the maven enhancer goal assumes
>>the JDO implementation enhancer takes the class files as arguments. The
>>maven.xml you sent show that this was a wrong assumption. I will change
>>this and add a property enhancer.args to specify class files or metadata
>>files.
>>
>>I know the current documentation is poor, so I need to improve there :-).
>>
>>Regards Michael
>>
>>    
>>
>>>Hi,
>>>
>>>Here is the tck11/maven.xml file updated to use the JPOX enhancer.
>>>
>>>I still can't run the tck because JPOX has a strictly validation of the
>>>metadata, and one of these checks needs removal as it was clarified some
>>>time ago by the EG that it's not needed.
>>>
>>>Erik Bengtson
>>>
>>>-----Original Message-----
>>>From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM]
>>>Sent: Friday, February 18, 2005 9:52 PM
>>>To: jdo-dev@db.apache.org
>>>Subject: Re: Steps to running the TCK against jpox & derby
>>>
>>>Michelle Caisse wrote:
>>>
>>>
>>>      
>>>
>>>>Hi, Michael and others,
>>>>
>>>>Here's what I've done to get jpox and derby to run against the TCK, to
>>>>        
>>>>
>>>      
>>>
>>>>the point where they need to find tables in the database.
>>>>
>>>>1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
>>>>        
>>>>
>>>and put derby.jar and derbytools.jar in tck11/iut_jars
>>>
>>>
>>>      
>>>
>>>>2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>>>>3 Edit tck11/project.properties:
>>>># iut
>>>>iut.properties = ${basedir}/jpox.properties
>>>>4. Create jpox.properties:
>>>>
>>>>        
>>>>
>>>javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact
>>>oryImpl
>>>
>>>      
>>>
>>>#javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO
>>>StorePMF
>>>
>>>      
>>>
>>>>org.apache.jdo.ConnectionCreate=true
>>>>
>>>>        
>>>>
>>>javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv
>>>er
>>>
>>>      
>>>
>>>>javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>>>>#javax.jdo.option.ConnectionURL=fostore:database/fostore
>>>>javax.jdo.option.ConnectionUserName=tckuser
>>>>javax.jdo.option.ConnectionPassword=tckuser
>>>>javax.jdo.option.Optimistic=false
>>>>javax.jdo.option.RetainValues=false
>>>>javax.jdo.option.RestoreValues=false
>>>>5. In the classpath section of tck11/maven.xml, place these lines
>>>>BEFORE the JDO jar file lines:
>>>>      <!-- Jar files for the implementation to be tested -->
>>>>      <path refid="test_iut_jars" />
>>>>else  [java] 1)
>>>>
>>>>        
>>>>
>>>testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J
>>>DOFatalUserException:
>>>
>>>      
>>>
>>>>JDO 2.0 capabilities cannot be accessed! Please make sure that you do
>>>>not have a JDO 1.0 jar in front of the JDO 2 classes in your
>>>>        
>>>>
>>>CLASSPATH.
>>>
>>>      
>>>
>>>>  [java]      at
>>>>
>>>>        
>>>>
>>>org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan
>>>agerFactory.java:113)
>>>
>>>      
>>>
>>>>6. Manually create a derby database.  I'm using iut_jars as the derby
>>>>system directory, meaning that it looks there for databases and
>>>>derby.properties. I wrote some scripts to create the db.  The
>>>>procedure for deleting a derby database is an OS delete operation on
>>>>the directory and files.
>>>>7. Add the following line to maven.xml in the <goal
>>>>name="runtck.single" ...> section:
>>>>          <sysproperty key="derby.system.home"
>>>>value="${basedir}/iut_jars"/>
>>>>
>>>>-- Michelle
>>>>
>>>>        
>>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>><?xml version="1.0" encoding="UTF-8"?>
>>><!--
>>>
>>>    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 default="default"
>>>    xmlns:j="jelly:core"
>>>    xmlns:ant="jelly:ant"
>>>    xmlns:maven="jelly:maven"
>>>    >
>>>
>>>    <!-- ==================== -->
>>>    <!-- Default Global Goals -->
>>>    <!-- ==================== -->
>>>
>>>    <goal name="default">
>>>        <attainGoal name="jar:install"/>
>>>    </goal>
>>>
>>>    <goal name="build">
>>>        <attainGoal name="default"/>
>>>    </goal>
>>>
>>>    <goal name="rebuild">
>>>        <attainGoal name="clean"/>
>>>        <attainGoal name="build"/>
>>>    </goal>
>>>
>>>    <postGoal name="test:prepare-filesystem">
>>>        <mkdir dir="${jdo.testdir}"/>
>>>    </postGoal>
>>>
>>>    <postGoal name="test:compile">
>>>        <attainGoal name="copytestmetadata"/>
>>>        <attainGoal name="jpoxenhance"/>
>>>        <attainGoal name="database"/>
>>>    </postGoal>
>>>
>>>    <goal name="clobber" prereqs="clean">
>>>        <delete>
>>>            <fileset dir="." defaultexcludes="no" includes="**/*~"/>
>>>        </delete>
>>>    </goal>
>>>
>>>    <!-- ================== -->
>>>    <!-- Running test cases -->
>>>    <!-- ================== -->
>>>
>>>    <goal name="runtck" prereqs="testrunner.set, database,
>>>      
>>>
>>copyloggingprops">
>>    
>>
>>>        <echo>Run all tck tests from testlist ${jdo.testlist}</echo>
>>>        <java fork="yes" dir="${jdo.testdir}"
>>>              classname="${jdo.testrunnerclass}">
>>>            <classpath refid="project.class.path"/>
>>>            <sysproperty key="testlist" value="${jdo.testlist}"/>
>>>            <sysproperty key="ResultPrinterClass"
>>>      
>>>
>>value="${jdo.resultprinterclass}"/>
>>    
>>
>>>            <sysproperty key="verbose" value="${verbose}"/>
>>>            <sysproperty key="PMFProperties" value="${iut.properties}"/>
>>>            <sysproperty key="PMF2Properties"
>>>      
>>>
>>value="${basedir}/jdori2.properties"/>
>>    
>>
>>>        </java>
>>>    </goal>
>>>
>>>    <!-- Run a single tck test. The property testcase defines the name of
>>>      
>>>
>>-->
>>    
>>
>>>    <!-- the tck test class w/o the prefix org.apache.jdo.tck, e.g.
>>>      
>>>
>>-->
>>    
>>
>>>    <!--   maven -Dtest=api.jdohelper.GetObjectId runtck.single       -->
>>>    <goal name="runtck.single" prereqs="testrunner.set, database,
>>>      
>>>
>>copyloggingprops">
>>    
>>
>>>        <echo>Run tck test org.apache.jdo.tck.${test}</echo>
>>>        <java fork="yes" dir="${jdo.testdir}"
>>>              classname="org.apache.jdo.tck.${test}">
>>>            <classpath refid="project.class.path"/>
>>>            <sysproperty key="ResultPrinterClass"
>>>      
>>>
>>value="${jdo.resultprinterclass}"/>
>>    
>>
>>>            <sysproperty key="verbose" value="${verbose}"/>
>>>            <sysproperty key="PMFProperties" value="${iut.properties}"/>
>>>            <sysproperty key="PMF2Properties"
>>>      
>>>
>>value="${basedir}/jdori2.properties"/>
>>    
>>
>>>        </java>
>>>    </goal>
>>>
>>>    <!-- ================ -->
>>>    <!-- Enhancer support -->
>>>    <!-- ================ -->
>>>
>>>    <preGoal name="enhance">
>>>        <available property="metadata.exists" file="${jdo.metadata.dir}"/>
>>>        <fail unless="metadata.exists"
>>>              message="Metadata directory does not exists, please use goals
>>>      
>>>
>>useapplicationdirectory or usedatastoredirectory to setup the metadata."/>
>>    
>>
>>>        <delete>
>>>            <fileset dir="${jdo.testclasses.dir}"
>>>                     includes="${jdo.pcclasses.files}
>>>      
>>>
>>${jdo.paclasses.files}"/>
>>    
>>
>>>            <fileset dir="${jdo.testclasses.dir}"
>>>                     includes="**/*.jdo **/*jdoTest.properties"/>
>>>        </delete>
>>>        <attainGoal name="test:compile"/>
>>>        <delete dir="${enhanced.dir}"/>
>>>        <mkdir dir="${enhanced.dir}"/>
>>>    </preGoal>
>>>
>>>    <goal name="enhance">
>>>        <echo>Run enhancer</echo>
>>>        <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
>>>              classname="${enhancer.main}"
>>>              classpathref="project.class.path">
>>>             <arg line="${enhancer.options}"/>
>>>             <arg line="${jdo.pcclasses.files}"/>
>>>             <arg line="${jdo.paclasses.files}"/>
>>>        </java>
>>>    </goal>
>>>
>>>    <goal name="jdorienhance">
>>>        <echo>Run JDORI enhancer</echo>
>>>        <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
>>>              classname="${jdo.enhancer.main}"
>>>              classpath="${jdo.enhancer.classpath}">
>>>             <arg line="${jdo.enhancer.options}"/>
>>>             <arg line="${jdo.pcclasses.files}"/>
>>>             <arg line="${jdo.paclasses.files}"/>
>>>        </java>
>>>    </goal>
>>>
>>>    <goal name="jpoxenhance">
>>>        <!-- Construct FileSet of JDO meta-data files -->
>>>        <fileset dir="${jdo.testclasses.dir}" id="jdo.files"
>>>      
>>>
>>includes="**/*.jd*"/>
>>    
>>
>>>        <pathconvert pathsep=" " property="jdoMetaDataFiles"
>>>      
>>>
>>refid="jdo.files"/>
>>    
>>
>>>        <!-- Run enhancer on JDO files -->
>>>        <java classname="org.jpox.enhancer.JPOXEnhancer"
>>>            failonerror="true"
>>>            fork="true">
>>>            <classpath refid="project.class.path"/>
>>>
>>>            <arg line="${jdoMetaDataFiles}"/>
>>>        </java>
>>>
>>>        <echo>Classes are now JDO-enhanced for JPOX test scenario
>>>      
>>>
>>"${maven.jpoxtest.name}"</echo>
>>    
>>
>>>    </goal>
>>>
>>>    <!-- ================ -->
>>>    <!-- Metadata support -->
>>>    <!-- ================ -->
>>>
>>>    <goal name="usedatastoreidentity">
>>>        <mkdir dir="${jdo.metadata.dir}"/>
>>>        <delete>
>>>            <fileset dir="${jdo.metadata.dir}"
>>>                     includes="**/*.jdo, **/*jdoTest.properties"/>
>>>        </delete>
>>>        <copy todir="${jdo.metadata.dir}">
>>>            <fileset dir="${basedir}/test"
>>>                     includes="**/*jdoTest.properties.d"/>
>>>            <mapper type="glob" from="*jdoTest.properties.d"
>>>      
>>>
>>to="*jdoTest.properties" />
>>    
>>
>>>        </copy>
>>>        <copy todir="${jdo.metadata.dir}">
>>>            <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
>>>            <mapper type="glob" from="*.jdo.d" to="*.jdo" />
>>>        </copy>
>>>    </goal>
>>>
>>>    <goal name="useapplicationidentity">
>>>        <mkdir dir="${jdo.metadata.dir}"/>
>>>        <delete>
>>>            <fileset dir="${jdo.metadata.dir}"
>>>                     includes="**/*.jdo, **/*jdoTest.properties"/>
>>>        </delete>
>>>        <copy todir="${jdo.metadata.dir}">
>>>            <fileset dir="${basedir}/test"
>>>                     includes="**/*jdoTest.properties.a"/>
>>>            <mapper type="glob" from="*jdoTest.properties.a"
>>>      
>>>
>>to="*jdoTest.properties"/>
>>    
>>
>>>        </copy>
>>>        <copy todir="${jdo.metadata.dir}">
>>>            <fileset dir="${basedir}/test" includes="**/*.jdo.a"/>
>>>            <mapper type="glob" from="*.jdo.a" to="*.jdo" />
>>>        </copy>
>>>    </goal>
>>>
>>>    <goal name="copytestmetadata">
>>>        <delete>
>>>            <fileset dir="${jdo.testclasses.dir}"
>>>                     includes="**/*.jdo, **/*jdoTest.properties"/>
>>>        </delete>
>>>        <copy todir="${jdo.testclasses.dir}">
>>>            <fileset dir="${basedir}/test"
>>>                     includes="**/*jdoTest.properties.d"/>
>>>            <mapper type="glob" from="*jdoTest.properties.d"
>>>      
>>>
>>to="*jdoTest.properties" />
>>    
>>
>>>        </copy>
>>>        <copy todir="${jdo.testclasses.dir}">
>>>            <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
>>>            <mapper type="glob" from="*.jdo.d" to="*.jdo" />
>>>        </copy>
>>>    </goal>
>>>
>>>    <!-- ========= -->
>>>    <!-- Classpath -->
>>>    <!-- ========= -->
>>>
>>>    <path id="test_iut_jars" >
>>>        <fileset dir="iut_jars" includes="*.jar"/>
>>>    </path>
>>>
>>>    <path id="project.class.path">
>>>        <!-- Directory where enhanced class files are located  -->
>>>        <pathelement location="${enhanced.dir}"/>
>>>        <!-- Directory where .jdo files are located  -->
>>>        <pathelement location="${jdo.metadata.dir}"/>
>>>        <!-- Directory where JDOTCK class files are located  -->
>>>        <pathelement location="${jdo.testclasses.dir}"/>
>>>        <!-- JDO jar file  -->
>>>        <pathelement location="${jdo.jdoapi.jarfile}"/>
>>>        <!-- Jar files for the implementation to be tested -->
>>>        <path refid="test_iut_jars" />
>>>        <!-- JUnit jar file -->
>>>        <pathelement location="${junit.jarfile}"/>
>>>        <!-- Spring jar files -->
>>>        <pathelement location="${spring.jarfile}"/>
>>>        <pathelement location="${logging.jarfile}"/>
>>>        <!-- Jar files for the reference implementation -->
>>>        <pathelement location="${jdo.jdori.jarfile}" />
>>>        <pathelement location="${jdo.jdobtree.jarfile}" />
>>>        <pathelement location="${antlr.jarfile}" />
>>>        <pathelement location="${jta.jarfile}" />
>>>        <pathelement location="${xmlparser}" />
>>>    </path>
>>>
>>>    <!-- ==== -->
>>>    <!-- Misc -->
>>>    <!-- ==== -->
>>>
>>>    <goal name="database">
>>>        <mkdir dir="${jdo.testdir}/database" />
>>>    </goal>
>>>
>>>    <goal name="testrunner.set">
>>>       <condition property="jdo.testrunnerclass"
>>>                  value="org.apache.jdo.tck.util.SwingTestRunner">
>>>           <istrue value="${gui}"/>
>>>       </condition>
>>>       <condition property="jdo.testrunnerclass"
>>>                  value="org.apache.jdo.tck.util.BatchTestRunner">
>>>           <isfalse value="${gui}"/>
>>>       </condition>
>>>    </goal>
>>>
>>>    <goal name="copyloggingprops">
>>>        <copy todir="${jdo.testclasses.dir}" >
>>>            <fileset dir="${basedir}">
>>>               <include name="commons-logging.properties"/>
>>>               <include name="simplelog.properties"/>
>>>               <include name="logging.properties"/>
>>>            </fileset>
>>>        </copy>
>>>    </goal>
>>>
>>></project>
>>>      
>>>
>>--
>>Michael Bouschen		Tech@Spree Engineering GmbH
>>mailto:mbo.tech@spree.de	http://www.tech.spree.de/
>>Tel.:++49/30/235 520-33		Buelowstr. 66
>>Fax.:++49/30/2175 2012		D-10783 Berlin
>>
>>    
>>
>
>
>
>  
>


Re: Steps to running the TCK against jpox & derby

Posted by er...@jpox.org.
> thanks for the maven.xml file with the JPOX enhancer update. The JPOX
> enhancer takes .jdo files as arguments and not the .class files of the
> pc classes, correct?

Correct.

> My idea is to use the JDORI enhancer during build.

In the JPOX Enhancer for JDO 2 we implement the Detachable interface in enhanced
files. That's ok to use the JDORI enhancer if there are no detach/attach tests,
but I can recall from the latest times we tried the JDORI enhancer, there were
still some bugs there. Don't ask me what are they, I can't describe.

 Running the TCK for a
> particular JDO implementation is a separate step having special goals:
> (1) Call 'maven useapplicationidentity' or 'maven usedatastoreidentity'
> to copy the corresponding JDO metadata files.
> (2) Run the enhancer.
> (3) Call 'maven runtck' to start the TCK.
> The project.properties files allows to specify an enhancer different
> from the JDORI enhancer to be called in step (2). I think in your case
> this would be the JPOX enhancer. Today there are only two properties:
> enhancer.main and enhancer.options. So the maven enhancer goal assumes
> the JDO implementation enhancer takes the class files as arguments. The
> maven.xml you sent show that this was a wrong assumption. I will change
> this and add a property enhancer.args to specify class files or metadata
> files.
>
> I know the current documentation is poor, so I need to improve there :-).
>
> Regards Michael
>
> > Hi,
> >
> > Here is the tck11/maven.xml file updated to use the JPOX enhancer.
> >
> > I still can't run the tck because JPOX has a strictly validation of the
> > metadata, and one of these checks needs removal as it was clarified some
> > time ago by the EG that it's not needed.
> >
> > Erik Bengtson
> >
> > -----Original Message-----
> > From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM]
> > Sent: Friday, February 18, 2005 9:52 PM
> > To: jdo-dev@db.apache.org
> > Subject: Re: Steps to running the TCK against jpox & derby
> >
> > Michelle Caisse wrote:
> >
> >
> >>Hi, Michael and others,
> >>
> >>Here's what I've done to get jpox and derby to run against the TCK, to
> >
> >
> >>the point where they need to find tables in the database.
> >>
> >>1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
> >
> >
> > and put derby.jar and derbytools.jar in tck11/iut_jars
> >
> >
> >>2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
> >>3 Edit tck11/project.properties:
> >># iut
> >>iut.properties = ${basedir}/jpox.properties
> >>4. Create jpox.properties:
> >>
> >
> > javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact
> > oryImpl
> >
> >>
> > #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO
> > StorePMF
> >
> >>org.apache.jdo.ConnectionCreate=true
> >>
> >
> > javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv
> > er
> >
> >>javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
> >>#javax.jdo.option.ConnectionURL=fostore:database/fostore
> >>javax.jdo.option.ConnectionUserName=tckuser
> >>javax.jdo.option.ConnectionPassword=tckuser
> >>javax.jdo.option.Optimistic=false
> >>javax.jdo.option.RetainValues=false
> >>javax.jdo.option.RestoreValues=false
> >>5. In the classpath section of tck11/maven.xml, place these lines
> >>BEFORE the JDO jar file lines:
> >>       <!-- Jar files for the implementation to be tested -->
> >>       <path refid="test_iut_jars" />
> >>else  [java] 1)
> >>
> >
> > testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J
> > DOFatalUserException:
> >
> >>JDO 2.0 capabilities cannot be accessed! Please make sure that you do
> >>not have a JDO 1.0 jar in front of the JDO 2 classes in your
> >
> > CLASSPATH.
> >
> >>   [java]      at
> >>
> >
> > org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan
> > agerFactory.java:113)
> >
> >>6. Manually create a derby database.  I'm using iut_jars as the derby
> >>system directory, meaning that it looks there for databases and
> >>derby.properties. I wrote some scripts to create the db.  The
> >>procedure for deleting a derby database is an OS delete operation on
> >>the directory and files.
> >>7. Add the following line to maven.xml in the <goal
> >>name="runtck.single" ...> section:
> >>           <sysproperty key="derby.system.home"
> >>value="${basedir}/iut_jars"/>
> >>
> >>-- Michelle
> >>
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!--
> >
> >     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 default="default"
> >     xmlns:j="jelly:core"
> >     xmlns:ant="jelly:ant"
> >     xmlns:maven="jelly:maven"
> >     >
> >
> >     <!-- ==================== -->
> >     <!-- Default Global Goals -->
> >     <!-- ==================== -->
> >
> >     <goal name="default">
> >         <attainGoal name="jar:install"/>
> >     </goal>
> >
> >     <goal name="build">
> >         <attainGoal name="default"/>
> >     </goal>
> >
> >     <goal name="rebuild">
> >         <attainGoal name="clean"/>
> >         <attainGoal name="build"/>
> >     </goal>
> >
> >     <postGoal name="test:prepare-filesystem">
> >         <mkdir dir="${jdo.testdir}"/>
> >     </postGoal>
> >
> >     <postGoal name="test:compile">
> >         <attainGoal name="copytestmetadata"/>
> >         <attainGoal name="jpoxenhance"/>
> >         <attainGoal name="database"/>
> >     </postGoal>
> >
> >     <goal name="clobber" prereqs="clean">
> >         <delete>
> >             <fileset dir="." defaultexcludes="no" includes="**/*~"/>
> >         </delete>
> >     </goal>
> >
> >     <!-- ================== -->
> >     <!-- Running test cases -->
> >     <!-- ================== -->
> >
> >     <goal name="runtck" prereqs="testrunner.set, database,
> copyloggingprops">
> >         <echo>Run all tck tests from testlist ${jdo.testlist}</echo>
> >         <java fork="yes" dir="${jdo.testdir}"
> >               classname="${jdo.testrunnerclass}">
> >             <classpath refid="project.class.path"/>
> >             <sysproperty key="testlist" value="${jdo.testlist}"/>
> >             <sysproperty key="ResultPrinterClass"
> value="${jdo.resultprinterclass}"/>
> >             <sysproperty key="verbose" value="${verbose}"/>
> >             <sysproperty key="PMFProperties" value="${iut.properties}"/>
> >             <sysproperty key="PMF2Properties"
> value="${basedir}/jdori2.properties"/>
> >         </java>
> >     </goal>
> >
> >     <!-- Run a single tck test. The property testcase defines the name of
> -->
> >     <!-- the tck test class w/o the prefix org.apache.jdo.tck, e.g.
> -->
> >     <!--   maven -Dtest=api.jdohelper.GetObjectId runtck.single       -->
> >     <goal name="runtck.single" prereqs="testrunner.set, database,
> copyloggingprops">
> >         <echo>Run tck test org.apache.jdo.tck.${test}</echo>
> >         <java fork="yes" dir="${jdo.testdir}"
> >               classname="org.apache.jdo.tck.${test}">
> >             <classpath refid="project.class.path"/>
> >             <sysproperty key="ResultPrinterClass"
> value="${jdo.resultprinterclass}"/>
> >             <sysproperty key="verbose" value="${verbose}"/>
> >             <sysproperty key="PMFProperties" value="${iut.properties}"/>
> >             <sysproperty key="PMF2Properties"
> value="${basedir}/jdori2.properties"/>
> >         </java>
> >     </goal>
> >
> >     <!-- ================ -->
> >     <!-- Enhancer support -->
> >     <!-- ================ -->
> >
> >     <preGoal name="enhance">
> >         <available property="metadata.exists" file="${jdo.metadata.dir}"/>
> >         <fail unless="metadata.exists"
> >               message="Metadata directory does not exists, please use goals
> useapplicationdirectory or usedatastoredirectory to setup the metadata."/>
> >         <delete>
> >             <fileset dir="${jdo.testclasses.dir}"
> >                      includes="${jdo.pcclasses.files}
> ${jdo.paclasses.files}"/>
> >             <fileset dir="${jdo.testclasses.dir}"
> >                      includes="**/*.jdo **/*jdoTest.properties"/>
> >         </delete>
> >         <attainGoal name="test:compile"/>
> >         <delete dir="${enhanced.dir}"/>
> >         <mkdir dir="${enhanced.dir}"/>
> >     </preGoal>
> >
> >     <goal name="enhance">
> >         <echo>Run enhancer</echo>
> >         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
> >               classname="${enhancer.main}"
> >               classpathref="project.class.path">
> >              <arg line="${enhancer.options}"/>
> >              <arg line="${jdo.pcclasses.files}"/>
> >              <arg line="${jdo.paclasses.files}"/>
> >         </java>
> >     </goal>
> >
> >     <goal name="jdorienhance">
> >         <echo>Run JDORI enhancer</echo>
> >         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
> >               classname="${jdo.enhancer.main}"
> >               classpath="${jdo.enhancer.classpath}">
> >              <arg line="${jdo.enhancer.options}"/>
> >              <arg line="${jdo.pcclasses.files}"/>
> >              <arg line="${jdo.paclasses.files}"/>
> >         </java>
> >     </goal>
> >
> >     <goal name="jpoxenhance">
> >         <!-- Construct FileSet of JDO meta-data files -->
> >         <fileset dir="${jdo.testclasses.dir}" id="jdo.files"
> includes="**/*.jd*"/>
> >         <pathconvert pathsep=" " property="jdoMetaDataFiles"
> refid="jdo.files"/>
> >
> >
> >         <!-- Run enhancer on JDO files -->
> >         <java classname="org.jpox.enhancer.JPOXEnhancer"
> >             failonerror="true"
> >             fork="true">
> >             <classpath refid="project.class.path"/>
> >
> >             <arg line="${jdoMetaDataFiles}"/>
> >         </java>
> >
> >         <echo>Classes are now JDO-enhanced for JPOX test scenario
> "${maven.jpoxtest.name}"</echo>
> >     </goal>
> >
> >     <!-- ================ -->
> >     <!-- Metadata support -->
> >     <!-- ================ -->
> >
> >     <goal name="usedatastoreidentity">
> >         <mkdir dir="${jdo.metadata.dir}"/>
> >         <delete>
> >             <fileset dir="${jdo.metadata.dir}"
> >                      includes="**/*.jdo, **/*jdoTest.properties"/>
> >         </delete>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test"
> >                      includes="**/*jdoTest.properties.d"/>
> >             <mapper type="glob" from="*jdoTest.properties.d"
> to="*jdoTest.properties" />
> >         </copy>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
> >             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
> >         </copy>
> >     </goal>
> >
> >     <goal name="useapplicationidentity">
> >         <mkdir dir="${jdo.metadata.dir}"/>
> >         <delete>
> >             <fileset dir="${jdo.metadata.dir}"
> >                      includes="**/*.jdo, **/*jdoTest.properties"/>
> >         </delete>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test"
> >                      includes="**/*jdoTest.properties.a"/>
> >             <mapper type="glob" from="*jdoTest.properties.a"
> to="*jdoTest.properties"/>
> >         </copy>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test" includes="**/*.jdo.a"/>
> >             <mapper type="glob" from="*.jdo.a" to="*.jdo" />
> >         </copy>
> >     </goal>
> >
> >     <goal name="copytestmetadata">
> >         <delete>
> >             <fileset dir="${jdo.testclasses.dir}"
> >                      includes="**/*.jdo, **/*jdoTest.properties"/>
> >         </delete>
> >         <copy todir="${jdo.testclasses.dir}">
> >             <fileset dir="${basedir}/test"
> >                      includes="**/*jdoTest.properties.d"/>
> >             <mapper type="glob" from="*jdoTest.properties.d"
> to="*jdoTest.properties" />
> >         </copy>
> >         <copy todir="${jdo.testclasses.dir}">
> >             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
> >             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
> >         </copy>
> >     </goal>
> >
> >     <!-- ========= -->
> >     <!-- Classpath -->
> >     <!-- ========= -->
> >
> >     <path id="test_iut_jars" >
> >         <fileset dir="iut_jars" includes="*.jar"/>
> >     </path>
> >
> >     <path id="project.class.path">
> >         <!-- Directory where enhanced class files are located  -->
> >         <pathelement location="${enhanced.dir}"/>
> >         <!-- Directory where .jdo files are located  -->
> >         <pathelement location="${jdo.metadata.dir}"/>
> >         <!-- Directory where JDOTCK class files are located  -->
> >         <pathelement location="${jdo.testclasses.dir}"/>
> >         <!-- JDO jar file  -->
> >         <pathelement location="${jdo.jdoapi.jarfile}"/>
> >         <!-- Jar files for the implementation to be tested -->
> >         <path refid="test_iut_jars" />
> >         <!-- JUnit jar file -->
> >         <pathelement location="${junit.jarfile}"/>
> >         <!-- Spring jar files -->
> >         <pathelement location="${spring.jarfile}"/>
> >         <pathelement location="${logging.jarfile}"/>
> >         <!-- Jar files for the reference implementation -->
> >         <pathelement location="${jdo.jdori.jarfile}" />
> >         <pathelement location="${jdo.jdobtree.jarfile}" />
> >         <pathelement location="${antlr.jarfile}" />
> >         <pathelement location="${jta.jarfile}" />
> >         <pathelement location="${xmlparser}" />
> >     </path>
> >
> >     <!-- ==== -->
> >     <!-- Misc -->
> >     <!-- ==== -->
> >
> >     <goal name="database">
> >         <mkdir dir="${jdo.testdir}/database" />
> >     </goal>
> >
> >     <goal name="testrunner.set">
> >        <condition property="jdo.testrunnerclass"
> >                   value="org.apache.jdo.tck.util.SwingTestRunner">
> >            <istrue value="${gui}"/>
> >        </condition>
> >        <condition property="jdo.testrunnerclass"
> >                   value="org.apache.jdo.tck.util.BatchTestRunner">
> >            <isfalse value="${gui}"/>
> >        </condition>
> >     </goal>
> >
> >     <goal name="copyloggingprops">
> >         <copy todir="${jdo.testclasses.dir}" >
> >             <fileset dir="${basedir}">
> >                <include name="commons-logging.properties"/>
> >                <include name="simplelog.properties"/>
> >                <include name="logging.properties"/>
> >             </fileset>
> >         </copy>
> >     </goal>
> >
> > </project>
>
>
> --
> Michael Bouschen		Tech@Spree Engineering GmbH
> mailto:mbo.tech@spree.de	http://www.tech.spree.de/
> Tel.:++49/30/235 520-33		Buelowstr. 66
> Fax.:++49/30/2175 2012		D-10783 Berlin
>




Re: Steps to running the TCK against jpox & derby

Posted by Michael Bouschen <mb...@spree.de>.
Hi Eric,

thanks for the maven.xml file with the JPOX enhancer update. The JPOX 
enhancer takes .jdo files as arguments and not the .class files of the 
pc classes, correct?

My idea is to use the JDORI enhancer during build. Running the TCK for a 
particular JDO implementation is a separate step having special goals:
(1) Call 'maven useapplicationidentity' or 'maven usedatastoreidentity' 
to copy the corresponding JDO metadata files.
(2) Run the enhancer.
(3) Call 'maven runtck' to start the TCK.
The project.properties files allows to specify an enhancer different 
from the JDORI enhancer to be called in step (2). I think in your case 
this would be the JPOX enhancer. Today there are only two properties: 
enhancer.main and enhancer.options. So the maven enhancer goal assumes 
the JDO implementation enhancer takes the class files as arguments. The 
maven.xml you sent show that this was a wrong assumption. I will change 
this and add a property enhancer.args to specify class files or metadata 
files.

I know the current documentation is poor, so I need to improve there :-).

Regards Michael

> Hi,
> 
> Here is the tck11/maven.xml file updated to use the JPOX enhancer.
> 
> I still can't run the tck because JPOX has a strictly validation of the
> metadata, and one of these checks needs removal as it was clarified some
> time ago by the EG that it's not needed.
> 
> Erik Bengtson 
> 
> -----Original Message-----
> From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM] 
> Sent: Friday, February 18, 2005 9:52 PM
> To: jdo-dev@db.apache.org
> Subject: Re: Steps to running the TCK against jpox & derby
> 
> Michelle Caisse wrote:
> 
> 
>>Hi, Michael and others,
>>
>>Here's what I've done to get jpox and derby to run against the TCK, to
> 
> 
>>the point where they need to find tables in the database.
>>
>>1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
> 
> 
> and put derby.jar and derbytools.jar in tck11/iut_jars
> 
> 
>>2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>>3 Edit tck11/project.properties:
>># iut
>>iut.properties = ${basedir}/jpox.properties
>>4. Create jpox.properties:
>>
> 
> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact
> oryImpl 
> 
>>
> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO
> StorePMF 
> 
>>org.apache.jdo.ConnectionCreate=true
>>
> 
> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv
> er 
> 
>>javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>>#javax.jdo.option.ConnectionURL=fostore:database/fostore
>>javax.jdo.option.ConnectionUserName=tckuser
>>javax.jdo.option.ConnectionPassword=tckuser
>>javax.jdo.option.Optimistic=false
>>javax.jdo.option.RetainValues=false
>>javax.jdo.option.RestoreValues=false
>>5. In the classpath section of tck11/maven.xml, place these lines 
>>BEFORE the JDO jar file lines:
>>       <!-- Jar files for the implementation to be tested -->
>>       <path refid="test_iut_jars" />
>>else  [java] 1) 
>>
> 
> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J
> DOFatalUserException: 
> 
>>JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
>>not have a JDO 1.0 jar in front of the JDO 2 classes in your
> 
> CLASSPATH.
> 
>>   [java]      at 
>>
> 
> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan
> agerFactory.java:113) 
> 
>>6. Manually create a derby database.  I'm using iut_jars as the derby 
>>system directory, meaning that it looks there for databases and 
>>derby.properties. I wrote some scripts to create the db.  The 
>>procedure for deleting a derby database is an OS delete operation on 
>>the directory and files.
>>7. Add the following line to maven.xml in the <goal 
>>name="runtck.single" ...> section:
>>           <sysproperty key="derby.system.home" 
>>value="${basedir}/iut_jars"/>
>>
>>-- Michelle
>>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> 
>     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 default="default"
>     xmlns:j="jelly:core"
>     xmlns:ant="jelly:ant"
>     xmlns:maven="jelly:maven"
>     >
> 
>     <!-- ==================== -->
>     <!-- Default Global Goals -->
>     <!-- ==================== -->
> 
>     <goal name="default">
>         <attainGoal name="jar:install"/>
>     </goal>
> 
>     <goal name="build">
>         <attainGoal name="default"/>
>     </goal>
> 
>     <goal name="rebuild">
>         <attainGoal name="clean"/>
>         <attainGoal name="build"/>
>     </goal>
> 
>     <postGoal name="test:prepare-filesystem">
>         <mkdir dir="${jdo.testdir}"/>
>     </postGoal>
> 
>     <postGoal name="test:compile">
>         <attainGoal name="copytestmetadata"/>
>         <attainGoal name="jpoxenhance"/>
>         <attainGoal name="database"/>
>     </postGoal>
> 
>     <goal name="clobber" prereqs="clean">
>         <delete>
>             <fileset dir="." defaultexcludes="no" includes="**/*~"/>
>         </delete>
>     </goal>
> 
>     <!-- ================== -->
>     <!-- Running test cases -->
>     <!-- ================== -->
> 
>     <goal name="runtck" prereqs="testrunner.set, database, copyloggingprops">
>         <echo>Run all tck tests from testlist ${jdo.testlist}</echo>
>         <java fork="yes" dir="${jdo.testdir}" 
>               classname="${jdo.testrunnerclass}">
>             <classpath refid="project.class.path"/>
>             <sysproperty key="testlist" value="${jdo.testlist}"/>
>             <sysproperty key="ResultPrinterClass" value="${jdo.resultprinterclass}"/>
>             <sysproperty key="verbose" value="${verbose}"/>
>             <sysproperty key="PMFProperties" value="${iut.properties}"/>
>             <sysproperty key="PMF2Properties" value="${basedir}/jdori2.properties"/>
>         </java>
>     </goal>
> 
>     <!-- Run a single tck test. The property testcase defines the name of -->
>     <!-- the tck test class w/o the prefix org.apache.jdo.tck, e.g.       --> 
>     <!--   maven -Dtest=api.jdohelper.GetObjectId runtck.single       -->
>     <goal name="runtck.single" prereqs="testrunner.set, database, copyloggingprops">
>         <echo>Run tck test org.apache.jdo.tck.${test}</echo>
>         <java fork="yes" dir="${jdo.testdir}" 
>               classname="org.apache.jdo.tck.${test}">
>             <classpath refid="project.class.path"/>
>             <sysproperty key="ResultPrinterClass" value="${jdo.resultprinterclass}"/>
>             <sysproperty key="verbose" value="${verbose}"/>
>             <sysproperty key="PMFProperties" value="${iut.properties}"/>
>             <sysproperty key="PMF2Properties" value="${basedir}/jdori2.properties"/>
>         </java>
>     </goal>
> 
>     <!-- ================ -->
>     <!-- Enhancer support -->
>     <!-- ================ -->
> 
>     <preGoal name="enhance">
>         <available property="metadata.exists" file="${jdo.metadata.dir}"/>
>         <fail unless="metadata.exists" 
>               message="Metadata directory does not exists, please use goals useapplicationdirectory or usedatastoredirectory to setup the metadata."/>
>         <delete>
>             <fileset dir="${jdo.testclasses.dir}"
>                      includes="${jdo.pcclasses.files} ${jdo.paclasses.files}"/>
>             <fileset dir="${jdo.testclasses.dir}"
>                      includes="**/*.jdo **/*jdoTest.properties"/>
>         </delete>
>         <attainGoal name="test:compile"/>
>         <delete dir="${enhanced.dir}"/>
>         <mkdir dir="${enhanced.dir}"/>
>     </preGoal>
> 
>     <goal name="enhance">
>         <echo>Run enhancer</echo>
>         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
>               classname="${enhancer.main}"
>               classpathref="project.class.path">
>              <arg line="${enhancer.options}"/>
>              <arg line="${jdo.pcclasses.files}"/>
>              <arg line="${jdo.paclasses.files}"/>
>         </java>
>     </goal>
> 
>     <goal name="jdorienhance">
>         <echo>Run JDORI enhancer</echo>
>         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
>               classname="${jdo.enhancer.main}"
>               classpath="${jdo.enhancer.classpath}">
>              <arg line="${jdo.enhancer.options}"/>
>              <arg line="${jdo.pcclasses.files}"/>
>              <arg line="${jdo.paclasses.files}"/>
>         </java>
>     </goal>
>     
>     <goal name="jpoxenhance">
>         <!-- Construct FileSet of JDO meta-data files -->
>         <fileset dir="${jdo.testclasses.dir}" id="jdo.files" includes="**/*.jd*"/>
>         <pathconvert pathsep=" " property="jdoMetaDataFiles" refid="jdo.files"/>
>     
>     
>         <!-- Run enhancer on JDO files -->
>         <java classname="org.jpox.enhancer.JPOXEnhancer"
>             failonerror="true"
>             fork="true">
>             <classpath refid="project.class.path"/>
> 
>             <arg line="${jdoMetaDataFiles}"/>
>         </java>
> 
>         <echo>Classes are now JDO-enhanced for JPOX test scenario "${maven.jpoxtest.name}"</echo>
>     </goal>
>         
>     <!-- ================ -->
>     <!-- Metadata support -->
>     <!-- ================ -->
> 
>     <goal name="usedatastoreidentity">
>         <mkdir dir="${jdo.metadata.dir}"/>
>         <delete>
>             <fileset dir="${jdo.metadata.dir}" 
>                      includes="**/*.jdo, **/*jdoTest.properties"/>
>         </delete>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test" 
>                      includes="**/*jdoTest.properties.d"/>
>             <mapper type="glob" from="*jdoTest.properties.d" to="*jdoTest.properties" />
>         </copy>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
>             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
>         </copy>
>     </goal>
> 
>     <goal name="useapplicationidentity">
>         <mkdir dir="${jdo.metadata.dir}"/>
>         <delete>
>             <fileset dir="${jdo.metadata.dir}"
>                      includes="**/*.jdo, **/*jdoTest.properties"/>
>         </delete>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test"
>                      includes="**/*jdoTest.properties.a"/>
>             <mapper type="glob" from="*jdoTest.properties.a" to="*jdoTest.properties"/>
>         </copy>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test" includes="**/*.jdo.a"/>
>             <mapper type="glob" from="*.jdo.a" to="*.jdo" />
>         </copy>
>     </goal>
>     
>     <goal name="copytestmetadata">
>         <delete>
>             <fileset dir="${jdo.testclasses.dir}" 
>                      includes="**/*.jdo, **/*jdoTest.properties"/>
>         </delete>
>         <copy todir="${jdo.testclasses.dir}">
>             <fileset dir="${basedir}/test" 
>                      includes="**/*jdoTest.properties.d"/>
>             <mapper type="glob" from="*jdoTest.properties.d" to="*jdoTest.properties" />
>         </copy>
>         <copy todir="${jdo.testclasses.dir}">
>             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
>             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
>         </copy>
>     </goal>
> 
>     <!-- ========= -->
>     <!-- Classpath -->
>     <!-- ========= -->
> 
>     <path id="test_iut_jars" >
>         <fileset dir="iut_jars" includes="*.jar"/>
>     </path>
> 
>     <path id="project.class.path">
>         <!-- Directory where enhanced class files are located  -->
>         <pathelement location="${enhanced.dir}"/>
>         <!-- Directory where .jdo files are located  -->
>         <pathelement location="${jdo.metadata.dir}"/>
>         <!-- Directory where JDOTCK class files are located  -->
>         <pathelement location="${jdo.testclasses.dir}"/>
>         <!-- JDO jar file  -->
>         <pathelement location="${jdo.jdoapi.jarfile}"/>
>         <!-- Jar files for the implementation to be tested -->
>         <path refid="test_iut_jars" />
>         <!-- JUnit jar file -->
>         <pathelement location="${junit.jarfile}"/>
>         <!-- Spring jar files -->
>         <pathelement location="${spring.jarfile}"/>
>         <pathelement location="${logging.jarfile}"/>
>         <!-- Jar files for the reference implementation -->
>         <pathelement location="${jdo.jdori.jarfile}" />
>         <pathelement location="${jdo.jdobtree.jarfile}" />
>         <pathelement location="${antlr.jarfile}" />
>         <pathelement location="${jta.jarfile}" />
>         <pathelement location="${xmlparser}" />
>     </path>
> 
>     <!-- ==== -->
>     <!-- Misc -->
>     <!-- ==== -->
> 
>     <goal name="database">
>         <mkdir dir="${jdo.testdir}/database" />
>     </goal>
>     
>     <goal name="testrunner.set">
>        <condition property="jdo.testrunnerclass" 
>                   value="org.apache.jdo.tck.util.SwingTestRunner">
>            <istrue value="${gui}"/>
>        </condition>
>        <condition property="jdo.testrunnerclass" 
>                   value="org.apache.jdo.tck.util.BatchTestRunner">
>            <isfalse value="${gui}"/>
>        </condition>
>     </goal>
> 
>     <goal name="copyloggingprops">
>         <copy todir="${jdo.testclasses.dir}" >
>             <fileset dir="${basedir}">
>                <include name="commons-logging.properties"/>
>                <include name="simplelog.properties"/>
>                <include name="logging.properties"/>
>             </fileset>
>         </copy>
>     </goal>
> 
> </project>


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Re: Steps to running the TCK against jpox & derby

Posted by er...@jpox.org.
Michael,

The jdo files should be ok. I will review tonight what's need from JPOX to run
the tck. There was a wrong interpretation in JPOX implementation about field
modifiers and we have to correct it.

Regards,

Erik Bengtson

Quoting Michael Bouschen <mb...@spree.de>:

> Hi Erik,
>
> you mentioned some problem with the metadata below. Is there anything
> wrong with the .jdo files? I'm happy to fix any bug in the .jdo files.
>
> Regards Michael
>
> > Hi,
> >
> > Here is the tck11/maven.xml file updated to use the JPOX enhancer.
> >
> > I still can't run the tck because JPOX has a strictly validation of the
> > metadata, and one of these checks needs removal as it was clarified some
> > time ago by the EG that it's not needed.
> >
> > Erik Bengtson
> >
> > -----Original Message-----
> > From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM]
> > Sent: Friday, February 18, 2005 9:52 PM
> > To: jdo-dev@db.apache.org
> > Subject: Re: Steps to running the TCK against jpox & derby
> >
> > Michelle Caisse wrote:
> >
> >
> >>Hi, Michael and others,
> >>
> >>Here's what I've done to get jpox and derby to run against the TCK, to
> >
> >
> >>the point where they need to find tables in the database.
> >>
> >>1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
> >
> >
> > and put derby.jar and derbytools.jar in tck11/iut_jars
> >
> >
> >>2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
> >>3 Edit tck11/project.properties:
> >># iut
> >>iut.properties = ${basedir}/jpox.properties
> >>4. Create jpox.properties:
> >>
> >
> > javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact
> > oryImpl
> >
> >>
> > #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO
> > StorePMF
> >
> >>org.apache.jdo.ConnectionCreate=true
> >>
> >
> > javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv
> > er
> >
> >>javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
> >>#javax.jdo.option.ConnectionURL=fostore:database/fostore
> >>javax.jdo.option.ConnectionUserName=tckuser
> >>javax.jdo.option.ConnectionPassword=tckuser
> >>javax.jdo.option.Optimistic=false
> >>javax.jdo.option.RetainValues=false
> >>javax.jdo.option.RestoreValues=false
> >>5. In the classpath section of tck11/maven.xml, place these lines
> >>BEFORE the JDO jar file lines:
> >>       <!-- Jar files for the implementation to be tested -->
> >>       <path refid="test_iut_jars" />
> >>else  [java] 1)
> >>
> >
> > testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J
> > DOFatalUserException:
> >
> >>JDO 2.0 capabilities cannot be accessed! Please make sure that you do
> >>not have a JDO 1.0 jar in front of the JDO 2 classes in your
> >
> > CLASSPATH.
> >
> >>   [java]      at
> >>
> >
> > org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan
> > agerFactory.java:113)
> >
> >>6. Manually create a derby database.  I'm using iut_jars as the derby
> >>system directory, meaning that it looks there for databases and
> >>derby.properties. I wrote some scripts to create the db.  The
> >>procedure for deleting a derby database is an OS delete operation on
> >>the directory and files.
> >>7. Add the following line to maven.xml in the <goal
> >>name="runtck.single" ...> section:
> >>           <sysproperty key="derby.system.home"
> >>value="${basedir}/iut_jars"/>
> >>
> >>-- Michelle
> >>
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!--
> >
> >     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 default="default"
> >     xmlns:j="jelly:core"
> >     xmlns:ant="jelly:ant"
> >     xmlns:maven="jelly:maven"
> >     >
> >
> >     <!-- ==================== -->
> >     <!-- Default Global Goals -->
> >     <!-- ==================== -->
> >
> >     <goal name="default">
> >         <attainGoal name="jar:install"/>
> >     </goal>
> >
> >     <goal name="build">
> >         <attainGoal name="default"/>
> >     </goal>
> >
> >     <goal name="rebuild">
> >         <attainGoal name="clean"/>
> >         <attainGoal name="build"/>
> >     </goal>
> >
> >     <postGoal name="test:prepare-filesystem">
> >         <mkdir dir="${jdo.testdir}"/>
> >     </postGoal>
> >
> >     <postGoal name="test:compile">
> >         <attainGoal name="copytestmetadata"/>
> >         <attainGoal name="jpoxenhance"/>
> >         <attainGoal name="database"/>
> >     </postGoal>
> >
> >     <goal name="clobber" prereqs="clean">
> >         <delete>
> >             <fileset dir="." defaultexcludes="no" includes="**/*~"/>
> >         </delete>
> >     </goal>
> >
> >     <!-- ================== -->
> >     <!-- Running test cases -->
> >     <!-- ================== -->
> >
> >     <goal name="runtck" prereqs="testrunner.set, database,
> copyloggingprops">
> >         <echo>Run all tck tests from testlist ${jdo.testlist}</echo>
> >         <java fork="yes" dir="${jdo.testdir}"
> >               classname="${jdo.testrunnerclass}">
> >             <classpath refid="project.class.path"/>
> >             <sysproperty key="testlist" value="${jdo.testlist}"/>
> >             <sysproperty key="ResultPrinterClass"
> value="${jdo.resultprinterclass}"/>
> >             <sysproperty key="verbose" value="${verbose}"/>
> >             <sysproperty key="PMFProperties" value="${iut.properties}"/>
> >             <sysproperty key="PMF2Properties"
> value="${basedir}/jdori2.properties"/>
> >         </java>
> >     </goal>
> >
> >     <!-- Run a single tck test. The property testcase defines the name of
> -->
> >     <!-- the tck test class w/o the prefix org.apache.jdo.tck, e.g.
> -->
> >     <!--   maven -Dtest=api.jdohelper.GetObjectId runtck.single       -->
> >     <goal name="runtck.single" prereqs="testrunner.set, database,
> copyloggingprops">
> >         <echo>Run tck test org.apache.jdo.tck.${test}</echo>
> >         <java fork="yes" dir="${jdo.testdir}"
> >               classname="org.apache.jdo.tck.${test}">
> >             <classpath refid="project.class.path"/>
> >             <sysproperty key="ResultPrinterClass"
> value="${jdo.resultprinterclass}"/>
> >             <sysproperty key="verbose" value="${verbose}"/>
> >             <sysproperty key="PMFProperties" value="${iut.properties}"/>
> >             <sysproperty key="PMF2Properties"
> value="${basedir}/jdori2.properties"/>
> >         </java>
> >     </goal>
> >
> >     <!-- ================ -->
> >     <!-- Enhancer support -->
> >     <!-- ================ -->
> >
> >     <preGoal name="enhance">
> >         <available property="metadata.exists" file="${jdo.metadata.dir}"/>
> >         <fail unless="metadata.exists"
> >               message="Metadata directory does not exists, please use goals
> useapplicationdirectory or usedatastoredirectory to setup the metadata."/>
> >         <delete>
> >             <fileset dir="${jdo.testclasses.dir}"
> >                      includes="${jdo.pcclasses.files}
> ${jdo.paclasses.files}"/>
> >             <fileset dir="${jdo.testclasses.dir}"
> >                      includes="**/*.jdo **/*jdoTest.properties"/>
> >         </delete>
> >         <attainGoal name="test:compile"/>
> >         <delete dir="${enhanced.dir}"/>
> >         <mkdir dir="${enhanced.dir}"/>
> >     </preGoal>
> >
> >     <goal name="enhance">
> >         <echo>Run enhancer</echo>
> >         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
> >               classname="${enhancer.main}"
> >               classpathref="project.class.path">
> >              <arg line="${enhancer.options}"/>
> >              <arg line="${jdo.pcclasses.files}"/>
> >              <arg line="${jdo.paclasses.files}"/>
> >         </java>
> >     </goal>
> >
> >     <goal name="jdorienhance">
> >         <echo>Run JDORI enhancer</echo>
> >         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
> >               classname="${jdo.enhancer.main}"
> >               classpath="${jdo.enhancer.classpath}">
> >              <arg line="${jdo.enhancer.options}"/>
> >              <arg line="${jdo.pcclasses.files}"/>
> >              <arg line="${jdo.paclasses.files}"/>
> >         </java>
> >     </goal>
> >
> >     <goal name="jpoxenhance">
> >         <!-- Construct FileSet of JDO meta-data files -->
> >         <fileset dir="${jdo.testclasses.dir}" id="jdo.files"
> includes="**/*.jd*"/>
> >         <pathconvert pathsep=" " property="jdoMetaDataFiles"
> refid="jdo.files"/>
> >
> >
> >         <!-- Run enhancer on JDO files -->
> >         <java classname="org.jpox.enhancer.JPOXEnhancer"
> >             failonerror="true"
> >             fork="true">
> >             <classpath refid="project.class.path"/>
> >
> >             <arg line="${jdoMetaDataFiles}"/>
> >         </java>
> >
> >         <echo>Classes are now JDO-enhanced for JPOX test scenario
> "${maven.jpoxtest.name}"</echo>
> >     </goal>
> >
> >     <!-- ================ -->
> >     <!-- Metadata support -->
> >     <!-- ================ -->
> >
> >     <goal name="usedatastoreidentity">
> >         <mkdir dir="${jdo.metadata.dir}"/>
> >         <delete>
> >             <fileset dir="${jdo.metadata.dir}"
> >                      includes="**/*.jdo, **/*jdoTest.properties"/>
> >         </delete>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test"
> >                      includes="**/*jdoTest.properties.d"/>
> >             <mapper type="glob" from="*jdoTest.properties.d"
> to="*jdoTest.properties" />
> >         </copy>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
> >             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
> >         </copy>
> >     </goal>
> >
> >     <goal name="useapplicationidentity">
> >         <mkdir dir="${jdo.metadata.dir}"/>
> >         <delete>
> >             <fileset dir="${jdo.metadata.dir}"
> >                      includes="**/*.jdo, **/*jdoTest.properties"/>
> >         </delete>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test"
> >                      includes="**/*jdoTest.properties.a"/>
> >             <mapper type="glob" from="*jdoTest.properties.a"
> to="*jdoTest.properties"/>
> >         </copy>
> >         <copy todir="${jdo.metadata.dir}">
> >             <fileset dir="${basedir}/test" includes="**/*.jdo.a"/>
> >             <mapper type="glob" from="*.jdo.a" to="*.jdo" />
> >         </copy>
> >     </goal>
> >
> >     <goal name="copytestmetadata">
> >         <delete>
> >             <fileset dir="${jdo.testclasses.dir}"
> >                      includes="**/*.jdo, **/*jdoTest.properties"/>
> >         </delete>
> >         <copy todir="${jdo.testclasses.dir}">
> >             <fileset dir="${basedir}/test"
> >                      includes="**/*jdoTest.properties.d"/>
> >             <mapper type="glob" from="*jdoTest.properties.d"
> to="*jdoTest.properties" />
> >         </copy>
> >         <copy todir="${jdo.testclasses.dir}">
> >             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
> >             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
> >         </copy>
> >     </goal>
> >
> >     <!-- ========= -->
> >     <!-- Classpath -->
> >     <!-- ========= -->
> >
> >     <path id="test_iut_jars" >
> >         <fileset dir="iut_jars" includes="*.jar"/>
> >     </path>
> >
> >     <path id="project.class.path">
> >         <!-- Directory where enhanced class files are located  -->
> >         <pathelement location="${enhanced.dir}"/>
> >         <!-- Directory where .jdo files are located  -->
> >         <pathelement location="${jdo.metadata.dir}"/>
> >         <!-- Directory where JDOTCK class files are located  -->
> >         <pathelement location="${jdo.testclasses.dir}"/>
> >         <!-- JDO jar file  -->
> >         <pathelement location="${jdo.jdoapi.jarfile}"/>
> >         <!-- Jar files for the implementation to be tested -->
> >         <path refid="test_iut_jars" />
> >         <!-- JUnit jar file -->
> >         <pathelement location="${junit.jarfile}"/>
> >         <!-- Spring jar files -->
> >         <pathelement location="${spring.jarfile}"/>
> >         <pathelement location="${logging.jarfile}"/>
> >         <!-- Jar files for the reference implementation -->
> >         <pathelement location="${jdo.jdori.jarfile}" />
> >         <pathelement location="${jdo.jdobtree.jarfile}" />
> >         <pathelement location="${antlr.jarfile}" />
> >         <pathelement location="${jta.jarfile}" />
> >         <pathelement location="${xmlparser}" />
> >     </path>
> >
> >     <!-- ==== -->
> >     <!-- Misc -->
> >     <!-- ==== -->
> >
> >     <goal name="database">
> >         <mkdir dir="${jdo.testdir}/database" />
> >     </goal>
> >
> >     <goal name="testrunner.set">
> >        <condition property="jdo.testrunnerclass"
> >                   value="org.apache.jdo.tck.util.SwingTestRunner">
> >            <istrue value="${gui}"/>
> >        </condition>
> >        <condition property="jdo.testrunnerclass"
> >                   value="org.apache.jdo.tck.util.BatchTestRunner">
> >            <isfalse value="${gui}"/>
> >        </condition>
> >     </goal>
> >
> >     <goal name="copyloggingprops">
> >         <copy todir="${jdo.testclasses.dir}" >
> >             <fileset dir="${basedir}">
> >                <include name="commons-logging.properties"/>
> >                <include name="simplelog.properties"/>
> >                <include name="logging.properties"/>
> >             </fileset>
> >         </copy>
> >     </goal>
> >
> > </project>
>
>
> --
> Michael Bouschen		Tech@Spree Engineering GmbH
> mailto:mbo.tech@spree.de	http://www.tech.spree.de/
> Tel.:++49/30/235 520-33		Buelowstr. 66
> Fax.:++49/30/2175 2012		D-10783 Berlin
>




Re: Steps to running the TCK against jpox & derby

Posted by Michael Bouschen <mb...@spree.de>.
Hi Erik,

you mentioned some problem with the metadata below. Is there anything 
wrong with the .jdo files? I'm happy to fix any bug in the .jdo files.

Regards Michael

> Hi,
> 
> Here is the tck11/maven.xml file updated to use the JPOX enhancer.
> 
> I still can't run the tck because JPOX has a strictly validation of the
> metadata, and one of these checks needs removal as it was clarified some
> time ago by the EG that it's not needed.
> 
> Erik Bengtson 
> 
> -----Original Message-----
> From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM] 
> Sent: Friday, February 18, 2005 9:52 PM
> To: jdo-dev@db.apache.org
> Subject: Re: Steps to running the TCK against jpox & derby
> 
> Michelle Caisse wrote:
> 
> 
>>Hi, Michael and others,
>>
>>Here's what I've done to get jpox and derby to run against the TCK, to
> 
> 
>>the point where they need to find tables in the database.
>>
>>1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
> 
> 
> and put derby.jar and derbytools.jar in tck11/iut_jars
> 
> 
>>2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>>3 Edit tck11/project.properties:
>># iut
>>iut.properties = ${basedir}/jpox.properties
>>4. Create jpox.properties:
>>
> 
> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact
> oryImpl 
> 
>>
> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO
> StorePMF 
> 
>>org.apache.jdo.ConnectionCreate=true
>>
> 
> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv
> er 
> 
>>javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>>#javax.jdo.option.ConnectionURL=fostore:database/fostore
>>javax.jdo.option.ConnectionUserName=tckuser
>>javax.jdo.option.ConnectionPassword=tckuser
>>javax.jdo.option.Optimistic=false
>>javax.jdo.option.RetainValues=false
>>javax.jdo.option.RestoreValues=false
>>5. In the classpath section of tck11/maven.xml, place these lines 
>>BEFORE the JDO jar file lines:
>>       <!-- Jar files for the implementation to be tested -->
>>       <path refid="test_iut_jars" />
>>else  [java] 1) 
>>
> 
> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J
> DOFatalUserException: 
> 
>>JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
>>not have a JDO 1.0 jar in front of the JDO 2 classes in your
> 
> CLASSPATH.
> 
>>   [java]      at 
>>
> 
> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan
> agerFactory.java:113) 
> 
>>6. Manually create a derby database.  I'm using iut_jars as the derby 
>>system directory, meaning that it looks there for databases and 
>>derby.properties. I wrote some scripts to create the db.  The 
>>procedure for deleting a derby database is an OS delete operation on 
>>the directory and files.
>>7. Add the following line to maven.xml in the <goal 
>>name="runtck.single" ...> section:
>>           <sysproperty key="derby.system.home" 
>>value="${basedir}/iut_jars"/>
>>
>>-- Michelle
>>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> 
>     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 default="default"
>     xmlns:j="jelly:core"
>     xmlns:ant="jelly:ant"
>     xmlns:maven="jelly:maven"
>     >
> 
>     <!-- ==================== -->
>     <!-- Default Global Goals -->
>     <!-- ==================== -->
> 
>     <goal name="default">
>         <attainGoal name="jar:install"/>
>     </goal>
> 
>     <goal name="build">
>         <attainGoal name="default"/>
>     </goal>
> 
>     <goal name="rebuild">
>         <attainGoal name="clean"/>
>         <attainGoal name="build"/>
>     </goal>
> 
>     <postGoal name="test:prepare-filesystem">
>         <mkdir dir="${jdo.testdir}"/>
>     </postGoal>
> 
>     <postGoal name="test:compile">
>         <attainGoal name="copytestmetadata"/>
>         <attainGoal name="jpoxenhance"/>
>         <attainGoal name="database"/>
>     </postGoal>
> 
>     <goal name="clobber" prereqs="clean">
>         <delete>
>             <fileset dir="." defaultexcludes="no" includes="**/*~"/>
>         </delete>
>     </goal>
> 
>     <!-- ================== -->
>     <!-- Running test cases -->
>     <!-- ================== -->
> 
>     <goal name="runtck" prereqs="testrunner.set, database, copyloggingprops">
>         <echo>Run all tck tests from testlist ${jdo.testlist}</echo>
>         <java fork="yes" dir="${jdo.testdir}" 
>               classname="${jdo.testrunnerclass}">
>             <classpath refid="project.class.path"/>
>             <sysproperty key="testlist" value="${jdo.testlist}"/>
>             <sysproperty key="ResultPrinterClass" value="${jdo.resultprinterclass}"/>
>             <sysproperty key="verbose" value="${verbose}"/>
>             <sysproperty key="PMFProperties" value="${iut.properties}"/>
>             <sysproperty key="PMF2Properties" value="${basedir}/jdori2.properties"/>
>         </java>
>     </goal>
> 
>     <!-- Run a single tck test. The property testcase defines the name of -->
>     <!-- the tck test class w/o the prefix org.apache.jdo.tck, e.g.       --> 
>     <!--   maven -Dtest=api.jdohelper.GetObjectId runtck.single       -->
>     <goal name="runtck.single" prereqs="testrunner.set, database, copyloggingprops">
>         <echo>Run tck test org.apache.jdo.tck.${test}</echo>
>         <java fork="yes" dir="${jdo.testdir}" 
>               classname="org.apache.jdo.tck.${test}">
>             <classpath refid="project.class.path"/>
>             <sysproperty key="ResultPrinterClass" value="${jdo.resultprinterclass}"/>
>             <sysproperty key="verbose" value="${verbose}"/>
>             <sysproperty key="PMFProperties" value="${iut.properties}"/>
>             <sysproperty key="PMF2Properties" value="${basedir}/jdori2.properties"/>
>         </java>
>     </goal>
> 
>     <!-- ================ -->
>     <!-- Enhancer support -->
>     <!-- ================ -->
> 
>     <preGoal name="enhance">
>         <available property="metadata.exists" file="${jdo.metadata.dir}"/>
>         <fail unless="metadata.exists" 
>               message="Metadata directory does not exists, please use goals useapplicationdirectory or usedatastoredirectory to setup the metadata."/>
>         <delete>
>             <fileset dir="${jdo.testclasses.dir}"
>                      includes="${jdo.pcclasses.files} ${jdo.paclasses.files}"/>
>             <fileset dir="${jdo.testclasses.dir}"
>                      includes="**/*.jdo **/*jdoTest.properties"/>
>         </delete>
>         <attainGoal name="test:compile"/>
>         <delete dir="${enhanced.dir}"/>
>         <mkdir dir="${enhanced.dir}"/>
>     </preGoal>
> 
>     <goal name="enhance">
>         <echo>Run enhancer</echo>
>         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
>               classname="${enhancer.main}"
>               classpathref="project.class.path">
>              <arg line="${enhancer.options}"/>
>              <arg line="${jdo.pcclasses.files}"/>
>              <arg line="${jdo.paclasses.files}"/>
>         </java>
>     </goal>
> 
>     <goal name="jdorienhance">
>         <echo>Run JDORI enhancer</echo>
>         <java fork="yes" failonerror="yes" dir="${jdo.testclasses.dir}"
>               classname="${jdo.enhancer.main}"
>               classpath="${jdo.enhancer.classpath}">
>              <arg line="${jdo.enhancer.options}"/>
>              <arg line="${jdo.pcclasses.files}"/>
>              <arg line="${jdo.paclasses.files}"/>
>         </java>
>     </goal>
>     
>     <goal name="jpoxenhance">
>         <!-- Construct FileSet of JDO meta-data files -->
>         <fileset dir="${jdo.testclasses.dir}" id="jdo.files" includes="**/*.jd*"/>
>         <pathconvert pathsep=" " property="jdoMetaDataFiles" refid="jdo.files"/>
>     
>     
>         <!-- Run enhancer on JDO files -->
>         <java classname="org.jpox.enhancer.JPOXEnhancer"
>             failonerror="true"
>             fork="true">
>             <classpath refid="project.class.path"/>
> 
>             <arg line="${jdoMetaDataFiles}"/>
>         </java>
> 
>         <echo>Classes are now JDO-enhanced for JPOX test scenario "${maven.jpoxtest.name}"</echo>
>     </goal>
>         
>     <!-- ================ -->
>     <!-- Metadata support -->
>     <!-- ================ -->
> 
>     <goal name="usedatastoreidentity">
>         <mkdir dir="${jdo.metadata.dir}"/>
>         <delete>
>             <fileset dir="${jdo.metadata.dir}" 
>                      includes="**/*.jdo, **/*jdoTest.properties"/>
>         </delete>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test" 
>                      includes="**/*jdoTest.properties.d"/>
>             <mapper type="glob" from="*jdoTest.properties.d" to="*jdoTest.properties" />
>         </copy>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
>             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
>         </copy>
>     </goal>
> 
>     <goal name="useapplicationidentity">
>         <mkdir dir="${jdo.metadata.dir}"/>
>         <delete>
>             <fileset dir="${jdo.metadata.dir}"
>                      includes="**/*.jdo, **/*jdoTest.properties"/>
>         </delete>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test"
>                      includes="**/*jdoTest.properties.a"/>
>             <mapper type="glob" from="*jdoTest.properties.a" to="*jdoTest.properties"/>
>         </copy>
>         <copy todir="${jdo.metadata.dir}">
>             <fileset dir="${basedir}/test" includes="**/*.jdo.a"/>
>             <mapper type="glob" from="*.jdo.a" to="*.jdo" />
>         </copy>
>     </goal>
>     
>     <goal name="copytestmetadata">
>         <delete>
>             <fileset dir="${jdo.testclasses.dir}" 
>                      includes="**/*.jdo, **/*jdoTest.properties"/>
>         </delete>
>         <copy todir="${jdo.testclasses.dir}">
>             <fileset dir="${basedir}/test" 
>                      includes="**/*jdoTest.properties.d"/>
>             <mapper type="glob" from="*jdoTest.properties.d" to="*jdoTest.properties" />
>         </copy>
>         <copy todir="${jdo.testclasses.dir}">
>             <fileset dir="${basedir}/test" includes="**/*.jdo.d"/>
>             <mapper type="glob" from="*.jdo.d" to="*.jdo" />
>         </copy>
>     </goal>
> 
>     <!-- ========= -->
>     <!-- Classpath -->
>     <!-- ========= -->
> 
>     <path id="test_iut_jars" >
>         <fileset dir="iut_jars" includes="*.jar"/>
>     </path>
> 
>     <path id="project.class.path">
>         <!-- Directory where enhanced class files are located  -->
>         <pathelement location="${enhanced.dir}"/>
>         <!-- Directory where .jdo files are located  -->
>         <pathelement location="${jdo.metadata.dir}"/>
>         <!-- Directory where JDOTCK class files are located  -->
>         <pathelement location="${jdo.testclasses.dir}"/>
>         <!-- JDO jar file  -->
>         <pathelement location="${jdo.jdoapi.jarfile}"/>
>         <!-- Jar files for the implementation to be tested -->
>         <path refid="test_iut_jars" />
>         <!-- JUnit jar file -->
>         <pathelement location="${junit.jarfile}"/>
>         <!-- Spring jar files -->
>         <pathelement location="${spring.jarfile}"/>
>         <pathelement location="${logging.jarfile}"/>
>         <!-- Jar files for the reference implementation -->
>         <pathelement location="${jdo.jdori.jarfile}" />
>         <pathelement location="${jdo.jdobtree.jarfile}" />
>         <pathelement location="${antlr.jarfile}" />
>         <pathelement location="${jta.jarfile}" />
>         <pathelement location="${xmlparser}" />
>     </path>
> 
>     <!-- ==== -->
>     <!-- Misc -->
>     <!-- ==== -->
> 
>     <goal name="database">
>         <mkdir dir="${jdo.testdir}/database" />
>     </goal>
>     
>     <goal name="testrunner.set">
>        <condition property="jdo.testrunnerclass" 
>                   value="org.apache.jdo.tck.util.SwingTestRunner">
>            <istrue value="${gui}"/>
>        </condition>
>        <condition property="jdo.testrunnerclass" 
>                   value="org.apache.jdo.tck.util.BatchTestRunner">
>            <isfalse value="${gui}"/>
>        </condition>
>     </goal>
> 
>     <goal name="copyloggingprops">
>         <copy todir="${jdo.testclasses.dir}" >
>             <fileset dir="${basedir}">
>                <include name="commons-logging.properties"/>
>                <include name="simplelog.properties"/>
>                <include name="logging.properties"/>
>             </fileset>
>         </copy>
>     </goal>
> 
> </project>


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

RE: Steps to running the TCK against jpox & derby

Posted by er...@jpox.org.
Hi,

Here is the tck11/maven.xml file updated to use the JPOX enhancer.

I still can't run the tck because JPOX has a strictly validation of the
metadata, and one of these checks needs removal as it was clarified some
time ago by the EG that it's not needed.

Erik Bengtson 

-----Original Message-----
From: Michelle Caisse [mailto:Michelle.Caisse@Sun.COM] 
Sent: Friday, February 18, 2005 9:52 PM
To: jdo-dev@db.apache.org
Subject: Re: Steps to running the TCK against jpox & derby

Michelle Caisse wrote:

> Hi, Michael and others,
>
> Here's what I've done to get jpox and derby to run against the TCK, to

> the point where they need to find tables in the database.
>
> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.

and put derby.jar and derbytools.jar in tck11/iut_jars

> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
> 3 Edit tck11/project.properties:
> # iut
> iut.properties = ${basedir}/jpox.properties
> 4. Create jpox.properties:
>
javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFact
oryImpl 
>
>
#javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FO
StorePMF 
>
> org.apache.jdo.ConnectionCreate=true
>
javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriv
er 
>
> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
> #javax.jdo.option.ConnectionURL=fostore:database/fostore
> javax.jdo.option.ConnectionUserName=tckuser
> javax.jdo.option.ConnectionPassword=tckuser
> javax.jdo.option.Optimistic=false
> javax.jdo.option.RetainValues=false
> javax.jdo.option.RestoreValues=false
> 5. In the classpath section of tck11/maven.xml, place these lines 
> BEFORE the JDO jar file lines:
>        <!-- Jar files for the implementation to be tested -->
>        <path refid="test_iut_jars" />
> else  [java] 1) 
>
testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.J
DOFatalUserException: 
> JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
> not have a JDO 1.0 jar in front of the JDO 2 classes in your
CLASSPATH.
>    [java]      at 
>
org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceMan
agerFactory.java:113) 
>
> 6. Manually create a derby database.  I'm using iut_jars as the derby 
> system directory, meaning that it looks there for databases and 
> derby.properties. I wrote some scripts to create the db.  The 
> procedure for deleting a derby database is an OS delete operation on 
> the directory and files.
> 7. Add the following line to maven.xml in the <goal 
> name="runtck.single" ...> section:
>            <sysproperty key="derby.system.home" 
> value="${basedir}/iut_jars"/>
>
> -- Michelle
>


Re: Steps to running the TCK against jpox & derby

Posted by Michelle Caisse <Mi...@Sun.COM>.
Michelle Caisse wrote:

> Hi, Michael and others,
>
> Here's what I've done to get jpox and derby to run against the TCK, to 
> the point where they need to find tables in the database.
>
> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.

and put derby.jar and derbytools.jar in tck11/iut_jars

> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
> 3 Edit tck11/project.properties:
> # iut
> iut.properties = ${basedir}/jpox.properties
> 4. Create jpox.properties:
> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl 
>
> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FOStorePMF 
>
> org.apache.jdo.ConnectionCreate=true
> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver 
>
> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
> #javax.jdo.option.ConnectionURL=fostore:database/fostore
> javax.jdo.option.ConnectionUserName=tckuser
> javax.jdo.option.ConnectionPassword=tckuser
> javax.jdo.option.Optimistic=false
> javax.jdo.option.RetainValues=false
> javax.jdo.option.RestoreValues=false
> 5. In the classpath section of tck11/maven.xml, place these lines 
> BEFORE the JDO jar file lines:
>        <!-- Jar files for the implementation to be tested -->
>        <path refid="test_iut_jars" />
> else  [java] 1) 
> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.JDOFatalUserException: 
> JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
> not have a JDO 1.0 jar in front of the JDO 2 classes in your CLASSPATH.
>    [java]      at 
> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceManagerFactory.java:113) 
>
> 6. Manually create a derby database.  I'm using iut_jars as the derby 
> system directory, meaning that it looks there for databases and 
> derby.properties. I wrote some scripts to create the db.  The 
> procedure for deleting a derby database is an OS delete operation on 
> the directory and files.
> 7. Add the following line to maven.xml in the <goal 
> name="runtck.single" ...> section:
>            <sysproperty key="derby.system.home" 
> value="${basedir}/iut_jars"/>
>
> -- Michelle
>


Re: Steps to running the TCK against jpox & derby

Posted by Michelle Caisse <Mi...@Sun.COM>.
Michael Bouschen wrote:

> Hi Michelle,
>
> please find two comments below.
>
>> Hi, Michael and others,
>>
>> Here's what I've done to get jpox and derby to run against the TCK, 
>> to the point where they need to find tables in the database.
>>
>> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
>> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
>> 3 Edit tck11/project.properties:
>> # iut
>> iut.properties = ${basedir}/jpox.properties
>> 4. Create jpox.properties:
>> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl 
>>
>> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FOStorePMF 
>>
>> org.apache.jdo.ConnectionCreate=true
>> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver 
>>
>> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
>> #javax.jdo.option.ConnectionURL=fostore:database/fostore
>> javax.jdo.option.ConnectionUserName=tckuser
>> javax.jdo.option.ConnectionPassword=tckuser
>> javax.jdo.option.Optimistic=false
>> javax.jdo.option.RetainValues=false
>> javax.jdo.option.RestoreValues=false
>> 5. In the classpath section of tck11/maven.xml, place these lines 
>> BEFORE the JDO jar file lines:
>>        <!-- Jar files for the implementation to be tested -->
>>        <path refid="test_iut_jars" />
>> else  [java] 1) 
>> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.JDOFatalUserException: 
>> JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
>> not have a JDO 1.0 jar in front of the JDO 2 classes in your CLASSPATH.
>>    [java]      at 
>> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceManagerFactory.java:113) 
>
>
>
> I hope this issue is gone as soon as we have a api20 subproject that 
> creates a jar with the JDO 2.0 API. I think a JDO implementation has 
> to pass the TCK using the official JDO API jar. But this is a special 
> situation because you run a JDO 2.0 preview implementation against the 
> 1.1 TCK.

Yes, that's right. We currently need to do this for testing.

>
>>
>> 6. Manually create a derby database.  I'm using iut_jars as the derby 
>> system directory, meaning that it looks there for databases and 
>> derby.properties. I wrote some scripts to create the db.  The 
>> procedure for deleting a derby database is an OS delete operation on 
>> the directory and files.
>> 7. Add the following line to maven.xml in the <goal 
>> name="runtck.single" ...> section:
>>            <sysproperty key="derby.system.home" 
>> value="${basedir}/iut_jars"/>
>
>
> This is a good catch! We need a way to allow IUT specific system 
> properties to be set when running the tck. I propose the following 
> solution:
> - Add the following line to the file project.properties:
> iut.sysproperties = -Dderby.system.home=${basedir}/iut_jars"
> A good place is after the definition of the property iut.properties.
> - Add the following line to the goals runtck.single and runtck:
> <jvmarg line="${iut.sysproperties}"/>
> It replaces the new sysproperty setting. This allow specifying one or 
> more system properties in project.properties w/o changing the 
> maven.xml. What do you think?

Yes, I think this is fine. 

-- Michelle

>
> Regards Michael
>
>>
>> -- Michelle
>>
>
>


Re: Steps to running the TCK against jpox & derby

Posted by Michael Bouschen <mb...@spree.de>.
Hi Michelle,

please find two comments below.

> Hi, Michael and others,
> 
> Here's what I've done to get jpox and derby to run against the TCK, to 
> the point where they need to find tables in the database.
> 
> 1. Put jpox-1.1.0-beta-1.jar in tck11/iut_jars.
> 2. Put log4j-1.2.9.jar in tck11/iut_jars. (jpox needed this.)
> 3 Edit tck11/project.properties:
> # iut
> iut.properties = ${basedir}/jpox.properties
> 4. Create jpox.properties:
> javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl 
> 
> #javax.jdo.PersistenceManagerFactoryClass=org.apache.jdo.impl.fostore.FOStorePMF 
> 
> org.apache.jdo.ConnectionCreate=true
> javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver
> javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb
> #javax.jdo.option.ConnectionURL=fostore:database/fostore
> javax.jdo.option.ConnectionUserName=tckuser
> javax.jdo.option.ConnectionPassword=tckuser
> javax.jdo.option.Optimistic=false
> javax.jdo.option.RetainValues=false
> javax.jdo.option.RestoreValues=false
> 5. In the classpath section of tck11/maven.xml, place these lines BEFORE 
> the JDO jar file lines:
>        <!-- Jar files for the implementation to be tested -->
>        <path refid="test_iut_jars" />
> else  [java] 1) 
> testGetObjectId(org.apache.jdo.tck.api.jdohelper.GetObjectId)javax.jdo.JDOFatalUserException: 
> JDO 2.0 capabilities cannot be accessed! Please make sure that you do 
> not have a JDO 1.0 jar in front of the JDO 2 classes in your CLASSPATH.
>    [java]      at 
> org.jpox.AbstractPersistenceManagerFactory.<init>(AbstractPersistenceManagerFactory.java:113) 

I hope this issue is gone as soon as we have a api20 subproject that 
creates a jar with the JDO 2.0 API. I think a JDO implementation has to 
pass the TCK using the official JDO API jar. But this is a special 
situation because you run a JDO 2.0 preview implementation against the 
1.1 TCK.

> 
> 6. Manually create a derby database.  I'm using iut_jars as the derby 
> system directory, meaning that it looks there for databases and 
> derby.properties. I wrote some scripts to create the db.  The procedure 
> for deleting a derby database is an OS delete operation on the directory 
> and files.
> 7. Add the following line to maven.xml in the <goal name="runtck.single" 
> ...> section:
>            <sysproperty key="derby.system.home" 
> value="${basedir}/iut_jars"/>

This is a good catch! We need a way to allow IUT specific system 
properties to be set when running the tck. I propose the following solution:
- Add the following line to the file project.properties:
iut.sysproperties = -Dderby.system.home=${basedir}/iut_jars"
A good place is after the definition of the property iut.properties.
- Add the following line to the goals runtck.single and runtck:
<jvmarg line="${iut.sysproperties}"/>
It replaces the new sysproperty setting. This allow specifying one or 
more system properties in project.properties w/o changing the maven.xml. 
What do you think?

Regards Michael

> 
> -- Michelle
> 


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin