Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor JPA tests (work in progress) #1561

Merged
merged 34 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5d58f11
Also update sql/derby/derby.dml.sql to use ee.jakarta.tck.persistence…
scottmarlow Sep 12, 2024
59ad50d
minor changes for sql/derby/derby.ddl.persistence.sql
scottmarlow Sep 13, 2024
a59de82
more missing classes updates
scottmarlow Sep 13, 2024
48bfc51
add schema classes to a few more places
scottmarlow Sep 13, 2024
139c47d
remove double slash in Client.class.getResource call
scottmarlow Sep 13, 2024
bf8b22f
few more fixes
scottmarlow Sep 14, 2024
c4e2768
move jpa persistence from src/java to src/resources folder
scottmarlow Sep 14, 2024
10c6fd6
move jpa persistence from src/java to src/resources folder
scottmarlow Sep 16, 2024
91f4dbb
move jpa persistence from src/java to src/resources folder
scottmarlow Sep 16, 2024
4ccbc5a
comment out reference to unused vehicle_ear_name
scottmarlow Sep 16, 2024
ffdc8d6
remove leading slash on persistence.xml
scottmarlow Sep 16, 2024
b0f506b
pluggability test fix
scottmarlow Sep 16, 2024
f74ad20
switch from system prop to properties passed in + other cleanup
scottmarlow Sep 17, 2024
75ccb2e
resource path changes, add a few missing classes, save work in progress
scottmarlow Sep 19, 2024
63c7111
workaround jakartaee-tck-tools/issues/148 by removing Tag("web") from…
scottmarlow Sep 26, 2024
0ca05f4
Revert "update refactoring without https://github.com/eclipse-ee4j/ja…
scottmarlow Sep 27, 2024
9f63861
add missing setupAData + setupOrderData setup methods
scottmarlow Sep 30, 2024
1a1beef
do not merge with this exclude of repeatable tests (revert it)
scottmarlow Sep 30, 2024
6a8fa0d
add missing ee.jakarta.tck.persistence.core.criteriaapi.parameter.Cli…
scottmarlow Sep 30, 2024
35e5db9
Prevent NPE in ee.jakarta.tck.persistence.common.PMClientBase.getPers…
scottmarlow Oct 1, 2024
a24573a
Prevent NPE in ee.jakarta.tck.persistence.core.annotations.access.pro…
scottmarlow Oct 1, 2024
f45da0b
Correct naming of ee.jakarta.tck.persistence.core.annotations.access.…
scottmarlow Oct 1, 2024
588b451
Correct naming of some other setupN methods which should be called setup
scottmarlow Oct 1, 2024
657bd75
ee.jakarta.tck.persistence.core.annotations.mapkey.setupCreateTestDat…
scottmarlow Oct 1, 2024
be72476
ee.jakarta.tck.persistence.common.schema30.Spouse should use consiste…
scottmarlow Oct 1, 2024
0601fac
Update EETest TRACE logging to show setup Method + cleanup Method
scottmarlow Oct 1, 2024
469bcb7
Add dependencies on jakarta.tck:common + jakarta.tck:persistence-plat…
scottmarlow Oct 1, 2024
08664db
Correct ee.jakarta.tck.persistence.core.entityManager2.Client2/Client…
scottmarlow Oct 1, 2024
58d1afc
Correct jpa_core_EntityGraph_appmanaged_vehicle_client.jar to match e…
scottmarlow Oct 1, 2024
c4c1ddd
Ensure that jpa22.repeatable.namedstoredprocedure tests do not call t…
scottmarlow Oct 3, 2024
31983ec
Update appclient jar name to be the same as ear name with _client.jar…
scottmarlow Oct 4, 2024
19570ea
update jpa appclient test runner with glassfish
alwin-joseph Oct 5, 2024
0dd4a96
remove duplicate dependency
alwin-joseph Oct 5, 2024
620a7ce
Merge pull request #4 from alwin-joseph/jpa_appclient_test
scottmarlow Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could leave this in or remove it. If anyone finds they need the vehicle_ear_name property, we should add it back in.

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
Loading