Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Apr 22, 2024
1 parent d7bafcf commit f6311d3
Show file tree
Hide file tree
Showing 27 changed files with 424 additions and 52 deletions.
112 changes: 107 additions & 5 deletions jpa/bin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,16 @@
<jakarta.persistence.jdbc.url>${jakarta.persistence.jdbc.url}</jakarta.persistence.jdbc.url>
<jakarta.persistence.jdbc.user>${jakarta.persistence.jdbc.user}</jakarta.persistence.jdbc.user>
<jakarta.persistence.jdbc.password>${jakarta.persistence.jdbc.password}</jakarta.persistence.jdbc.password>
<jpa.provider.implementation.specific.properties>eclipselink.logging.level=OFF</jpa.provider.implementation.specific.properties>
<persistence.second.level.caching.supported>true</persistence.second.level.caching.supported>
<jpa.provider.implementation.specific.properties>${jpa.provider.implementation.specific.properties}</jpa.provider.implementation.specific.properties>
<persistence.second.level.caching.supported>${persistence.second.level.caching.supported}</persistence.second.level.caching.supported>
<vehicle>standalone</vehicle>
<user.dir>/tmp</user.dir>
<db.supports.sequence>${db.supports.sequence}</db.supports.sequence>
<Insert_Jpa_Purchase_Order>INSERT INTO PURCHASE_ORDER(ID, TOTAL, DESCRIPTION) VALUES(?, ?, null)</Insert_Jpa_Purchase_Order>
<Select_Jpa_Purchase_Order>SELECT ID, TOTAL FROM PURCHASE_ORDER WHERE ID=?</Select_Jpa_Purchase_Order>
<log.file.location>/tmp</log.file.location>
<jdbc.db>${jdbc.db}</jdbc.db>
<sigTestClasspath>${glassfish.module.dir}/jakarta.persistence-api.jar:${project.build.directory}/jdk11-bundle/java.base:${project.build.directory}/jdk11-bundle/java.rmi:${project.build.directory}/jdk11-bundle/java.sql:${project.build.directory}/jdk11-bundle/java.naming
<sigTestClasspath>${glassfish.module.dir}/jakarta.persistence-api.jar${path.separator}${project.build.directory}/jdk11-bundle/java.base${path.separator}${project.build.directory}/jdk11-bundle/java.rmi${path.separator}${project.build.directory}/jdk11-bundle/java.sql${path.separator}${project.build.directory}/jdk11-bundle/java.naming
</sigTestClasspath>
<jimage.dir>${project.build.directory}/jdk11-bundle</jimage.dir>
</systemPropertyVariables>
Expand Down Expand Up @@ -399,8 +399,8 @@
<jakarta.persistence.jdbc.url>${jakarta.persistence.jdbc.url}</jakarta.persistence.jdbc.url>
<jakarta.persistence.jdbc.user>${jakarta.persistence.jdbc.user}</jakarta.persistence.jdbc.user>
<jakarta.persistence.jdbc.password>${jakarta.persistence.jdbc.password}</jakarta.persistence.jdbc.password>
<jpa.provider.implementation.specific.properties>eclipselink.logging.level=OFF</jpa.provider.implementation.specific.properties>
<persistence.second.level.caching.supported>true</persistence.second.level.caching.supported>
<jpa.provider.implementation.specific.properties>${jpa.provider.implementation.specific.properties}</jpa.provider.implementation.specific.properties>
<persistence.second.level.caching.supported>${persistence.second.level.caching.supported}</persistence.second.level.caching.supported>
<vehicle>standalone</vehicle>
<user.dir>/tmp</user.dir>
<db.supports.sequence>${db.supports.sequence}</db.supports.sequence>
Expand Down Expand Up @@ -593,5 +593,107 @@
</plugins>
</build>
</profile>
<profile>
<id>hibernate</id>
<properties>
<glassfish-artifact-id>glassfish</glassfish-artifact-id>
<hibernate.version>7.0.0-SNAPSHOT</hibernate.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-platform</artifactId>
<version>${hibernate.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-testing</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.models</groupId>
<artifactId>hibernate-models</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-hibernate-lib</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${glassfish.module.dir}</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<overWrite>true</overWrite>
<destFileName>hibernate-core.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-testing</artifactId>
<overWrite>true</overWrite>
<destFileName>hibernate-testing.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.hibernate.models</groupId>
<artifactId>hibernate-models</artifactId>
<overWrite>true</overWrite>
<destFileName>hibernate-models.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
<overWrite>true</overWrite>
<destFileName>jandex.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<overWrite>true</overWrite>
<destFileName>antlr4-runtime.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<overWrite>true</overWrite>
<destFileName>byte-buddy.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
8 changes: 8 additions & 0 deletions jpa/platform-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
</parent>
<artifactId>persistence-tck-platform-tests</artifactId>
<packaging>jar</packaging>

<repositories>
<repository>
<id>repo2</id>
<name>staging repo</name>
<url>https://jakarta.oss.sonatype.org/content/repositories/staging</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
14 changes: 14 additions & 0 deletions jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
<packaging>pom</packaging>
<name>persistence</name>
<description>persistence tck tests</description>

<repositories>
<repository>
<id>repo2</id>
<name>staging repo</name>
<url>https://jakarta.oss.sonatype.org/content/repositories/staging</url>
</repository>
</repositories>
<modules>
<module>common</module>
<module>docs/userguide</module>
Expand Down Expand Up @@ -96,6 +104,12 @@
<artifactId>shrinkwrap-api</artifactId>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<version>3.1.4</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
58 changes: 58 additions & 0 deletions jpa/spec-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,62 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>hibernate</id>
<properties>
<hibernate.version>7.0.0-SNAPSHOT</hibernate.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-platform</artifactId>
<version>${hibernate.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-testing</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.models</groupId>
<artifactId>hibernate-models</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>postgresql</id>
<properties>
<postgresql.jdbc.version>7.0.0-SNAPSHOT</postgresql.jdbc.version>
</properties>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.6.2</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public void discriminatorColumnTest() throws Exception {
// CREATE TABLE SCHEMAGENSIMPLE (ID INTEGER NOT NULL, PRODUCT_TYPE
// VARCHAR(31), PRIMARY KEY (ID))

pass2 = findDataInFile(f2, "DROP TABLE SCHEMAGENSIMPLE");
expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGENSIMPLE");
pass2 = findDataInFile(f2, expected);

logger.log(Logger.Level.TRACE, "Execute the create script");
props = getPersistenceUnitProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public void enumeratedTest() throws Exception {
// CREATE TABLE SCHEMAGENSIMPLE (ID INTEGER NOT NULL, ENUMDATA VARCHAR(255),
// PRIMARY KEY (ID))

pass2 = findDataInFile(f2, "DROP TABLE SCHEMAGENSIMPLE");
expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGENSIMPLE");
pass2 = findDataInFile(f2, expected);

logger.log(Logger.Level.TRACE, "Execute the create script");
props = getPersistenceUnitProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public void idTest() throws Exception {
pass1 = findDataInFile(f1, expected);
// CREATE TABLE SCHEMAGENSIMPLE (ID INTEGER NOT NULL, PRIMARY KEY (ID))

pass2 = findDataInFile(f2, "DROP TABLE SCHEMAGENSIMPLE");
expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGENSIMPLE");
pass2 = findDataInFile(f2, expected);

logger.log(Logger.Level.TRACE, "Execute the create script");
props = getPersistenceUnitProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,26 @@ public void indexTest() throws Exception {
* INDEX SCHEMAGENSIMPLE_SVALUE3 ON SCHEMAGENSIMPLE (SVALUE3)
*/
expected.clear();
expected.add("ALTER TABLE SCHEMAGENSIMPLE");
expected.add("ALTER TABLE");
expected.add("SCHEMAGENSIMPLE");
expected.add("ADD");
expected.add("INDEX SCHEMAGENSIMPLE_SVALUE_ASC");

pass1b = findDataInFile(f1, "CREATE INDEX SCHEMAGENSIMPLE_SVALUE_ASC ON SCHEMAGENSIMPLE (SVALUE)");
pass1b = pass1b || findDataInFile(f1, expected);

expected.clear();
expected.add("ALTER TABLE SCHEMAGENSIMPLE");
expected.add("ALTER TABLE");
expected.add("SCHEMAGENSIMPLE");
expected.add("ADD");
expected.add("INDEX SCHEMAGENSIMPLE_SVALUE2_DESC");

pass1c = findDataInFile(f1, "CREATE INDEX SCHEMAGENSIMPLE_SVALUE2_DESC ON SCHEMAGENSIMPLE (SVALUE2 DESC)");
pass1c = pass1c || findDataInFile(f1, expected);

expected.clear();
expected.add("ALTER TABLE SCHEMAGENSIMPLE");
expected.add("ALTER TABLE");
expected.add("SCHEMAGENSIMPLE");
expected.add("ADD");
expected.add("UNIQUE");
expected.add("INDEX SCHEMAGENSIMPLE_SVALUE3");
Expand All @@ -182,15 +185,20 @@ public void indexTest() throws Exception {
pass1d = pass1d || findDataInFile(f1, expected);

expected.clear();
expected.add("ALTER TABLE SCHEMAGENSIMPLE");
expected.add("ALTER TABLE");
expected.add("SCHEMAGENSIMPLE");
expected.add("ADD");
expected.add("CONSTRAINT");
expected.add("SCHEMAGENSIMPLE_SVALUE3");
expected.add("UNIQUE");

pass1d = pass1d || findDataInFile(f1, "CONSTRAINT SCHEMAGENSIMPLE_SVALUE3 UNIQUE (SVALUE3)");
pass1d = pass1d || findDataInFile(f1, expected);

pass2a = findDataInFile(f2, "DROP TABLE SCHEMAGENSIMPLE");
expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGENSIMPLE");
pass2a = findDataInFile(f2, expected);
/*
* Index can be dropped using ALTER TABLE AS WELL Bug 27422087: Some databases
* do drop things such as indexes and constraints associated with a table when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,15 @@ public void joinTableTest() throws Exception {
pass1c = findDataInFile(f1, expected);

expected.clear();
expected.add("ALTER TABLE SCHEMAGEN_COURSE_STUDENT ADD");
expected.add("ALTER TABLE");
expected.add("SCHEMAGEN_COURSE_STUDENT ADD");
expected.add("CONSTRAINT STUDENTIDCONSTRAINT");
expected.add("SCHEMAGENSTUDENT");
pass1d = findDataInFile(f1, expected);

expected.clear();
expected.add("ALTER TABLE SCHEMAGEN_COURSE_STUDENT ADD");
expected.add("ALTER TABLE");
expected.add("SCHEMAGEN_COURSE_STUDENT ADD");
expected.add("CONSTRAINT COURSEIDCONSTRAINT");
expected.add("SCHEMAGENCOURSE");
pass1e = findDataInFile(f1, expected);
Expand All @@ -186,20 +188,33 @@ public void joinTableTest() throws Exception {
pass2a = findDataInFile(f2, new LinkedList<String>() {
private static final long serialVersionUID = 22L;
{
add("ALTER TABLE SCHEMAGEN_COURSE_STUDENT DROP");
add("ALTER TABLE");
add("SCHEMAGEN_COURSE_STUDENT DROP");
add("STUDENTIDCONSTRAINT");
}
});
pass2b = findDataInFile(f2, new LinkedList<String>() {
private static final long serialVersionUID = 22L;
{
add("ALTER TABLE SCHEMAGEN_COURSE_STUDENT DROP");
add("ALTER TABLE");
add("SCHEMAGEN_COURSE_STUDENT DROP");
add("COURSEIDCONSTRAINT");
}
});
pass2c = findDataInFile(f2, "DROP TABLE SCHEMAGEN_COURSE_STUDENT");
pass2d = findDataInFile(f2, "DROP TABLE SCHEMAGENCOURSE");
pass2e = findDataInFile(f2, "DROP TABLE SCHEMAGENSTUDENT");
expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGEN_COURSE_STUDENT");
pass2c = findDataInFile(f2, expected);

expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGENCOURSE");
pass2d = findDataInFile(f2, expected);

expected.clear();
expected.add("DROP TABLE");
expected.add("SCHEMAGENSTUDENT");
pass2e = findDataInFile(f2, expected);

logger.log(Logger.Level.TRACE, "Execute the create script");
props = getPersistenceUnitProperties();
Expand Down
Loading

0 comments on commit f6311d3

Please sign in to comment.