From 40f11af561b8e0095f2c4cfbbd2f87988fef93d7 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 16 Aug 2017 10:37:49 +0200 Subject: [PATCH] Added test, that configure the JPA-mapping with XML-configuration-files --- .../jpa/converters/JPAConverterTest.java | 15 +++++++++++++++ src/test/resources/META-INF/mapping.xml | 19 +++++++++++++++++++ src/test/resources/META-INF/persistence.xml | 15 +++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 src/test/resources/META-INF/mapping.xml diff --git a/src/test/java/de/juplo/jpa/converters/JPAConverterTest.java b/src/test/java/de/juplo/jpa/converters/JPAConverterTest.java index 79e4405..c9f87cf 100644 --- a/src/test/java/de/juplo/jpa/converters/JPAConverterTest.java +++ b/src/test/java/de/juplo/jpa/converters/JPAConverterTest.java @@ -43,6 +43,13 @@ public class JPAConverterTest testOffsetDateTime(); } + @Test + public void testOffsetDateTimeXml() + { + em = Persistence.createEntityManagerFactory("xml").createEntityManager(); + testOffsetDateTime(); + } + public void testOffsetDateTime() { EierlegendeWollmilchSau ews; @@ -63,6 +70,7 @@ public class JPAConverterTest assertEquals(odt.toInstant(), ews.odt.toInstant()); } + @Test public void testZonedDateTimeAnnotated() { @@ -70,6 +78,13 @@ public class JPAConverterTest testZonedDateTime(); } + @Test + public void testZonedDateTimeXml() + { + em = Persistence.createEntityManagerFactory("xml").createEntityManager(); + testZonedDateTime(); + } + public void testZonedDateTime() { EierlegendeWollmilchSau ews; diff --git a/src/test/resources/META-INF/mapping.xml b/src/test/resources/META-INF/mapping.xml new file mode 100644 index 0000000..6b49b11 --- /dev/null +++ b/src/test/resources/META-INF/mapping.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/src/test/resources/META-INF/persistence.xml b/src/test/resources/META-INF/persistence.xml index f6fffeb..603cd73 100644 --- a/src/test/resources/META-INF/persistence.xml +++ b/src/test/resources/META-INF/persistence.xml @@ -18,4 +18,19 @@ + + Classes are mapped with XML-configuration-files + META-INF/mapping.xml + true + + + + + + + + + + + -- 2.20.1