01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. The ASF licenses this file to You
04: * under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License. For additional information regarding
15: * copyright in this work, please see the NOTICE file in the top level
16: * directory of this distribution.
17: */
18:
19: package org.apache.roller.ui;
20:
21: import junit.framework.Test;
22: import junit.framework.TestCase;
23: import junit.framework.TestSuite;
24: import org.apache.commons.logging.Log;
25: import org.apache.commons.logging.LogFactory;
26: import org.apache.roller.ui.core.RollerContext;
27: import org.apache.roller.ui.core.plugins.UIPluginManager;
28:
29: /**
30: * Test Plugin Management business layer operations.
31: */
32: public class UIPluginManagerTest extends TestCase {
33:
34: private static Log log = LogFactory
35: .getLog(UIPluginManagerTest.class);
36:
37: public UIPluginManagerTest(String name) {
38: super (name);
39: }
40:
41: public static Test suite() {
42: return new TestSuite(UIPluginManagerTest.class);
43: }
44:
45: public void setUp() throws Exception {
46: }
47:
48: public void tearDown() throws Exception {
49: }
50:
51: public void testEntryEditors() throws Exception {
52:
53: UIPluginManager pmgr = RollerContext.getUIPluginManager();
54:
55: // test getEditors() lis
56: assertEquals(2, pmgr.getWeblogEntryEditors().size());
57:
58: // test getting a single editor
59: assertEquals("TextEditor", pmgr.getWeblogEntryEditor(
60: "TextEditor").getId());
61:
62: // make sure we return default editor if editor id is not found
63: assertEquals("TextEditor", pmgr.getWeblogEntryEditor(null)
64: .getId());
65: }
66:
67: }
|