Skip to content

Commit

Permalink
Merge pull request #104 from jakartaredhat/master
Browse files Browse the repository at this point in the history
Correct arquillian dependency to 1.9.1.Final
  • Loading branch information
starksm64 authored Aug 15, 2024
2 parents 73edc72 + dcfa0f3 commit ac95c87
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 18 deletions.
12 changes: 7 additions & 5 deletions tools/tck-rewrite-ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.arquillian>1.7.0.Final</version.arquillian>
<version.arquillian>1.9.1.Final</version.arquillian>
<version.shrinkwrap>1.2.6</version.shrinkwrap>
<version.http-commons>3.1</version.http-commons>
<version.openrewrite>8.7.2</version.openrewrite>
<version.servlet-api>6.0.0</version.servlet-api>
Expand All @@ -35,6 +36,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<version>${version.shrinkwrap}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -76,10 +82,6 @@
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ public List<TestClientInfo> buildTestClientsEx(Class<?> clazz, List<TestMethodIn
PackageTarget pkgTargetWrapper = new PackageTarget(new ProjectWrapper(project), antPackageTarget);

DeploymentMethodInfo methodInfo = parseNonVehiclePackage(pkgTargetWrapper, clazz);
// Add a tag for the protocol so one can filter tests by protocol
String protocol = methodInfo.getDebugInfo().getProtocol();
ArrayList<String> extraTags = new ArrayList<>(tags);
extraTags.add("tck-"+protocol);
// The class name of the generated clazz subclass
String genTestClassName = "ClientTest";
if(testClassSimpleName.equals("ClientTest")) {
Expand All @@ -195,7 +199,7 @@ public List<TestClientInfo> buildTestClientsEx(Class<?> clazz, List<TestMethodIn
testClientInfo.setVehicle(VehicleType.none);
testClientInfo.setTestDeployment(methodInfo);
testClientInfo.setCommonDeployment(commonDeployment);
testClientInfo.setTags(tags);
testClientInfo.setTags(extraTags);
testClientInfos.add(testClientInfo);
} else {

Expand All @@ -211,14 +215,18 @@ public List<TestClientInfo> buildTestClientsEx(Class<?> clazz, List<TestMethodIn
Target antPackageTarget = project.getTargets().get("package");
PackageTarget pkgTargetWrapper = new PackageTarget(new ProjectWrapper(project), antPackageTarget);
DeploymentMethodInfo methodInfo = parseVehiclePackage(pkgTargetWrapper, clazz, vehicleType);
// Add a tag for the protocol so one can filter tests by protocol
String protocol = methodInfo.getDebugInfo().getProtocol();
ArrayList<String> 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";
TestClientInfo testClientInfo = new TestClientInfo(genTestClassName, clazz, testMethods);
testClientInfo.setVehicle(vehicleType);
testClientInfo.setTestDeployment(methodInfo);
testClientInfo.setCommonDeployment(commonDeployment);
testClientInfo.setTags(tags);
testClientInfo.setTags(vehicleTags);
testClientInfos.add(testClientInfo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,19 @@ public void testejb32_lite_timer_basic_sharing() throws IOException {
System.out.println(packageInfo);
System.out.println(packageInfo.getTestClientFiles());
}
@Test
public void testejb32_lite_timer_basic_xa() throws IOException {
TestPackageInfoBuilder builder = new TestPackageInfoBuilder(tsHome);
List<TestMethodInfo> 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 {
Expand Down
9 changes: 3 additions & 6 deletions tools/tck-rewrite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.arquillian>1.7.0.Final</version.arquillian>
<version.arquillian>1.9.1.Final</version.arquillian>
<version.shrinkwrap>1.2.6</version.shrinkwrap>
<version.http-commons>3.1</version.http-commons>
<version.openrewrite>8.7.2</version.openrewrite>
<version.ignoreopenrewrite>8.23.3</version.ignoreopenrewrite>
<version.servlet-api>6.0.0</version.servlet-api>
<version.tcktools>1.0.0-SNAPSHOT</version.tcktools>
<version.platform.tck>11.0.0-SNAPSHOT</version.platform.tck>
</properties>

Expand Down Expand Up @@ -78,10 +78,7 @@
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>${version.shrinkwrap}</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ac95c87

Please sign in to comment.