Skip to content

Commit

Permalink
Merge pull request #1561 from scottmarlow/derby.dml.sql_3
Browse files Browse the repository at this point in the history
Refactor JPA tests (work in progress)
  • Loading branch information
scottmarlow authored Oct 6, 2024
2 parents 63faf2f + 620a7ce commit c4291be
Show file tree
Hide file tree
Showing 1,244 changed files with 6,550 additions and 5,955 deletions.
4 changes: 2 additions & 2 deletions common/src/main/java/com/sun/ts/lib/harness/EETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,13 @@ public Status run(String[] argv, Properties p) {
getSetupMethodName(runMethod) + ", testName:" + sTestCase + ") " +
"in test class " + testClass.getName() + "(test class was loaded from: " + testClass.getClassLoader().getName() + ")");
else
TestUtil.logTrace("GOT SETUP METHOD!");
TestUtil.logTrace("GOT SETUP METHOD: " + setupMethod.getName() + " for " + testClass.getName());

cleanupMethod = getCleanupMethod(testClass, runMethod);
if (cleanupMethod == null)
return Status.failed("Invalid test case name as test cleanupMethod Method ( for " + sTestCase + ") could not be found in " + testClass.getName());
else
TestUtil.logTrace("GOT CLEANUP METHOD!");
TestUtil.logTrace("GOT CLEANUP METHOD: " + cleanupMethod.getName() + " for " + testClass.getName());
try {
TestUtil.logTrace("ABOUT TO INVOKE SETUP METHOD!");
// if new classname is true, use that class name instead of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Status run(String[] argv, Properties p) {
String className = this.getClass().getName();
// use this name for the context root or jndi name to eliminate
// naming conflicts for apps deployed at the same time
String sVehicleEarName = TestUtil.getProperty(p, "vehicle_ear_name");
// comment out unused: String sVehicleEarName = TestUtil.getProperty(p, "vehicle_ear_name");
TestUtil.logTrace("Vehicle to be used for this test is: " + sVehicle);
// call to the Deliverable to run in deliverable specific vehicles
// This should never be called on the server, so there is
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
2,463 changes: 2,463 additions & 0 deletions glassfish-runner/jpa-platform-tck/jakartaeetck/bin/ts.jte

Large diffs are not rendered by default.

164 changes: 151 additions & 13 deletions glassfish-runner/jpa-platform-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<!-- Use JDK17 to run with GF 8.0.0-JDK17-M5 -->
<glassfish.container.version>8.0.0-JDK17-M7</glassfish.container.version>
<glassfish.home>${project.build.directory}/${glassfish.toplevel.dir}</glassfish.home>
<glassfish.lib.dir>${glassfish.home}/glassfish/lib</glassfish.lib.dir>
<!-- Use JDK21 to run with GF 8.0.0-M5 -->
<!-- <glassfish.container.version>8.0.0-M5</glassfish.container.version> -->
<glassfish.toplevel.dir>glassfish8</glassfish.toplevel.dir>
Expand All @@ -80,15 +81,14 @@
<ptable>ctstable1</ptable>
<restype>javax.sql.DataSource</restype>
<sql.directory>./sql</sql.directory>
<tck.artifactId>jpa-tck</tck.artifactId>
<tck.artifactId>persistence-platform-tck-tests</tck.artifactId>
<tck.version>11.0.0-SNAPSHOT</tck.version>
<ts.home>/jakartaeetck</ts.home>
<user1>cts1</user1>
<user2>cts1</user2>
<version.jakarta.inject>2.0.1</version.jakarta.inject>
<version.jakarta.persistence>3.2.0</version.jakarta.persistence>
<version.jakarta.tck>11.0.0-SNAPSHOT</version.jakarta.tck>
<version.jakarta.tck.arquillian>1.0.0-M15</version.jakarta.tck.arquillian>
<version.jakarta.tck.arquillian>1.0.0-M16</version.jakarta.tck.arquillian>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -139,6 +139,12 @@
<artifactId>jakarta.persistence-api</artifactId>
<version>${version.jakarta.persistence}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>persistence-platform-tck-common</artifactId>
<version>${version.jakarta.tck}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>persistence-platform-tck-spec-tests</artifactId>
Expand All @@ -156,6 +162,21 @@
<artifactId>arquillian-container-test-spi</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-spi</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.core</groupId>
<artifactId>arquillian-core-spi</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.test</groupId>
<artifactId>arquillian-test-impl-base</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>simple-glassfish-api</artifactId>
Expand All @@ -179,7 +200,7 @@
<dependency>
<groupId>org.omnifaces.arquillian</groupId>
<artifactId>arquillian-glassfish-server-managed</artifactId>
<version>1.4</version>
<version>1.6</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -212,7 +233,7 @@
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-javatest</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
<version>1.0.0-M15</version>
<exclusions>
<exclusion>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
Expand Down Expand Up @@ -244,13 +265,50 @@
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-lib</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
<version>1.0.0-M15</version>
</dependency>
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>tck-porting-lib</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>libutil</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>runtime</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>dbprocedures</artifactId>
<version>3.2.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.15.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.15.2.0</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -315,7 +373,6 @@
<artifactItem>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-lib</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/protocol</outputDirectory>
Expand All @@ -324,6 +381,73 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>004-copy-lib</id>
<goals>
<goal>copy</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>libutil</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>libutil.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>common</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>common.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>tck-porting-lib</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>tck-porting-lib.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>runtime</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>runtime.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>${tck.artifactId}</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>persistence-platform-tck-tests.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${glassfish.lib.dir}</outputDirectory>
<destFileName>derbyclient.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${glassfish.lib.dir}</outputDirectory>
<destFileName>derbytools.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-lib</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>arquillian-protocol-lib.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand All @@ -344,6 +468,20 @@
</arguments>
</configuration>
</execution>
<execution>
<id>006-StopDatabase</id>
<goals>
<goal>exec</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<executable>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin</executable>
<workingDirectory>${derby.basedir}</workingDirectory>
<arguments>
<argument>stop-database</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -380,7 +518,7 @@
</configuration>
<executions>
<execution>
<id>jta-tests-appclient</id>
<id>jpa-tests-appclient</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
Expand All @@ -389,11 +527,10 @@
<!-- Select the @Tag("tck-appclient") tests -->
<groups>tck-appclient</groups>
<includes>
<include>com/sun/ts/tests/jta/ee/transactional/*Ejb*.java</include>
<include>com/sun/ts/tests/jta/ee/txpropagationtest/*Ejb*.java</include>
<include>com/sun/ts/tests/jta/ee/usertransaction/**/*EjbTest*.java</include>
<include>ee/jakarta/tck/persistence/**/*Test.java</include>
<!-- <include>ee/jakarta/tck/persistence/core/EntityGraph/**/ClientAppmanagednotxTest.java</include> -->
</includes>
<dependenciesToScan>jakarta.tck:persistence-platform-tck-tests</dependenciesToScan>
<dependenciesToScan>jakarta.tck:${tck.artifactId}</dependenciesToScan>
<systemPropertyVariables>
<GLASSFISH_HOME>${project.build.directory}/${glassfish.toplevel.dir}</GLASSFISH_HOME>
<glassfish.home>${project.build.directory}/${glassfish.toplevel.dir}</glassfish.home>
Expand All @@ -411,6 +548,7 @@
<harness.log.traceflag>true</harness.log.traceflag>
<cts.harness.debug>true</cts.harness.debug>
<java.io.tmpdir>/tmp</java.io.tmpdir>
<project.basedir>${project.basedir}</project.basedir>
<arquillian.xml>appclient-arquillian.xml</arquillian.xml>
</systemPropertyVariables>
<environmentVariables>
Expand All @@ -432,7 +570,7 @@
<additionalClasspathElement>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/glassfish-naming.jar</additionalClasspathElement>
</additionalClasspathElements>
<includes>
<include>ee/jakarta/tck/persistence/**/*Test.java</include>
<!-- <include>ee/jakarta/tck/persistence/**/*Test.java</include> -->
</includes>
<!-- Select the @Tag("tck-javatest") tests -->
<groups>tck-javatest</groups>
Expand Down
Loading

0 comments on commit c4291be

Please sign in to comment.