Skip to content

Commit

Permalink
Merge pull request #1651 from arjantijms/issue1405
Browse files Browse the repository at this point in the history
Fix qualifier for CTS-EM2
  • Loading branch information
arjantijms authored Nov 17, 2024
2 parents d40abfa + 39de137 commit 609e754
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package ee.jakarta.tck.persistence.ee.cdi;

import jakarta.inject.Qualifier;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Qualifier for selecting the CTS-EM2 persistence unit.
*/
@Qualifier
@Documented
@Retention(RUNTIME)
@Target({ FIELD, METHOD })
public @interface CtsEm2Qualifier {
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ServletEMLookupTest {
@Deployment(name = "jpa-cdi-em-inject", testable = false)
public static WebArchive deployment(@ArquillianResource TestArchiveProcessor archiveProcessor) {
WebArchive war = ShrinkWrap.create(WebArchive.class)
.addClasses(CtsEmQualifier.class, CtsEmNoTxQualifier.class, JaxRsActivator.class,
.addClasses(CtsEmQualifier.class, CtsEm2Qualifier.class, CtsEmNoTxQualifier.class, JaxRsActivator.class,
TestBeanEM.class, RestEndpoint.class);

// Par
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
<jta-data-source>jdbc/DB1</jta-data-source>
<class>ee.jakarta.tck.persistence.ee.entityManager.Order</class>
</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>
<qualifier>ee.jakarta.tck.persistence.ee.cdi.CtsEm2Qualifier</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.
Expand Down

0 comments on commit 609e754

Please sign in to comment.