Skip to content

Commit

Permalink
Merge pull request #132 from jakartaredhat/master
Browse files Browse the repository at this point in the history
Many updates for outstanding issues
  • Loading branch information
starksm64 authored Aug 28, 2024
2 parents e60a0b2 + 03ae086 commit d0d92fd
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class AppClientProtocolConfiguration implements ProtocolConfiguration, Pr
private String workDir;
// EE10 type of ts.jte file location
private String tsJteFile;
// EE10 type of tssql.stmt file location
private String tsSqlStmtFile;
// harness.log.traceflag
private boolean trace;

Expand Down Expand Up @@ -75,6 +77,15 @@ public void setTsJteFile(String tsJteFile) {
this.tsJteFile = tsJteFile;
}

@Override
public String getTsSqlStmtFile() {
return tsSqlStmtFile;
}
@Override
public void setTsSqlStmtFile(String tsSqlStmtFile) {
this.tsSqlStmtFile = tsSqlStmtFile;
}

public String getClientEnvString() {
return clientEnvString;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ public interface ProtocolCommonConfig {

public String getTsJteFile();
public void setTsJteFile(String tsJteFile);

public String getTsSqlStmtFile();
public void setTsSqlStmtFile(String tsJteFile);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ public class TsTestPropsBuilder {
"Driver",
"authpassword",
"authuser",
"binarySize",
"cofSize",
"cofTypeSize",
"db.dml.file",
"db.supports.sequence",
"db1",
"db2",
"DriverManager",
"ftable",
"generateSQL",
"harness.log.port",
"harness.log.traceflag",
Expand All @@ -39,6 +46,7 @@ public class TsTestPropsBuilder {
"jstl.db.password",
"log.file.location",
"logical.hostname.servlet",
"longvarbinarySize",
"org.omg.CORBA.ORBClass",
"password",
"platform.mode",
Expand All @@ -53,6 +61,7 @@ public class TsTestPropsBuilder {
// These two are probably not useful
"porting.ts.deploy.class.1",
"porting.ts.deploy.class.2",
"ptable",
"rapassword1",
"rapassword2",
"rauser1",
Expand All @@ -61,6 +70,8 @@ public class TsTestPropsBuilder {
"sigTestClasspath",
"ts_home",
"user",
"user1",
"varbinarySize",
"webServerHost",
"webServerPort",
"whitebox-anno_no_md",
Expand Down Expand Up @@ -122,6 +133,7 @@ public static String[] runArgs(ProtocolCommonConfig config, Deployment deploymen

// We need the JavaTest ts.jte file for now
Path tsJte = Paths.get(config.getTsJteFile());
Path tssqlStmt = Paths.get(config.getTsSqlStmtFile());
// Create a test properties file
Path testProps = Paths.get(config.getWorkDir(), "tstest.jte");

Expand Down Expand Up @@ -176,6 +188,7 @@ public static String[] runArgs(ProtocolCommonConfig config, Deployment deploymen
String[] args = {
// test props are needed by EETest.run
"-p", testProps.toFile().getAbsolutePath(),
"-ap", tssqlStmt.toFile().getAbsolutePath(),
"classname", testMethodExecutor.getMethod().getDeclaringClass().getName(),
"-t", tsTestMethodName,
"-vehicle", vehicle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class JavaTestProtocolConfiguration implements ProtocolConfiguration, Pro
private String workDir;
// EE10 type of ts.jte file location
private String tsJteFile;
// EE10 type of tssql.stmt file location
private String tsSqlStmtFile;
// harness.log.traceflag
private boolean trace;
// Should the VehicleClient main be run in a separate JVM
Expand All @@ -31,6 +33,15 @@ public void setTsJteFile(String tsJteFile) {
this.tsJteFile = tsJteFile;
}

@Override
public String getTsSqlStmtFile() {
return tsSqlStmtFile;
}
@Override
public void setTsSqlStmtFile(String tsSqlStmtFile) {
this.tsSqlStmtFile = tsSqlStmtFile;
}

public boolean isTrace() {
return trace;
}
Expand Down
3 changes: 1 addition & 2 deletions arquillian/protocol-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<includes>**/*.class,**/*.xml</includes>
<excludes>com/sun/ts/tests/common/vehicle/**</excludes>
<includes>**/*.class</includes>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
5 changes: 5 additions & 0 deletions tools/tck-rewrite-ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
<artifactId>ejb32</artifactId>
<version>${version.platform.tck}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>jdbc</artifactId>
<version>${version.platform.tck}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>jms</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class DefaultEEMapping implements EE11toEE10Mapping {
};
// Packages removed from EE11. Mostly ejb module classes that are not in the EE11 TCK
private static final String[] EE11_PKG_EXCLUDES = {
"com.sun.ts.tests.common.vehicle.ejb.EJBVehicleHome",
"com.sun.ts.tests.common.dao",
"com.sun.ts.tests.assembly.util.refbean",
"com.sun.ts.tests.ejb.ee.bb.entity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,15 @@ private void populateDeployment(EE11toEE10Mapping mapping, DeploymentInfo deploy
Vehicles vehicleDef = pkgTargetWrapper.getVehiclesDef();
ArrayList<String> foundDescriptors = new ArrayList<>();
String extraClientClass = mapping.getMappedTestClass();
// Validate the extraClientClass exists in
if(extraClientClass != null) {
try {
deployment.testClass.getClassLoader().loadClass(extraClientClass);
} catch (ClassNotFoundException e) {
info("Failed to locate extra client class: %s\n", extraClientClass);
extraClientClass = null;
}
}
// Client
if(pkgTargetWrapper.hasClientJarDef()) {
ClientJar clientJarDef = pkgTargetWrapper.getClientJarDef();
Expand Down
2 changes: 1 addition & 1 deletion tools/tck-rewrite-ant/src/main/resources/TsClientJar.stg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ genClientJar(client, testClass) ::= <<
if(resURL != null) {
#client.typedArchiveName#.addAsManifestResource(resURL, "application-client.xml");
}
#client.typedArchiveName#.addAsManifestResource(new StringAsset("Main-Class: " + #testClass#.class.getName() + "\n"), "MANIFEST.MF");
#client.typedArchiveName#.addAsManifestResource(new StringAsset("Main-Class: #client.mainClass#\n"), "MANIFEST.MF");
// Call the archive processor
archiveProcessor.processClientArchive(#client.typedArchiveName#, #testClass#.class, resURL);
>>
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,47 @@ public void test_jpa_core_types_generator() throws IOException {
System.out.println(packageInfo.getTestClientFiles());
}

@Test
public void test_jdbc_ee_batchUpdate() throws IOException {
TestPackageInfoBuilder builder = new TestPackageInfoBuilder(tsHome);
List<TestMethodInfo> testMethods = Arrays.asList(
new TestMethodInfo("sequenceGeneratorOnPropertyTest", "Exception")
);
Class<?> baseTestClass = com.sun.ts.tests.jdbc.ee.batchUpdate.batchUpdateClient.class;
TestPackageInfo packageInfo = builder.buildTestPackgeInfoEx(baseTestClass, testMethods, DefaultEEMapping.getInstance());
System.out.println(packageInfo);

DeploymentInfo deploymentInfo = packageInfo.getTestClients().get(0).getTestDeployment().getDebugInfo();
System.out.printf("Client: %s\n", deploymentInfo.getClientJar());
System.out.printf("Client.mainClass: %s\n", deploymentInfo.getClientJar().getMainClass());
System.out.printf("Client.classes: %s\n", deploymentInfo.getClientJar().getClassFilesString());
System.out.printf("Ejbs: %s\n", deploymentInfo.getEjbJars());
System.out.printf("Ejb1.classes: %s\n", deploymentInfo.getEjbJar().getClassFilesString());

System.out.println("---- TestClientFiles ----");
System.out.println(packageInfo.getTestClientFiles());
}


@Test
public void test_jpa_core_annotations_orderby() throws IOException {
TestPackageInfoBuilder builder = new TestPackageInfoBuilder(tsHome);
List<TestMethodInfo> testMethods = Arrays.asList(
new TestMethodInfo("test1", "Exception")
);
Class<?> baseTestClass = ee.jakarta.tck.persistence.core.annotations.orderby.Client1.class;
TestPackageInfo packageInfo = builder.buildTestPackgeInfoEx(baseTestClass, testMethods, DefaultEEMapping.getInstance());
System.out.println(packageInfo);

DeploymentInfo deploymentInfo = packageInfo.getTestClients().get(0).getTestDeployment().getDebugInfo();
System.out.printf("Client: %s\n", deploymentInfo.getClientJar());
System.out.printf("Client.mainClass: %s\n", deploymentInfo.getClientJar().getMainClass());
System.out.printf("Client.classes: %s\n", deploymentInfo.getClientJar().getClassFilesString());

System.out.println("---- TestClientFiles ----");
System.out.println(packageInfo.getTestClientFiles());
}

@Test
public void test_jpa_core_entitytest_persist_oneXmany() throws IOException {
TestPackageInfoBuilder builder = new TestPackageInfoBuilder(tsHome);
Expand Down

0 comments on commit d0d92fd

Please sign in to comment.