package at.gv.egiz.eaaf.modules.pvp2.test; import java.util.List; 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.TestPropertySource; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "/spring/test_eaaf_pvp.beans.xml", "/spring/test_eaaf_core_spring_config.beans.xml", "/spring/eaaf_utils.beans.xml" }) @TestPropertySource(locations = { "/config/config_1.props" }) public class PvpCoreMessageSourceTest { @Autowired private ResourceLoader loader; @Autowired(required = false) private List 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()); } } } }