View Javadoc

1   /*
2   * Licensed to the Apache Software Foundation (ASF) under one or more
3   * contributor license agreements.  See the NOTICE file distributed with
4   * this work for additional information regarding copyright ownership.
5   * The ASF licenses this file to You under the Apache License, Version 2.0
6   * (the "License"); you may not use this file except in compliance with
7   * the License.  You may obtain a copy of the License at
8   *
9   *     http://www.apache.org/licenses/LICENSE-2.0
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  /*
18   * Created on May 26, 2004
19   *
20   * TODO To change the template for this generated file go to
21   * Window - Preferences - Java - Code Generation - Code and Comments
22   */
23  package org.apache.jetspeed.components.util;
24  
25  import java.util.ArrayList;
26  import java.util.Arrays;
27  import java.util.List;
28  import java.util.Properties;
29  
30  import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
31  import org.apache.jetspeed.components.portletregistry.PortletRegistry;
32  import org.apache.jetspeed.prefs.util.test.AbstractPrefsSupportedTestCase;
33  
34  /***
35   * @author <a href="mailto:sweaver@einnovation.com">Scott T. Weaver</a>
36   *
37   */
38  public abstract class RegistrySupportedTestCase extends AbstractPrefsSupportedTestCase
39  {
40  
41      protected PortletRegistry portletRegistry;
42      protected PortletEntityAccessComponent entityAccess;
43  
44      /* (non-Javadoc)
45       * @see junit.framework.TestCase#setUp()
46       */
47      protected void setUp() throws Exception
48      {       
49          super.setUp();
50          portletRegistry = (PortletRegistry) ctx.getBean("portletRegistry");
51          entityAccess = (PortletEntityAccessComponent) ctx.getBean("portletEntityAccess");
52      }   
53      
54      protected String[] getConfigurations()
55      {
56          String[] confs = super.getConfigurations();
57          List confList = new ArrayList(Arrays.asList(confs));
58          confList.add("jetspeed-base.xml");
59          confList.add("page-manager.xml");
60          confList.add("registry.xml");               
61          return (String[]) confList.toArray(new String[1]);
62      }
63      
64      protected Properties getPostProcessProperties()
65      {
66          Properties p = super.getPostProcessProperties();
67          p.setProperty("supported.portletmode.autoswitch.config", "false");
68          p.setProperty("supported.portletmode.autoswitch.edit_defaults", "false");
69          p.setProperty("supported.portletmode.autoswitch.config.surrogate.portlet", "j2-admin::CustomConfigModePortlet");
70          return p;
71      }
72  }