Hi Michelle,

I read the TestRunner description on the wiki and it really looks good!

Some remarks: instead of using configuration files for the list of databases and the identity types to run the JDO TCK on, we could use properties in the project.properties file, e.g.
jdo.tck.dblist=derby oracle mysql
jdo.tck.identitytypes=applicationidentity datastoreidentity
I'm not sure about the property names. We already have an internal property called jdo.tck.identitytype which denotes the identity type used for the current test. So the plural version jdo.tck.identitytypes would specify the list of identity types to run the tck on (better name?).

The user can overwrite the default settings as specified in project.properties by using the -D flag when calling maven. E.g. 'maven -Djdo.tck.dblist=derby runtck' would run the tck on derby only.

I try to give answers to the questions you added to the TestRunner description on the wiki: (1) I think we do not need separate properties for dblist and identity types for the iut and jdori. (2) Yes, I think we assume that the user will overwrite setting using -D option. I think this becomes less of an issue if we skip the configuration files db.list and identity.list as proposed above. (3) It looks like we need separate properties for specifying what identity types the iut supports (iut.applicationidentity.supported and iut.datastoreidentity.supported) and for specifying what identity types the user want to run the tck on (jdo.tck.identitytypes).

We talked about that the test case might need to know whether we are running with application identity or datastore identity. I propose to pass the value of jdo.tck.identitytype as a system property. JDO_Test could read the system property and provide an access method. I have prototyped this, you find a patch attached. - maven.xml: pass the value of the property jdo.tck.identitytype as a system property. - JDO_Test: reads the system property and provides a boolean method runsWithApplicationIdentity. I'm not sure about the method name. I did not choose isApplicationIdentity, since this could be confused with isApplicationIdentitySupported which returns true if the iut supports application identity.

Regards Michael

--
Michael Bouschen                [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED]        http://www.tech.spree.de/
Tel.:++49/30/235 520-33         Buelowstr. 66                   
Fax.:++49/30/2175 2012          D-10783 Berlin                  

Index: test/java/org/apache/jdo/tck/JDO_Test.java
===================================================================
--- test/java/org/apache/jdo/tck/JDO_Test.java  (revision 191295)
+++ test/java/org/apache/jdo/tck/JDO_Test.java  (working copy)
@@ -114,6 +114,18 @@
         {   true,           false,              false,      false,      false}
     };
   
+    /** identitytype value for applicationidentity. */
+    public static final String APPLICATION_IDENTITY = "applicationidentity";
+
+    /** identitytype value for datastoreidentity. */
+    public static final String DATASTORE_IDENTITY = "datastoreidentity";
+
+    /** 
+     * String indicating the type of identity used for the current test case.
+     * The value is either "applicationidentity" or "datastoreidentity".
+     */
+    protected final String identitytype;
+
     /** Name of the file contaninig the properties for the PMF. */
     protected static String PMFProperties;
 
@@ -150,13 +162,14 @@
     
     /** 
      * A list of registered pc classes. 
-     * Th extents of these classes are deleted in <code>localTearDown</code>.
+     * The extents of these classes are deleted in <code>localTearDown</code>.
      */
     private Collection tearDownClasses = new LinkedList();
     
     /** */
     protected JDO_Test() {
         PMFProperties = System.getProperty("PMFProperties");
+        identitytype = System.getProperty("jdo.tck.identitytype");
     }
 
     /** */
@@ -785,4 +798,15 @@
         }
     }
 
+    /**
+     * Returns <code>true</code> if the current test runs with application
+     * identity. This means the system property jdo.tck.identitytype has the
+     * value applicationidentity.
+     * @return <code>true</code> if current test runs with application
+     * identity; <code>false</code> otherwise:
+     */
+    public boolean runsWithApplicationIdentity() {
+        return APPLICATION_IDENTITY.equals(identitytype);
+    }
+    
 }
Index: maven.xml
===================================================================
--- maven.xml   (revision 191295)
+++ maven.xml   (working copy)
@@ -58,6 +58,7 @@
             <sysproperty key="verbose" value="${verbose}"/>
             <sysproperty key="PMFProperties" value="${iut.runtck.properties}"/>
             <sysproperty key="PMF2Properties" 
value="${iut.runtck.properties}"/>
+            <sysproperty key="jdo.tck.identitytype" 
value="${jdo.tck.identitytype}"/>
             <jvmarg line="${iut.runtck.sysproperties}"/>
             <arg line="${jdo.tck.testclasses}"/>
         </java>
@@ -75,6 +76,7 @@
             <sysproperty key="verbose" value="${verbose}"/>
             <sysproperty key="PMFProperties" value="${iut.runtck.properties}"/>
             <sysproperty key="PMF2Properties" 
value="${iut.runtck.properties}"/>
+            <sysproperty key="jdo.tck.identitytype" 
value="${jdo.tck.identitytype}"/>
             <jvmarg line="${iut.runtck.sysproperties}"/>
         </java>
     </goal>
@@ -89,6 +91,7 @@
             <sysproperty key="verbose" value="${verbose}"/>
             <sysproperty key="PMFProperties" 
value="${basedir}/test/conf/jdori.properties"/>
             <sysproperty key="PMF2Properties" 
value="${basedir}/test/conf/jdori.properties"/>
+            <sysproperty key="jdo.tck.identitytype" 
value="${jdo.tck.identitytype}"/>
             <jvmarg line="${database.runtck.sysproperties}"/>
             <jvmarg line="${jdo.runtck.sysproperties}"/>
             <arg line="${jdo.tck.alltests}"/>
@@ -107,8 +110,8 @@
             <sysproperty key="verbose" value="${verbose}"/>
             <sysproperty key="PMFProperties" 
value="${basedir}/test/conf/jdori.properties"/>
             <sysproperty key="PMF2Properties" 
value="${basedir}/test/conf/jdori.properties"/>
+            <sysproperty key="jdo.tck.identitytype" 
value="${jdo.tck.identitytype}"/>
             <jvmarg line="${database.runtck.sysproperties}"/>
-            <arg line="${jdo.tck.alltests}"/>
         </java>
     </goal>
     
@@ -126,6 +129,7 @@
             <sysproperty key="verbose" value="${verbose}"/>
             <sysproperty key="PMFProperties" value="${iut.runtck.properties}"/>
             <sysproperty key="PMF2Properties" 
value="${iut.runtck.properties}"/>
+            <sysproperty key="jdo.tck.identitytype" 
value="${jdo.tck.identitytype}"/>
             <jvmarg line="${iut.runtck.sysproperties}"/>
             <jvmarg value="-Xdebug"/>
             <jvmarg value="-Xnoagent"/>

Reply via email to