Prepared for the addition of a second persistence-unit
authorKai Moritz <kai@juplo.de>
Tue, 15 Aug 2017 18:13:52 +0000 (20:13 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 16 Aug 2017 11:36:33 +0000 (13:36 +0200)
src/test/java/de/juplo/jpa/converters/JPAConverterTest.java
src/test/resources/META-INF/persistence.xml

index 38b84e3..79e4405 100644 (file)
@@ -24,8 +24,7 @@ public class JPAConverterTest
   final static Logger log = LoggerFactory.getLogger(JPAConverterTest.class);
 
 
-  EntityManager em =
-      Persistence.createEntityManagerFactory("test").createEntityManager();
+  EntityManager em;
 
   ZonedDateTime zdt = ZonedDateTime.now();
   OffsetDateTime odt = OffsetDateTime.now();
@@ -38,6 +37,12 @@ public class JPAConverterTest
 
 
   @Test
+  public void testOffsetDateTimeAnnotated()
+  {
+    em = Persistence.createEntityManagerFactory("annotated").createEntityManager();
+    testOffsetDateTime();
+  }
+
   public void testOffsetDateTime()
   {
     EierlegendeWollmilchSau ews;
@@ -59,6 +64,12 @@ public class JPAConverterTest
   }
 
   @Test
+  public void testZonedDateTimeAnnotated()
+  {
+    em = Persistence.createEntityManagerFactory("annotated").createEntityManager();
+    testZonedDateTime();
+  }
+
   public void testZonedDateTime()
   {
     EierlegendeWollmilchSau ews;
index 75ee68d..1de7f0a 100644 (file)
@@ -4,7 +4,7 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     version="1.0">
 
-  <persistence-unit name="test">
+  <persistence-unit name="annotated">
     <class>de.juplo.jpa.converters.OffsetDateTime</class>
     <class>de.juplo.jpa.converters.ZonedDateTime</class>
     <properties>