Skip to content

Commit

Permalink
Move PU-specific test entities into their own packages
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Mar 27, 2024
1 parent d7d237b commit 9d58018
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import jakarta.ws.rs.core.MediaType;

import io.quarkus.hibernate.orm.PersistenceUnit;
import io.quarkus.it.jpa.postgresql.defaultpu.EntityWithXml;
import io.quarkus.it.jpa.postgresql.defaultpu.Person;
import io.quarkus.it.jpa.postgresql.defaultpu.SequencedAddress;
import io.quarkus.it.jpa.postgresql.otherpu.EntityWithXmlOtherPU;
import io.quarkus.narayana.jta.QuarkusTransaction;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

public enum Status {
LIVING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ quarkus.datasource.password=hibernate_orm_test
quarkus.datasource.jdbc.url=${postgres.url}
quarkus.datasource.jdbc.max-size=8

quarkus.hibernate-orm.packages=io.quarkus.it.jpa.postgresql
quarkus.hibernate-orm.packages=io.quarkus.it.jpa.postgresql.defaultpu
quarkus.hibernate-orm.database.generation=drop-and-create

#Necessary for assertions in JPAFunctionalityInGraalITCase:
Expand All @@ -14,4 +14,5 @@ quarkus.native.additional-build-args=-J-Dio.quarkus.jdbc.postgresql.graalvm.diag

# Define non-default PU so that we can configure a custom XML format mapper. The default PU is using the default mapper.
quarkus.hibernate-orm."other".datasource=<default>
quarkus.hibernate-orm."other".packages=io.quarkus.it.jpa.postgresql.otherpu
quarkus.hibernate-orm."other".packages=io.quarkus.it.jpa.postgresql.otherpu
quarkus.hibernate-orm."other".database.generation=drop-and-create
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
import jakarta.ws.rs.core.MediaType;

import io.quarkus.hibernate.orm.PersistenceUnit;
import io.quarkus.it.jpa.postgresql.defaultpu.EntityWithJson;
import io.quarkus.it.jpa.postgresql.defaultpu.MyUUIDEntity;
import io.quarkus.it.jpa.postgresql.defaultpu.Person;
import io.quarkus.it.jpa.postgresql.defaultpu.SequencedAddress;
import io.quarkus.it.jpa.postgresql.otherpu.EntityWithJsonOtherPU;
import io.quarkus.narayana.jta.QuarkusTransaction;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import io.quarkus.it.jpa.postgresql.defaultpu.Address;
import io.quarkus.it.jpa.postgresql.defaultpu.Customer;
import io.quarkus.it.jpa.postgresql.defaultpu.NotAnEntityNotReferenced;
import io.quarkus.it.jpa.postgresql.defaultpu.WorkAddress;

/**
* Various tests for the JPA integration.
* WARNING: these tests will ONLY pass in native mode, as it also verifies reflection non-functionality.
Expand All @@ -32,8 +37,9 @@ public String test() throws SQLException, TransformerException, IOException {
makeSureNonAnnotatedEmbeddableAreAccessibleViaReflection(errors);
makeSureAnnotatedEmbeddableAreAccessibleViaReflection(errors);
String packageName = this.getClass().getPackage().getName();
makeSureClassAreAccessibleViaReflection(packageName + ".Human", "Unable to enlist @MappedSuperclass", errors);
makeSureClassAreAccessibleViaReflection(packageName + ".Animal", "Unable to enlist entity superclass", errors);
makeSureClassAreAccessibleViaReflection(packageName + ".defaultpu.Human", "Unable to enlist @MappedSuperclass", errors);
makeSureClassAreAccessibleViaReflection(packageName + ".defaultpu.Animal", "Unable to enlist entity superclass",
errors);
if (errors.isEmpty()) {
return "OK";
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.Embeddable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

/**
* @author Emmanuel Bernard emmanuel@hibernate.org
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.MappedSuperclass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

/**
* Should not be referenced by the code
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import java.time.Duration;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

public enum Status {
LIVING,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.it.jpa.postgresql;
package io.quarkus.it.jpa.postgresql.defaultpu;

import jakarta.persistence.Embeddable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ quarkus.datasource.password=hibernate_orm_test
quarkus.datasource.jdbc.url=${postgres.url}
quarkus.datasource.jdbc.max-size=8

quarkus.hibernate-orm.packages=io.quarkus.it.jpa.postgresql
quarkus.hibernate-orm.packages=io.quarkus.it.jpa.postgresql.defaultpu
quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.hibernate-orm.database.generation.create-schemas=true
# Define non-default PU so that we can configure a custom JSON format mapper. The default PU is using the default mapper.
quarkus.hibernate-orm."other".datasource=<default>
quarkus.hibernate-orm."other".packages=io.quarkus.it.jpa.postgresql.otherpu
quarkus.hibernate-orm."other".database.generation=drop-and-create
quarkus.hibernate-orm."other".database.generation.create-schemas=true

#Necessary for assertions in JPAFunctionalityInGraalITCase:
quarkus.native.enable-reports=true

0 comments on commit 9d58018

Please sign in to comment.