01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.plugin;
18:
19: import org.junit.Ignore;
20: import org.junit.Test;
21: import org.kuali.workflow.test.WorkflowTestCase;
22:
23: /**
24: * Tests that the PluginManifestParser properly parses the plugin manifest xml file.
25: *
26: * @author ewestfal
27: */
28: public class PluginManifestParserTest extends WorkflowTestCase {
29:
30: // private PluginManifestParser parser = new PluginManifestParser();
31: // private static final String MANIFEST_PATH = "test/src/edu/iu/uis/eden/plugin/workflow.xml";
32: // private static final String EDEN_NAME = "jdbc/dev/en/EDEN";
33: // private static final String SUDS_NAME = "jdbc/dev/en/SUDS";
34: // private static final String DS_TYPE = "javax.sql.DataSource";
35: // private static final String FACTORY = "org.apache.commons.dbcp.BasicDataSourceFactory";
36: // private static final String URL = "jdbc:oracle:thin:@es01.uits.indiana.edu:1521:GEN2DEV";
37:
38: // public PluginManifestParserTest(String name) {
39: // super(name);
40: // }
41:
42: @Ignore("Re-implement this test according to EN-583")
43: @Test
44: public void testParse() throws Exception {
45:
46: // PluginManifest plugin = parser.parse(new File(MANIFEST_PATH), Core.getRootConfig());
47: // assertNotNull(plugin);
48: // assertEquals(5, plugin.getExtensions().size());
49: //
50: // List extensions = plugin.getExtensions();
51: // Iterator extIter = extensions.iterator();
52: // int foundCounter = 0;
53: // while (extIter.hasNext()) {
54: // ExtensionConfig ec = (ExtensionConfig) extIter.next();
55: // if ("userService".equals(ec.getPoint()) && "edu.iu.uis.eden.user.impl.IUUserServiceExtension".equals(ec.getExtensionClass())) {
56: // foundCounter++;
57: // } else if ("workgroupService".equals(ec.getPoint()) && "edu.iu.uis.eden.workgroup.IUWorkgroupServiceExtension".equals(ec.getExtensionClass())) {
58: // foundCounter++;
59: // } else if ("lookupableService".equals(ec.getPoint()) && "edu.iu.uis.eden.lookupable.IULookupableServiceExtension".equals(ec.getExtensionClass())) {
60: // foundCounter++;
61: // } else if ("webAuthenticationService".equals(ec.getPoint()) && "edu.iu.uis.eden.web.IUWebAuthenticationServiceExtension".equals(ec.getExtensionClass())) {
62: // foundCounter++;
63: // } else if ("notes".equals(ec.getPoint()) && "edu.iu.uis.eden.plugin.extension.ConfigurableNotesExtension".equals(ec.getExtensionClass())) {
64: // foundCounter++;
65: // }
66: // if ("notes".equals(ec.getPoint())) {
67: // assertEquals(1, ec.getParameters().size());
68: // assertEquals(true, ec.getParameters().containsKey("defaultClass"));
69: // String parameter1 = (String)ec.getParameters().get("defaultClass");
70: // assertNotNull(parameter1);
71: // assertEquals("edu.iu.uis.eden.notes.DefaultNoteAttribute", parameter1);
72: // }
73: // }
74: //
75: // assertEquals(5, foundCounter);
76: // List listeners = plugin.getListeners();
77: // assertNotNull(listeners);
78: // assertEquals(2, listeners.size());
79: // String listenerClassName1 = (String)listeners.get(0);
80: // String listenerClassName2 = (String)listeners.get(1);
81: // assertEquals("edu.iu.uis.eden.plugin.TestPluginListener", listenerClassName1);
82: // assertEquals("edu.iu.uis.eden.plugin.TestPluginListener2", listenerClassName2);
83: }
84:
85: }
|