01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package org.apache.pluto.driver.services.impl.resource;
18:
19: import java.util.Set;
20:
21: import javax.servlet.ServletContext;
22:
23: import org.apache.pluto.driver.config.DriverConfigurationException;
24: import org.apache.pluto.driver.services.portal.PropertyConfigService;
25:
26: /**
27: * A mock PropertyConfigService.
28: *
29: * The init() and destroy() methods are no-ops.
30: *
31: * @since Feb 28, 2007
32: * @version $Id: MockPropertyConfigService.java 516329 2007-03-09 08:43:46Z cziegeler $
33: */
34: class MockPropertyConfigService implements PropertyConfigService {
35:
36: private ResourceConfig config;
37: private static final String configFile = "/pluto-portal-driver-config.xml";
38:
39: public MockPropertyConfigService() {
40: this (configFile);
41: }
42:
43: public MockPropertyConfigService(String configFile) {
44: ResourceConfigReader r = ResourceConfigReader.getFactory();
45: try {
46: config = r.parse(this .getClass().getResourceAsStream(
47: configFile));
48: } catch (Exception e) {
49: throw new RuntimeException(
50: "Unable to create ResourceConfig.", e);
51: }
52: }
53:
54: public String getContainerName() {
55: return config.getContainerName();
56: }
57:
58: public String getPortalName() {
59: return config.getPortalName();
60: }
61:
62: public String getPortalVersion() {
63: return config.getPortalVersion();
64: }
65:
66: public Set getSupportedPortletModes() {
67: return config.getSupportedPortletModes();
68: }
69:
70: public Set getSupportedWindowStates() {
71: return config.getSupportedWindowStates();
72: }
73:
74: public void destroy() throws DriverConfigurationException {
75: // TODO Auto-generated method stub
76:
77: }
78:
79: public void init(ServletContext ctx)
80: throws DriverConfigurationException {
81: // TODO Auto-generated method stub
82:
83: }
84:
85: }
|