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

Shorten and tidy the GF persistence runner TCK somewhat #1745

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 54 additions & 104 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-->
</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');
Loading