Skip to content

Commit

Permalink
Merge branch 'main' into webjpa3
Browse files Browse the repository at this point in the history
  • Loading branch information
starksm64 authored Jan 12, 2025
2 parents 2b5ae58 + b64a390 commit 057bba4
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 121 deletions.
160 changes: 55 additions & 105 deletions glassfish-runner/persistence-platform-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,11 @@
<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.version>8.0.0-M9</glassfish.version> -->
<!-- <glassfish.version>8.0.0-M5</glassfish.version> -->
<glassfish.toplevel.dir>glassfish8</glassfish.toplevel.dir>
<!-- Use JDK17 to run with GF 8.0.0-JDK17-M5 -->
<glassfish.version>8.0.0-JDK17-M9</glassfish.version>
<jakarta.persistence.jdbc.driver>org.apache.derby.jdbc.ClientDriver</jakarta.persistence.jdbc.driver>
<jakarta.persistence.jdbc.password>cts1</jakarta.persistence.jdbc.password>
<jakarta.persistence.jdbc.url>jdbc:derby://localhost:1527/derbyDB;create=true</jakarta.persistence.jdbc.url>
<jakarta.persistence.jdbc.user>cts1</jakarta.persistence.jdbc.user>
<jakarta.persistence.provider>org.eclipse.persistence.jpa.PersistenceProvider</jakarta.persistence.provider>
<jakarta.platform.version>11.0.0-M2</jakarta.platform.version>
<javadb.lib>${glassfish.home}/javadb/lib</javadb.lib>
<jdbc.classpath>${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbyclient.jar:${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbyshared.jar:${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbytools.jar</jdbc.classpath>
<jdbc.driver.classes>${javadb.lib}/derbyclient.jar:${javadb.lib}/derbyshared.jar:${javadb.lib}/derbytools.jar</jdbc.driver.classes>
<jdbc.url>jdbc:derby://localhost:1527/derbyDB;create=true</jdbc.url>

<junit.jupiter.version>5.11.3</junit.jupiter.version>
<tck.artifactId>persistence-platform-tck-tests</tck.artifactId>
Expand Down Expand Up @@ -277,6 +268,20 @@
</dependencies>

<build>
<resources>
<resource>
<targetPath>${project.build.directory}/sql</targetPath>
<filtering>true</filtering>
<directory>${project.basedir}/sql/derby</directory>
<includes>
<include>*.sql</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -384,90 +389,6 @@
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>start-database</id>
<goals>
<goal>exec</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<executable>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin</executable>
<arguments>
<argument>start-database</argument>
</arguments>
</configuration>
</execution>

<execution>
<id>stop-database-final</id>
<goals>
<goal>exec</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<executable>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/bin/asadmin</executable>
<arguments>
<argument>stop-database</argument>
</arguments>
<successCodes>
<successCode>0</successCode>
<successCode>1</successCode>
</successCodes>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>initdb</id>
<goals>
<goal>run</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<target>
<!-- <path id="jdbc.classpath">
<pathelement path="target/glassfish8/javadb/lib/derbyclient.jar"></pathelement>
<path refid="maven.runtime.classpath"></path>
</path> -->
<sql autocommit="true" classpath="${jdbc.classpath}" delimiter=";" driver="org.apache.derby.jdbc.ClientDriver" onerror="continue" password="cts1" url="${jdbc.url}" userid="cts1">
<transaction src="sql/derby/derby.ddl.persistence.sprocs.sql"></transaction>
<transaction src="sql/derby/derby.ddl.sql"></transaction>
</sql>
</target>
</configuration>
</execution>

<execution>
<id>install_java_procedures</id>
<goals>
<goal>run</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<target>
<path id="jdbc.classpath">
<pathelement path="${jdbc.driver.classes}"></pathelement>
<path refid="maven.runtime.classpath"></path>
</path>
<sql autocommit="true" classpath="${jdbc.classpath}" driver="${jakarta.persistence.jdbc.driver}" onerror="continue" password="${jakarta.persistence.jdbc.password}" url="${jakarta.persistence.jdbc.url}" userid="${jakarta.persistence.jdbc.user}">CALL sqlj.remove_jar('APP.dbprocedures', 0);
CALL sqlj.install_jar('${project.build.directory}/dbprocedures.jar', 'APP.dbprocedures', 0);
CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.classpath', 'APP.dbprocedures');</sql>
</target>
</configuration>
</execution>

</executions>
</plugin>

<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.0</version>
Expand All @@ -476,19 +397,19 @@
<dependenciesToScan>jakarta.tck:persistence-platform-tck-tests</dependenciesToScan>

<systemPropertyVariables>
<!-- <glassfish.enableDerby>true</glassfish.enableDerby>
<glassfish.enableDerby>true</glassfish.enableDerby>
<glassfish.derbyDatabaseName>${glassfish.home}/glassfish/domains/domain1/config/derbyDB;create=true</glassfish.derbyDatabaseName>
<glassfish.derbySQLFile>${basedir}/sql/derby/derby.ddl.sql</glassfish.derbySQLFile>
<glassfish.derbySQLFile>${project.build.directory}/sql/derby.ddl.sql</glassfish.derbySQLFile>
<glassfish.derbyUser>cts1</glassfish.derbyUser>
<glassfish.derbyPasswordFile>${basedir}/sql/derby/password.txt</glassfish.derbyPasswordFile> -->
<glassfish.derbyPasswordFile>${basedir}/sql/derby/password.txt</glassfish.derbyPasswordFile>

<glassfish.home>${project.build.directory}/${glassfish.toplevel.dir}</glassfish.home>
<glassfish.postBootCommands>set server-config.network-config.protocols.protocol.http-listener-1.http.trace-enabled=true
create-file-user --groups guest --passwordfile ${project.basedir}/javajoe.pass javajoe
create-file-user --groups staff:mgr --passwordfile ${project.basedir}/j2ee.pass j2ee
create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property DatabaseName=derbyDB:serverName=localhost:PortNumber=1527:User=cts1:Password=cts1 --steadypoolsize 32 --maxpoolsize 64 cts-derby-pool
create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property DatabaseName=${glassfish.home}/glassfish/domains/domain1/config/derbyDB:serverName=localhost:portNumber=1527:user=cts1:password=cts1 --steadypoolsize 32 --maxpoolsize 64 cts-derby-pool
create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property DatabaseName=${glassfish.home}/glassfish/domains/domain1/config/derbyDB:serverName=localhost:PortNumber=1527:User=cts1:Password=cts1 --steadypoolsize 32 --maxpoolsize 64 cts-derby-pool_no_tx
create-jdbc-resource --connectionpoolid cts-derby-pool jdbc/DB1
create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property DatabaseName=derbyDB:serverName=localhost:PortNumber=1527:User=cts1:Password=cts1 --steadypoolsize 32 --maxpoolsize 64 cts-derby-pool_no_tx
create-jdbc-resource --connectionpoolid cts-derby-pool_no_tx jdbc/DB_no_tx
list-jdbc-connection-pools
list-jdbc-resources
Expand All @@ -501,6 +422,7 @@
</configuration>

<executions>
<!--
<execution>
<id>jpa-tests-appclient</id>
<goals>
Expand All @@ -510,16 +432,15 @@
<configuration>
<includes>
<include>ee/jakarta/tck/persistence/**/*Test.java</include>
<!-- <include>ee/jakarta/tck/persistence/core/EntityGraph/**/ClientAppmanagednotxTest.java</include> -->
</includes>
<!-- Select the @Tag("tck-appclient") tests -->
<groups>tck-appclient</groups>
<systemPropertyVariables>
<arquillian.xml>appclient-arquillian.xml</arquillian.xml>
</systemPropertyVariables>
</configuration>
</execution>
-->

<execution>
<id>jpa-tests-cdi</id>
Expand All @@ -546,11 +467,8 @@
</goals>
<configuration>
<includes>

<include>ee/jakarta/tck/persistence/core/StoredProcedureQuery/Client1PmservletTest.java</include>
<!--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>

<systemPropertyVariables>
Expand Down Expand Up @@ -601,5 +519,37 @@
<glassfish-artifact-id>web</glassfish-artifact-id>
</properties>
</profile>
<profile>
<id>appclient</id>

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.0</version>

<executions>
<execution>
<id>jpa-tests-appclient</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>ee/jakarta/tck/persistence/**/*Test.java</include>
</includes>
<groups>tck-appclient</groups>

<systemPropertyVariables>
<arquillian.xml>appclient-arquillian.xml</arquillian.xml>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
31 changes: 31 additions & 0 deletions glassfish-runner/persistence-platform-tck/sql/derby/derby.ddl.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
DROP PROCEDURE GetEmpOneFirstNameFromOut;
CREATE PROCEDURE GetEmpOneFirstNameFromOut (out OUT_PARAM VARCHAR(255)) language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.GetEmpOneFirstNameFromOut' parameter style java;

DROP PROCEDURE GetEmpFirstNameFromOut;
CREATE PROCEDURE GetEmpFirstNameFromOut (in IN_PARAM INTEGER, out OUT_PARAM VARCHAR(255)) language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.GetEmpFirstNameFromOut' parameter style java;

DROP PROCEDURE GetEmpLastNameFromInOut;
CREATE PROCEDURE GetEmpLastNameFromInOut (inout INOUT_PARAM VARCHAR(255)) language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.GetEmpLastNameFromInOut' parameter style java;

DROP PROCEDURE GetEmpASCFromRS;
CREATE PROCEDURE GetEmpASCFromRS() language java dynamic result sets 1 external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.GetEmpASCFromRS' parameter style java;

DROP PROCEDURE GetEmpIdFNameLNameFromRS;
CREATE PROCEDURE GetEmpIdFNameLNameFromRS (in IN_PARAM INTEGER) language java dynamic result sets 1 external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.GetEmpIdFNameLNameFromRS' parameter style java;

DROP PROCEDURE GetEmpIdUsingHireDateFromOut;
CREATE PROCEDURE GetEmpIdUsingHireDateFromOut (in IN_PARAM DATE, out OUT_PARAM INTEGER) language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.GetEmpIdUsingHireDateFromOut' parameter style java;

DROP PROCEDURE UpdateEmpSalaryColumn;
CREATE PROCEDURE UpdateEmpSalaryColumn() language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.UpdateEmpSalaryColumn' parameter style java;

DROP PROCEDURE DeleteAllEmp;
CREATE PROCEDURE DeleteAllEmp() language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.DeleteAllEmp' parameter style java;

DROP FUNCTION REPLACE;
CREATE FUNCTION REPLACE (origin_string VARCHAR(255), old_string VARCHAR(255), new_string VARCHAR(255)) RETURNS VARCHAR(255) language java external name 'ee.jakarta.tck.persistence.storedprocedures.CS_Procs.ReplaceString' parameter style java;


ALTER TABLE PHONE_TABLE DROP CONSTRAINT FK_FOR_ADDRESS ;
ALTER TABLE CUSTOMER_TABLE DROP CONSTRAINT FK5_FOR_CUST ;
ALTER TABLE CUSTOMER_TABLE DROP CONSTRAINT FK6_FOR_CUST ;
Expand Down Expand Up @@ -943,3 +971,6 @@ CREATE TABLE CRITERIA_TEST_COLTABLE(ENT_ID INTEGER NOT NULL, COLVAL VARCHAR(255)

DROP TABLE UUIDTYPE;
CREATE TABLE UUIDTYPE (ID char(16) for bit data NOT NULL, NAME VARCHAR(255), PRIMARY KEY (ID));

CALL sqlj.install_jar('${project.build.directory}/dbprocedures.jar', 'APP.dbprocedures', 0);
CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.classpath', 'APP.dbprocedures');
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
package ee.jakarta.tck.persistence.core.entityManagerFactoryCloseExceptions;

import ee.jakarta.tck.persistence.core.entityManagerFactoryCloseExceptions.Client;
import com.sun.ts.lib.harness.EETest;
import com.sun.ts.lib.harness.ServiceEETest;
import com.sun.ts.tests.common.vehicle.VehicleClient;
import com.sun.ts.tests.common.vehicle.VehicleRunnable;
import com.sun.ts.tests.common.vehicle.VehicleRunnerFactory;
import com.sun.ts.tests.common.vehicle.ejb3share.EJB3ShareBaseBean;
import com.sun.ts.tests.common.vehicle.ejb3share.EJB3ShareIF;
import com.sun.ts.tests.common.vehicle.ejb3share.EntityTransactionWrapper;
import com.sun.ts.tests.common.vehicle.ejb3share.NoopTransactionWrapper;
import com.sun.ts.tests.common.vehicle.ejb3share.UseEntityManager;
import com.sun.ts.tests.common.vehicle.ejb3share.UseEntityManagerFactory;
import com.sun.ts.tests.common.vehicle.ejb3share.UserTransactionWrapper;
import com.sun.ts.tests.common.vehicle.pmservlet.PMServletVehicle;
import com.sun.ts.tests.common.vehicle.servlet.ServletVehicle;

import java.net.URL;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.container.test.api.TargetsContainer;
import org.jboss.arquillian.junit5.ArquillianExtension;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;

import ee.jakarta.tck.persistence.common.PMClientBase;
import tck.arquillian.porting.lib.spi.TestArchiveProcessor;
import tck.arquillian.protocol.common.TargetVehicle;



@ExtendWith(ArquillianExtension.class)
@Tag("persistence")
@Tag("platform")
@Tag("web")
@Tag("tck-javatest")

@TestMethodOrder(MethodOrderer.MethodName.class)
public class ClientPmservletTest extends ee.jakarta.tck.persistence.core.entityManagerFactoryCloseExceptions.Client {
public class ClientPmservletTest extends Client {

private static final long serialVersionUID = 1L;
static final String VEHICLE_ARCHIVE = "jpa_core_entityManagerFactoryCloseException_pmservlet_vehicle";

/**
Expand Down Expand Up @@ -101,13 +113,13 @@ public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchive

return jpa_core_entityManagerFactoryCloseException_pmservlet_vehicle_web;
}
}

@Test
@Override
@TargetVehicle("pmservlet")
public void exceptionsTest() throws java.lang.Exception {
super.exceptionsTest();
}

@Test
@Override
@TargetVehicle("pmservlet")
public void exceptionsTest() throws java.lang.Exception {
super.exceptionsTest();
}

}
Loading

0 comments on commit 057bba4

Please sign in to comment.