1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.plugin;
17
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertNotNull;
20
21 import java.io.File;
22 import java.util.List;
23
24 import org.junit.Test;
25 import org.kuali.rice.core.api.config.property.ConfigContext;
26 import org.kuali.rice.core.framework.resourceloader.BaseResourceLoader;
27 import org.kuali.rice.kew.test.KEWTestCase;
28
29
30
31
32
33
34
35 public class PluginConfigParserTest extends KEWTestCase {
36
37 private PluginConfigParser parser = new PluginConfigParser();
38 private static final String CONFIG_PATH_SUFFIX = "/src/test/resources/org/kuali/rice/kew/plugin/workflow.xml";
39
40 @Test public void testParse() throws Exception {
41
42 PluginConfig plugin = parser.parse(new File(getBaseDir() + CONFIG_PATH_SUFFIX), ConfigContext.getCurrentContextConfig());
43 assertNotNull(plugin);
44
45 List listeners = plugin.getListeners();
46 assertNotNull(listeners);
47 assertEquals(2, listeners.size());
48 String listenerClassName1 = (String)listeners.get(0);
49 String listenerClassName2 = (String)listeners.get(1);
50 assertEquals("org.kuali.rice.kew.plugin.TestPluginListener", listenerClassName1);
51 assertEquals("org.kuali.rice.kew.plugin.TestPluginListener2", listenerClassName2);
52
53 assertEquals("Plugin resource loader classname should be base resource loader", BaseResourceLoader.class.getName(), plugin.getResourceLoaderClassname());
54 }
55
56 }