Added test, that configure the JPA-mapping with XML-configuration-files
[jpa-converters] / src / test / java / de / juplo / jpa / converters / JPAConverterTest.java
index 38b84e3..c9f87cf 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,19 @@ public class JPAConverterTest
 
 
   @Test
+  public void testOffsetDateTimeAnnotated()
+  {
+    em = Persistence.createEntityManagerFactory("annotated").createEntityManager();
+    testOffsetDateTime();
+  }
+
+  @Test
+  public void testOffsetDateTimeXml()
+  {
+    em = Persistence.createEntityManagerFactory("xml").createEntityManager();
+    testOffsetDateTime();
+  }
+
   public void testOffsetDateTime()
   {
     EierlegendeWollmilchSau ews;
@@ -58,7 +70,21 @@ public class JPAConverterTest
     assertEquals(odt.toInstant(), ews.odt.toInstant());
   }
 
+
   @Test
+  public void testZonedDateTimeAnnotated()
+  {
+    em = Persistence.createEntityManagerFactory("annotated").createEntityManager();
+    testZonedDateTime();
+  }
+
+  @Test
+  public void testZonedDateTimeXml()
+  {
+    em = Persistence.createEntityManagerFactory("xml").createEntityManager();
+    testZonedDateTime();
+  }
+
   public void testZonedDateTime()
   {
     EierlegendeWollmilchSau ews;