eclipse-ee4j / jakartaee-tck-tools

Other
7 stars 15 forks source link

Rewrite of jdbc tests fails with new error #127

Closed starksm64 closed 2 weeks ago

starksm64 commented 2 weeks ago

Running the latest snapshot rewrite code on the jdbc module fails with:

[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:5.32.1:runNoFork (default-cli) on project jdbc-rewrite: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:5.32.1:runNoFork failed: Error while visiting jdbc/src/main/java/com/sun/ts/tests/jdbc/ee/batchUpdate/batchUpdateClient.java: java.lang.RuntimeException: TODO: com.sun.ts.tests.jdbc.ee.batchUpdate.batchUpdateClient: Check if .class is available for source: com.sun.ts.tests.jdbc.ee.batchUpdate.batchUpdateClient
[ERROR]   tck.jakarta.platform.rewrite.GenerateNewTestClassRecipe$testClassVisitor.visitClassDeclaration(GenerateNewTestClassRecipe.java:229)
[ERROR]   tck.jakarta.platform.rewrite.GenerateNewTestClassRecipe$testClassVisitor.visitClassDeclaration(GenerateNewTestClassRecipe.java:105)
[ERROR]   org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1286)
[ERROR]   org.openrewrite.java.tree.J.accept(J.java:59)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
[ERROR]   org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:366)
[ERROR]   org.openrewrite.java.JavaVisitor.lambda$visitCompilationUnit$10(JavaVisitor.java:501)
[ERROR]   org.openrewrite.internal.ListUtils.map(ListUtils.java:176)
[ERROR]   org.openrewrite.java.JavaVisitor.visitCompilationUnit(JavaVisitor.java:501)
[ERROR]   org.openrewrite.java.JavaIsoVisitor.visitCompilationUnit(JavaIsoVisitor.java:113)
[ERROR]   org.openrewrite.java.JavaIsoVisitor.visitCompilationUnit(JavaIsoVisitor.java:30)
[ERROR]   org.openrewrite.java.tree.J$CompilationUnit.acceptJava(J.java:1560)
[ERROR]   org.openrewrite.java.tree.J.accept(J.java:59)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:283)
[ERROR]   org.openrewrite.TreeVisitor.visit(TreeVisitor.java:184)
[ERROR]   org.openrewrite.scheduling.RecipeRunCycle.lambda$editSources$5(RecipeRunCycle.java:164)
[ERROR]   ...
[ERROR] -> [Help 1]
starksm64 commented 2 weeks ago

Apparently I needed to add the jdbc artifiact to the rewrite plugin config:

                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version>5.32.1</version>
                <configuration>
                    <activeRecipes>
                        <recipe>tck.jakarta.platform.rewrite.GenerateNewTestClassRecipe</recipe>
                    </activeRecipes>
                </configuration>
                <dependencies>
...
                    <dependency>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>jdbc</artifactId>
                        <version>${project.version}</version>
                    </dependency>

I did not need to do that with others, so there must be some transitive dependencies picked up for the other modules, but jdbc was not there.