1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
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.
15   */
16  package org.portletbridge.portlet;
17  
18  import java.util.PropertyResourceBundle;
19  import java.util.ResourceBundle;
20  
21  import junit.framework.TestCase;
22  
23  import org.portletbridge.mock.MockPortletConfig;
24  
25  /***
26   * @author JMcCrindle
27   */
28  public class PortletBridgePortletTest extends TestCase {
29  
30      /*
31       * @see TestCase#setUp()
32       */
33      protected void setUp() throws Exception {
34          super.setUp();
35      }
36  
37      /*
38       * @see TestCase#tearDown()
39       */
40      protected void tearDown() throws Exception {
41          super.tearDown();
42      }
43  
44      /***
45       * Constructor for PortletBridgePortletTest.
46       * @param name
47       */
48      public PortletBridgePortletTest(String name) {
49          super(name);
50      }
51  
52      public void testInit() throws Exception {
53          PortletBridgePortlet portlet = new PortletBridgePortlet();
54          ResourceBundle bundle = PropertyResourceBundle.getBundle("org.portletbridge.portlet.PortletBridgePortlet");
55          MockPortletConfig mockPortletConfig = new MockPortletConfig();
56          mockPortletConfig.setupResourceBundle(bundle);
57          mockPortletConfig.setupInitParam("mementoSessionKey", "mementoSessionKey");
58          mockPortletConfig.setupInitParam("parserClassName", "org.cyberneko.html.parsers.SAXParser");
59          mockPortletConfig.setupInitParam("servletName", "pbhs");
60          mockPortletConfig.setupInitParam("editStylesheet", "classpath:/org/portletbridge/xsl/pages/edit.xsl");
61          mockPortletConfig.setupInitParam("helpStylesheet", "classpath:/org/portletbridge/xsl/pages/help.xsl");
62          mockPortletConfig.setupInitParam("errorStylesheet", "classpath:/org/portletbridge/xsl/pages/error.xsl");
63          portlet.init(mockPortletConfig);
64      }
65  
66  }