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

JPA standalone TCK refactor with Junit. #1202

Merged
merged 20 commits into from
Feb 7, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
363 changes: 363 additions & 0 deletions glassfish-runner/jpa-tck/pom.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
DROP PROCEDURE GetEmpOneFirstNameFromOut;
CREATE PROCEDURE GetEmpOneFirstNameFromOut (out OUT_PARAM VARCHAR(255)) language java external name 'com.sun.ts.lib.tests.jpa.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 'com.sun.ts.lib.tests.jpa.storedprocedures.CS_Procs.GetEmpFirstNameFromOut' parameter style java;

DROP PROCEDURE GetEmpLastNameFromInOut;
CREATE PROCEDURE GetEmpLastNameFromInOut (inout INOUT_PARAM VARCHAR(255)) language java external name 'com.sun.ts.lib.tests.jpa.storedprocedures.CS_Procs.GetEmpLastNameFromInOut' parameter style java;

DROP PROCEDURE GetEmpASCFromRS;
CREATE PROCEDURE GetEmpASCFromRS() language java dynamic result sets 1 external name 'com.sun.ts.lib.tests.jpa.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 'com.sun.ts.lib.tests.jpa.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 'com.sun.ts.lib.tests.jpa.storedprocedures.CS_Procs.GetEmpIdUsingHireDateFromOut' parameter style java;

DROP PROCEDURE UpdateEmpSalaryColumn;
CREATE PROCEDURE UpdateEmpSalaryColumn() language java external name 'com.sun.ts.lib.tests.jpa.storedprocedures.CS_Procs.UpdateEmpSalaryColumn' parameter style java;

DROP PROCEDURE DeleteAllEmp;
CREATE PROCEDURE DeleteAllEmp() language java external name 'com.sun.ts.lib.tests.jpa.storedprocedures.CS_Procs.DeleteAllEmp' parameter style java;
929 changes: 929 additions & 0 deletions glassfish-runner/jpa-tck/sql/derby/derby.ddl.persistence.sql

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions glassfish-runner/jpa-tck/sql/derby/derby.dml.jpa.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Insert_Jpa_Purchase_Order= INSERT INTO PURCHASE_ORDER(ID, TOTAL, DESCRIPTION) VALUES(?, ?, null)
Select_Jpa_Purchase_Order= SELECT ID, TOTAL FROM PURCHASE_ORDER WHERE ID=?
2 changes: 1 addition & 1 deletion glassfish-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<properties>
<glassfish-artifact-id>glassfish</glassfish-artifact-id>

<glassfish.container.version>7.0.0-M10</glassfish.container.version>
<glassfish.container.version>7.0.0</glassfish.container.version>
<glassfish.toplevel.dir>glassfish7</glassfish.toplevel.dir>
<jakarta.rest.version>3.1.0</jakarta.rest.version>
<json.tck.version>2.1.0</json.tck.version>
Expand Down
1 change: 1 addition & 0 deletions glassfish-runner/websocket-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
</artifactItems>
</configuration>
</execution>

</executions>
</plugin>
<plugin>
Expand Down
34 changes: 23 additions & 11 deletions jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,22 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>jakartatck</groupId>
<artifactId>project</artifactId>
<version>10.0.0-SNAPSHOT</version>
</parent>

<artifactId>jpa</artifactId>
<packaging>jar</packaging>

<artifactId>jpa-tck</artifactId>
<name>JPA</name>
<description>JPA</description>

<properties>
<arquillian.junit>1.7.0.Alpha14</arquillian.junit>
<junit.jupiter.version>5.9.1</junit.jupiter.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<tck.version>${project.version}</tck.version>
</properties>
<dependencies>
<dependency>
<groupId>javatest</groupId>
<artifactId>javatest</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>libutil</artifactId>
Expand All @@ -57,6 +55,20 @@
<groupId>jakarta.ejb</groupId>
<artifactId>jakarta.ejb-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-core</artifactId>
<version>${arquillian.junit}</version>
</dependency>
</dependencies>

</project>
40 changes: 0 additions & 40 deletions jpa/src/main/java/com/sun/ts/tests/jpa/build.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -16,37 +16,38 @@

package com.sun.ts.tests.jpa.common;

import java.lang.System.Logger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;

import com.sun.ts.lib.util.TestUtil;

public class DriverManagerConnection {

public Connection getConnection(Properties p) throws Exception {
String dbUrl, dbUser, dbPassword, dbDriver;
dbUrl = dbUser = dbPassword = dbDriver = null;
private static final Logger logger = (Logger) System.getLogger(DriverManagerConnection.class.getName());

public Connection getConnection(Properties p) throws Exception {
String dbUrl, dbUser, dbPassword, dbDriver;
dbUrl = dbUser = dbPassword = dbDriver = null;

dbUrl = p.getProperty("jakarta.persistence.jdbc.url", "");
dbUser = p.getProperty("jakarta.persistence.jdbc.user", "");
dbPassword = p.getProperty("jakarta.persistence.jdbc.password", "");
dbDriver = p.getProperty("jakarta.persistence.jdbc.driver", "");
dbUrl = p.getProperty("jakarta.persistence.jdbc.url", "");
dbUser = p.getProperty("jakarta.persistence.jdbc.user", "");
dbPassword = p.getProperty("jakarta.persistence.jdbc.password", "");
dbDriver = p.getProperty("jakarta.persistence.jdbc.driver", "");

TestUtil.logTrace("Url : " + dbUrl);
TestUtil.logTrace("Username : " + dbUser);
TestUtil.logTrace("Password : " + dbPassword);
TestUtil.logTrace("Driver : " + dbDriver);
logger.log(Logger.Level.TRACE, "Url : " + dbUrl);
logger.log(Logger.Level.TRACE, "Username : " + dbUser);
logger.log(Logger.Level.TRACE, "Password : " + dbPassword);
logger.log(Logger.Level.TRACE, "Driver : " + dbDriver);

TestUtil.logTrace("About to load the driver class");
Class.forName(dbDriver);
TestUtil.logMsg("Successfully loaded the driver class");
logger.log(Logger.Level.TRACE, "About to load the driver class");
Class.forName(dbDriver);
logger.log(Logger.Level.INFO, "Successfully loaded the driver class");

TestUtil.logTrace("About to make the DB connection");
Connection con = DriverManager.getConnection(dbUrl, dbUser, dbPassword);
TestUtil.logMsg("Made the JDBC connection to the DB");
logger.log(Logger.Level.TRACE, "About to make the DB connection");
Connection con = DriverManager.getConnection(dbUrl, dbUser, dbPassword);
logger.log(Logger.Level.INFO, "Made the JDBC connection to the DB");

return con;
}
return con;
}

}
Loading
Loading