blob: 4f9e455a2ffc0c117fd5805878b61e647268eedd [file] [log] [blame]
Michael Hanl1e18cb42015-08-06 20:57:35 +02001import de.ids_mannheim.korap.config.BeanConfiguration;
2import de.ids_mannheim.korap.config.PluginHandler;
3import de.ids_mannheim.korap.interfaces.AuditingIface;
4import de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing;
5import org.junit.Test;
6
7/**
8 * @author hanl
9 * @date 27/07/2015
10 */
11public class ClassLoaderTest {
12
13 @Test
14 public void testBeanConfigurationLoaderThrowsNoException() {
15 BeanConfiguration.loadClasspathContext("classpath-config.xml");
16 assert BeanConfiguration.getBeans() != null;
17 }
18
19 @Test
20 public void testDefaultCreationThrowsNoException() {
21 PluginHandler pl = new PluginHandler();
22 Object o = pl.getDefault(BeanConfiguration.KUSTVAKT_AUDITING);
23 assert o != null;
24 }
25
26 @Test(expected = RuntimeException.class)
27 public void testDefaultCreationThrowsException() {
28 BeanConfiguration.loadClasspathContext();
29 BeanConfiguration.getBeans().getAuthenticationManager();
30 }
31
32 @Test
33 public void testDefaultInterfaceMatchThrowsNoException() {
34 BeanConfiguration.loadClasspathContext();
35 AuditingIface iface = BeanConfiguration.getBeans()
36 .getAuditingProvider();
37 assert iface != null;
38 assert iface instanceof DefaultAuditing;
39 }
40
41}