diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-02-20 09:43:03 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-02-20 09:43:03 +0100 |
commit | a57a2ed851b818456421f3ce082dc6813da6b736 (patch) | |
tree | b4c9c4c9f7c317ff3f0686d7427366203bdd9347 /eaaf_core/src/test | |
parent | 9e26dd0833cd3a6bfb6f15cc11727cdc8e14d260 (diff) | |
download | EAAF-Components-a57a2ed851b818456421f3ce082dc6813da6b736.tar.gz EAAF-Components-a57a2ed851b818456421f3ce082dc6813da6b736.tar.bz2 EAAF-Components-a57a2ed851b818456421f3ce082dc6813da6b736.zip |
add two jUnit test and CodeStyle modifications
Diffstat (limited to 'eaaf_core/src/test')
2 files changed, 42 insertions, 2 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreMessageSourceTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreMessageSourceTest.java new file mode 100644 index 00000000..a354b873 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/EaafCoreMessageSourceTest.java @@ -0,0 +1,41 @@ +package at.gv.egiz.eaaf.core.impl.idp.auth; + +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; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration({ "/eaaf_core.beans.xml", + "/SpringTest-context_eaaf_core.xml", + "/SpringTest-context_authManager.xml"}) +public class EaafCoreMessageSourceTest { + + @Autowired + private ResourceLoader loader; + @Autowired(required = false) + private List<IMessageSourceLocation> messageSources; + + @Test + public void checkMessageSources() { + Assert.assertNotNull("No messageSource", messageSources); + + 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()); + + } + } + } +} diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java index dd3976dd..e295d69a 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyConfiguration.java @@ -22,8 +22,7 @@ public class DummyConfiguration implements IConfigurationWithSP { @Override public String getBasicConfiguration(final String key, final String defaultValue) { - // TODO Auto-generated method stub - return null; + return defaultValue; } @Override |