Hi,

as decided in last t-conference I have prepared a patch for JIRA JDO-1 (Enhancer tests don't compile). Please be aware that the patch fixes the compilation problem. However, if you run the two enhancer tests, they will fail due to the fact that the enhancer20 subproject does not implement JDO2.

You can apply the patch in the TCK20 directory using

0) patch -p0 < JDO-1.patch

1) "svn add test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java"

2) "rm test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java.fix test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java.fix"

3) "svn remove test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java.fix test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java.fix"

Afterwards, a "svn status" in that directory prints:

D test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java.fix
A      test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java
A test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java
D      test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java.fix
M      project.properties
M      maven.xml
M      project.xml

Regards,
Michael
--
-------------------------------------------------------------------
Michael Watzek                  [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED]        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------
Index: 
test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java.fix
===================================================================
--- 
test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java.fix  
    (revision 179210)
+++ 
test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java.fix  
    (working copy)
@@ -1,100 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.tck.enhancement;
-
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.jdo.impl.enhancer.util.AugmentationTest;
-import org.apache.jdo.tck.util.BatchTestRunner;
-
-/**
- *<B>Title:</B> Implements PersistenceCapable Added
- *<BR>
- *<B>Keywords:</B> enhancement
- *<BR>
- *<B>Assertion ID:</B> A20.3-0.
- *<BR>
- *<B>Assertion Description: </B>
-The Reference Enhancer makes the following change
-to persistence-capable classes:
-it adds <code>&quot;implements javax.jdo.PersistenceCapable</code>&quot;
-to the class definition.
-
- */
-
-public class ImplementsPersistenceCapable extends EnhancerTest {
-
-    /** */
-    private static final String ASSERTION_FAILED = 
-        "Assertion A20.3-0 (ImplementsPersistenceCapable) failed: ";
-    
-    /**
-     * The <code>main</code> is called when the class
-     * is directly executed from the command line.
-     * @param args The arguments passed to the program.
-     */
-    public static void main(String[] args) {
-        BatchTestRunner.run(ImplementsPersistenceCapable.class);
-    }
-
-    /** */
-    public void test() {
-        if (debug)
-            
logger.debug("org.apache.jdo.tck.enhancement.ImplementsPersistenceCapable.run");
-        runTestAllPackages();
-        cleanup();
-    }
-
-    /** */
-    protected void runTestOnePackage (String packageName, List classNames) {
-        if (debug) 
-            logger.debug("ImplementsPersistenceCapable.testOnePackage: " + 
-                         packageName + " classes " + classNames);
-        
-        PrintWriter out = new PrintWriter(System.out);
-        final AugmentationTest test = new AugmentationTest(out, out);
-        final String classpath = System.getProperty("java.class.path");
-        final String jdoPropertiesFileName = 
-            packageName.replace ('.', '/') + "/jdoTest.properties"; //NOI18N   
     
-        final String[] args = new String[classNames.size() + 6];
-        int index = 0;
-        // init arguments for AugmentationTest.run call
-        // specify properties file
-        args[index++] = "--properties";
-        args[index++] = jdoPropertiesFileName;
-        // specify jdo path to find the properties file
-        args[index++] = "-j";
-        args[index++] = classpath;
-        // specify source path to find the classes
-        args[index++] = "-s";
-        args[index++] = classpath;
-        // add class names
-        for (java.util.Iterator i = classNames.iterator(); i.hasNext();) {
-            args[index++] = (String)i.next();
-        }
-        if (debug)
-            logger.debug ("Run AugmentationTest with args " + 
Arrays.asList(args));
-        int errors = test.run(args);
-        if (errors > 0) {
-            fail(ASSERTION_FAILED,
-                 "AugmentationTest with args " + Arrays.asList(args) +
-                 " results in " + errors + " errors.");
-        }
-    }
-}
Index: test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java
===================================================================
--- test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java   
(revision 0)
+++ test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java   
(revision 0)
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.enhancement;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.jdo.impl.enhancer.util.AnnotationTest;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> FieldAccessModified
+ *<BR>
+ *<B>Keywords:</B> enhancement
+ *<BR>
+ *<B>Assertion ID:</B> .
+ *<BR>
+ *<B>Assertion Description: </B>
+The enhancer modifies field accesses to guarantee that the values of fields
+are retrieved from the data store prior to application usage.
+<OL TYPE="A">
+<LI>For any field access that reads the value of a field, the getfield byte 
code
+is replaced with a call to a generated local method, 
<code>jdoGetXXX</code></LI>
+<LI>For any field access that stores the new value of a field, the putfield
+byte code is replaced with a call to a generated local method,
+<code>jdoSetXXX</code></LI>
+</OL>
+
+ */
+
+public class FieldAccessModified extends EnhancerTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion (FieldAccessModified) failed: ";
+    
+    /**
+     * The <code>main</code> is called when the class
+     * is directly executed from the command line.
+     * @param args The arguments passed to the program.
+     */
+    public static void main(String[] args) {
+        BatchTestRunner.run(FieldAccessModified.class);
+    }
+
+    
+    /** */
+    public void test() {
+        if (debug)
+            
logger.debug("org.apache.jdo.tck.enhancement.FieldAccessModified.run");
+        PMFPropertiesObject = loadProperties(PMFProperties); // will exit here 
if no properties
+        runTestAllPackages();
+    }
+
+    /** */
+    protected void runTestOnePackage (String packageName, List classNames) {
+        if (debug)
+            logger.debug("FieldAccessModified.testOnePackage: " + 
+                         packageName + " classes " + classNames);
+        
+        PrintWriter out = new PrintWriter(System.out);
+        final AnnotationTest test = new AnnotationTest(out, out);
+        final String classpath = System.getProperty("java.class.path");
+        final String jdoPropertiesFileName = 
+            packageName.replace ('.', '/') + "/jdoTest.properties"; //NOI18N   
     
+        final String[] args = new String[classNames.size() + 6];
+        int index = 0;
+        // init arguments for AnnotationTest.run call
+        // specify properties file
+        args[index++] = "--properties";
+        args[index++] = jdoPropertiesFileName;
+        // specify jdo path to find the properties file
+        args[index++] = "-j";
+        args[index++] = classpath;
+        // specify source path to find the classes
+        args[index++] = "-s";
+        args[index++] = classpath;
+        // add class names
+        for (java.util.Iterator i = classNames.iterator(); i.hasNext();) {
+            args[index++] = (String)i.next();
+        }
+        if (debug)
+            logger.debug ("Run AnnotationTest with args " + 
Arrays.asList(args));
+        int errors = test.run(args);
+        if (errors > 0) {
+            fail(ASSERTION_FAILED,
+                 "AnnotationTest with args " + Arrays.asList(args) +
+                 " results in " + errors + " errors.");
+        }
+    }
+}

Property changes on: 
test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java
___________________________________________________________________
Name: svn:executable
   + *

Index: 
test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java
===================================================================
--- test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java  
(revision 0)
+++ test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java  
(revision 0)
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.enhancement;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.jdo.impl.enhancer.util.AugmentationTest;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ *<B>Title:</B> Implements PersistenceCapable Added
+ *<BR>
+ *<B>Keywords:</B> enhancement
+ *<BR>
+ *<B>Assertion ID:</B> A20.3-0.
+ *<BR>
+ *<B>Assertion Description: </B>
+The Reference Enhancer makes the following change
+to persistence-capable classes:
+it adds <code>&quot;implements javax.jdo.PersistenceCapable</code>&quot;
+to the class definition.
+
+ */
+
+public class ImplementsPersistenceCapable extends EnhancerTest {
+
+    /** */
+    private static final String ASSERTION_FAILED = 
+        "Assertion A20.3-0 (ImplementsPersistenceCapable) failed: ";
+    
+    /**
+     * The <code>main</code> is called when the class
+     * is directly executed from the command line.
+     * @param args The arguments passed to the program.
+     */
+    public static void main(String[] args) {
+        BatchTestRunner.run(ImplementsPersistenceCapable.class);
+    }
+
+    /** */
+    public void test() {
+        if (debug)
+            
logger.debug("org.apache.jdo.tck.enhancement.ImplementsPersistenceCapable.run");
+        runTestAllPackages();
+    }
+
+    /** */
+    protected void runTestOnePackage (String packageName, List classNames) {
+        if (debug) 
+            logger.debug("ImplementsPersistenceCapable.testOnePackage: " + 
+                         packageName + " classes " + classNames);
+        
+        PrintWriter out = new PrintWriter(System.out);
+        final AugmentationTest test = new AugmentationTest(out, out);
+        final String classpath = System.getProperty("java.class.path");
+        final String jdoPropertiesFileName = 
+            packageName.replace ('.', '/') + "/jdoTest.properties"; //NOI18N   
     
+        final String[] args = new String[classNames.size() + 6];
+        int index = 0;
+        // init arguments for AugmentationTest.run call
+        // specify properties file
+        args[index++] = "--properties";
+        args[index++] = jdoPropertiesFileName;
+        // specify jdo path to find the properties file
+        args[index++] = "-j";
+        args[index++] = classpath;
+        // specify source path to find the classes
+        args[index++] = "-s";
+        args[index++] = classpath;
+        // add class names
+        for (java.util.Iterator i = classNames.iterator(); i.hasNext();) {
+            args[index++] = (String)i.next();
+        }
+        if (debug)
+            logger.debug ("Run AugmentationTest with args " + 
Arrays.asList(args));
+        int errors = test.run(args);
+        if (errors > 0) {
+            fail(ASSERTION_FAILED,
+                 "AugmentationTest with args " + Arrays.asList(args) +
+                 " results in " + errors + " errors.");
+        }
+    }
+}

Property changes on: 
test/java/org/apache/jdo/tck/enhancement/ImplementsPersistenceCapable.java
___________________________________________________________________
Name: svn:executable
   + *

Index: test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java.fix
===================================================================
--- test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java.fix       
(revision 179210)
+++ test/java/org/apache/jdo/tck/enhancement/FieldAccessModified.java.fix       
(working copy)
@@ -1,107 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.tck.enhancement;
-
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.jdo.impl.enhancer.util.AnnotationTest;
-import org.apache.jdo.tck.util.BatchTestRunner;
-
-/**
- *<B>Title:</B> FieldAccessModified
- *<BR>
- *<B>Keywords:</B> enhancement
- *<BR>
- *<B>Assertion ID:</B> .
- *<BR>
- *<B>Assertion Description: </B>
-The enhancer modifies field accesses to guarantee that the values of fields
-are retrieved from the data store prior to application usage.
-<OL TYPE="A">
-<LI>For any field access that reads the value of a field, the getfield byte 
code
-is replaced with a call to a generated local method, 
<code>jdoGetXXX</code></LI>
-<LI>For any field access that stores the new value of a field, the putfield
-byte code is replaced with a call to a generated local method,
-<code>jdoSetXXX</code></LI>
-</OL>
-
- */
-
-public class FieldAccessModified extends EnhancerTest {
-
-    /** */
-    private static final String ASSERTION_FAILED = 
-        "Assertion (FieldAccessModified) failed: ";
-    
-    /**
-     * The <code>main</code> is called when the class
-     * is directly executed from the command line.
-     * @param args The arguments passed to the program.
-     */
-    public static void main(String[] args) {
-        BatchTestRunner.run(FieldAccessModified.class);
-    }
-
-    
-    /** */
-    public void test() {
-        if (debug)
-            
logger.debug("org.apache.jdo.tck.enhancement.FieldAccessModified.run");
-        PMFPropertiesObject = loadProperties(PMFProperties); // will exit here 
if no properties
-        runTestAllPackages();
-        cleanup();
-    }
-
-    /** */
-    protected void runTestOnePackage (String packageName, List classNames) {
-        if (debug)
-            logger.debug("FieldAccessModified.testOnePackage: " + 
-                         packageName + " classes " + classNames);
-        
-        PrintWriter out = new PrintWriter(System.out);
-        final AnnotationTest test = new AnnotationTest(out, out);
-        final String classpath = System.getProperty("java.class.path");
-        final String jdoPropertiesFileName = 
-            packageName.replace ('.', '/') + "/jdoTest.properties"; //NOI18N   
     
-        final String[] args = new String[classNames.size() + 6];
-        int index = 0;
-        // init arguments for AnnotationTest.run call
-        // specify properties file
-        args[index++] = "--properties";
-        args[index++] = jdoPropertiesFileName;
-        // specify jdo path to find the properties file
-        args[index++] = "-j";
-        args[index++] = classpath;
-        // specify source path to find the classes
-        args[index++] = "-s";
-        args[index++] = classpath;
-        // add class names
-        for (java.util.Iterator i = classNames.iterator(); i.hasNext();) {
-            args[index++] = (String)i.next();
-        }
-        if (debug)
-            logger.debug ("Run AnnotationTest with args " + 
Arrays.asList(args));
-        int errors = test.run(args);
-        if (errors > 0) {
-            fail(ASSERTION_FAILED,
-                 "AnnotationTest with args " + Arrays.asList(args) +
-                 " results in " + errors + " errors.");
-        }
-    }
-}
Index: project.properties
===================================================================
--- project.properties  (revision 179210)
+++ project.properties  (working copy)
@@ -60,6 +60,8 @@
 log4j.jarfile = ${pom.getDependencyPath('log4j')}
 derby.jarfile = ${pom.getDependencyPath('derby:derby')}
 derbytools.jarfile = ${pom.getDependencyPath('derby:derbytools')}
+core20.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-core')}
+enhancer20.jarfile = ${pom.getDependencyPath('apache-jdo:jdo2-enhancer')}
 xmlparser =
 
 # JDORI enhancer
Index: maven.xml
===================================================================
--- maven.xml   (revision 179210)
+++ maven.xml   (working copy)
@@ -416,6 +416,8 @@
         <pathelement location="${bcel.jarfile}" />
         <pathelement location="${log4j.jarfile}" />
         <pathelement location="${derby.jarfile}" />
+        <pathelement location="${core20.jarfile}" />
+        <pathelement location="${enhancer20.jarfile}" />
     </path>
 
     <!-- ==== -->
Index: project.xml
===================================================================
--- project.xml (revision 179210)
+++ project.xml (working copy)
@@ -94,6 +94,16 @@
             <artifactId>derbytools</artifactId>
             <version>10.0.2.1</version>
         </dependency>
+        <dependency>
+            <groupId>apache-jdo</groupId>
+            <artifactId>jdo2-enhancer</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>apache-jdo</groupId>
+            <artifactId>jdo2-core</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
     </dependencies>
     <!-- =================== -->
     <!-- Build Specification -->

Reply via email to