diff --git a/tools/tck-rewrite-ant/pom.xml b/tools/tck-rewrite-ant/pom.xml index f3c451436..acc877684 100644 --- a/tools/tck-rewrite-ant/pom.xml +++ b/tools/tck-rewrite-ant/pom.xml @@ -18,7 +18,8 @@ 17 17 UTF-8 - 1.7.0.Final + 1.9.1.Final + 1.2.6 3.1 8.7.2 6.0.0 @@ -35,6 +36,11 @@ pom import + + org.jboss.shrinkwrap + shrinkwrap-api + ${version.shrinkwrap} + @@ -76,10 +82,6 @@ org.jboss.shrinkwrap shrinkwrap-api - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - commons-httpclient commons-httpclient diff --git a/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/TsTaskListener.java b/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/TsTaskListener.java index 9f6c40324..cfd13cfbb 100644 --- a/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/TsTaskListener.java +++ b/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/TsTaskListener.java @@ -247,9 +247,13 @@ else if(lastTsPackage != null) { String dir = fs.getDir().getAbsolutePath(); String[] includes = fs.getDirectoryScanner().getIncludedFiles(); if(includes.length > 0) { - TsFileSet copyFS = new TsFileSet(dir, null, new ArrayList<>(List.of(includes))); TsTaskInfo lastTsTask = tsTaskStack.peek(); - lastTsTask.addCopyFS(copyFS); + TsFileSet copyFS = new TsFileSet(dir, null, new ArrayList<>(List.of(includes))); + if(lastTsTask == null) { + log.warning("No ts.* task for copy task for: "+copyFS); + } else { + lastTsTask.addCopyFS(copyFS); + } } } } else { diff --git a/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/api/TestPackageInfoBuilder.java b/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/api/TestPackageInfoBuilder.java index dc658ae74..54831fa67 100644 --- a/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/api/TestPackageInfoBuilder.java +++ b/tools/tck-rewrite-ant/src/main/java/tck/jakarta/platform/ant/api/TestPackageInfoBuilder.java @@ -186,6 +186,10 @@ public List buildTestClientsEx(Class clazz, List extraTags = new ArrayList<>(tags); + extraTags.add("tck-"+protocol); // The class name of the generated clazz subclass String genTestClassName = "ClientTest"; if(testClassSimpleName.equals("ClientTest")) { @@ -195,7 +199,7 @@ public List buildTestClientsEx(Class clazz, List buildTestClientsEx(Class clazz, List vehicleTags = new ArrayList<>(tags); + vehicleTags.add("tck-"+protocol); // The class name of the generated clazz subclass String vehicleName = capitalizeFirst(vehicleType.name()); String genTestClassName = testClassSimpleName+vehicleName+"Test"; @@ -218,7 +226,7 @@ public List buildTestClientsEx(Class clazz, List testMethods = Arrays.asList( + new TestMethodInfo("persistCoffeeCreateTimerRollbackStateless", ""), + new TestMethodInfo("persistCoffeeCreateTimerRollbackSingleton", "") + ); + Class baseTestClass = com.sun.ts.tests.ejb32.lite.timer.basic.xa.Client.class; + TestPackageInfo packageInfo = builder.buildTestPackgeInfoEx(baseTestClass, testMethods, DefaultEEMapping.getInstance()); + System.out.println(packageInfo); + System.out.println(packageInfo.getTestClientFiles()); + } + @Test public void testEjb32_relaxedclientview_singleton() throws IOException { diff --git a/tools/tck-rewrite/pom.xml b/tools/tck-rewrite/pom.xml index 5e42bbc42..2b71134f7 100644 --- a/tools/tck-rewrite/pom.xml +++ b/tools/tck-rewrite/pom.xml @@ -19,12 +19,12 @@ 17 17 UTF-8 - 1.7.0.Final + 1.9.1.Final + 1.2.6 3.1 8.7.2 8.23.3 6.0.0 - 1.0.0-SNAPSHOT 11.0.0-SNAPSHOT @@ -78,10 +78,7 @@ org.jboss.shrinkwrap shrinkwrap-api - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven + ${version.shrinkwrap} commons-httpclient diff --git a/tools/tck-rewrite/src/main/java/tck/jakarta/platform/rewrite/GenerateNewTestClassRecipe.java b/tools/tck-rewrite/src/main/java/tck/jakarta/platform/rewrite/GenerateNewTestClassRecipe.java index 4303147e1..66ca2621a 100644 --- a/tools/tck-rewrite/src/main/java/tck/jakarta/platform/rewrite/GenerateNewTestClassRecipe.java +++ b/tools/tck-rewrite/src/main/java/tck/jakarta/platform/rewrite/GenerateNewTestClassRecipe.java @@ -52,11 +52,13 @@ public class GenerateNewTestClassRecipe extends Recipe implements Serializable { static final long serialVersionUID = 427023419L; private static final String fullyQualifiedClassName = GenerateNewTestClassRecipe.class.getCanonicalName(); + // EE10 tck home private static final Path tsHome = Paths.get(System.getProperty("ts.home")); - + // EE11 tck module src root, usually src/main/java private static final Path srcDir = Paths.get(System.getProperty("tcksourcepath")); - + // Optional property to restrict to a specific test package private static final String tckpackage = System.getProperty("tckpackage"); + private static boolean overwriteExistingTests = Boolean.valueOf(System.getProperty("overwriteExistingTests", "false")); static { if (log.isLoggable(Level.FINEST)) { @@ -193,7 +195,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex Files.createDirectories(testPkgDir); // The test client .java file Path testClientJavaFile = testPkgDir.resolve(testClient.getName() + ".java"); - if (testClientJavaFile.toFile().exists()) { + if (!overwriteExistingTests && testClientJavaFile.toFile().exists()) { log.warning("TODO: " + testClientJavaFile + " was already previously generated which means we aren't handling something correctly."); Thread.dumpStack(); continue;