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

Initial draft of Jakarta Persistence/CDI EE integration tests #1623

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions glassfish-runner/jpa-platform-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@
<artifactId>derbytools</artifactId>
<version>10.15.2.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.deployment</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just temp to help with debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, leftover from looking at adding a glassfish annotation handler to the test deployment.

<artifactId>dol</artifactId>
<version>${glassfish.container.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>persistence-platform-tck-tests</artifactId>
<version>11.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -616,6 +627,8 @@
<java.io.tmpdir>/tmp</java.io.tmpdir>
<project.basedir>${project.basedir}</project.basedir>
<arquillian.xml>rest-arquillian.xml</arquillian.xml>
<glassfish.debug>true</glassfish.debug>
<glassfish.suspend>false</glassfish.suspend>
</systemPropertyVariables>
<environmentVariables>
<GLASSFISH_HOME>${project.build.directory}/${glassfish.toplevel.dir}</GLASSFISH_HOME>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public class ServletEMLookupTest {
@ArquillianResource
URL contextPath;

@Deployment(name = "rest-em-lookup", testable = false)
@Deployment(name = "jpa-cdi-em-inject", testable = false)
public static WebArchive deployment(@ArquillianResource TestArchiveProcessor archiveProcessor) {
WebArchive war = ShrinkWrap.create(WebArchive.class, "rest-em-lookup.war")
WebArchive war = ShrinkWrap.create(WebArchive.class)
.addClasses(CtsEmQualifier.class, CtsEmNoTxQualifier.class, JaxRsActivator.class,
TestBeanEM.class, RestEndpoint.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.inject.Inject;
import jakarta.enterprise.context.RequestScoped;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;

import java.util.logging.Logger;

Expand All @@ -13,12 +14,12 @@
public class TestBeanEM {
Logger logger = Logger.getLogger(TestBeanEM.class.getName());

//@PersistenceUnit(unitName = "CTS-EM")
@CtsEmQualifier
@Inject
@PersistenceContext(unitName = "CTS-EM")
//@CtsEmQualifier
//@Inject
private EntityManager em1;
//@PersistenceUnit(unitName = "CTS-EM-NOTX")
@CtsEmNoTxQualifier
//@PersistenceContext(unitName = "CTS-EM2")
@CtsEmQualifier
@Inject
private EntityManager em2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
</persistence-unit>
<persistence-unit name="CTS-EM2" transaction-type="JTA">
<description>Persistence Unit for CTS Vehicle Tests</description>
<qualifier>ee.jakarta.tck.persistence.ee.cdi.CtsEmQualifier</qualifier>
<jta-data-source>jdbc/DB1</jta-data-source>
<class>ee.jakarta.tck.persistence.ee.entityManager.Order</class>
</persistence-unit>
<persistence-unit name="CTS-EM-NOTX" transaction-type="RESOURCE_LOCAL">
<description>The persistence.xml file may be used to designate
more than one persistence unit within the same scope.
Persistence Unit for Application Managed Resource Local</description>
<qualifier>ee.jakarta.tck.persistence.ee.cdi.CtsEmNoTxQualifier</qualifier>
<non-jta-data-source>jdbc/DB_no_tx</non-jta-data-source>
<class>ee.jakarta.tck.persistence.ee.entityManager.Order</class>
</persistence-unit>
Expand Down