From a69bc718249123a0d2048d853a6fc9c7c1f7e644 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 18 Feb 2020 08:15:37 +0100 Subject: update jUnit test for module specific message sources --- .../impl/logging/EaafUtilsMessageSourceTest.java | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'eaaf_core_utils/src/test') diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java index f6df60ae..53ea54dc 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/impl/logging/EaafUtilsMessageSourceTest.java @@ -1,5 +1,9 @@ package at.gv.egiz.eaaf.core.impl.logging; +import java.util.List; + +import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; + import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -9,8 +13,6 @@ import org.springframework.core.io.ResourceLoader; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring/test_eaaf_pvp_not_lazy.beans.xml") public class EaafUtilsMessageSourceTest { @@ -18,19 +20,20 @@ public class EaafUtilsMessageSourceTest { @Autowired private ResourceLoader loader; @Autowired(required = false) - private IMessageSourceLocation messageSource; + private List messageSources; @Test - public void simpleTests() { - Assert.assertNotNull("No messageSource", messageSource); + public void checkMessageSources() { + Assert.assertNotNull("No messageSource", messageSources); - Assert.assertNotNull("No sourcePath", messageSource.getMessageSourceLocation()); + for (final IMessageSourceLocation messageSource : messageSources) { + Assert.assertNotNull("No sourcePath", messageSource.getMessageSourceLocation()); - for (final String el : messageSource.getMessageSourceLocation()) { - final Resource messages = loader.getResource(el + ".properties"); - Assert.assertTrue("Source not exist", messages.exists()); + for (final String el : messageSource.getMessageSourceLocation()) { + final Resource messages = loader.getResource(el + ".properties"); + Assert.assertTrue("Source not exist", messages.exists()); + } } - } } -- cgit v1.2.3