01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.xwork.mock;
06:
07: import com.opensymphony.xwork.config.Configuration;
08: import com.opensymphony.xwork.config.ConfigurationException;
09: import com.opensymphony.xwork.config.RuntimeConfiguration;
10: import com.opensymphony.xwork.config.entities.PackageConfig;
11:
12: import java.util.HashMap;
13: import java.util.Map;
14: import java.util.Set;
15:
16: /**
17: * Mock for an {@link Configuration}.
18: *
19: * @author Mike
20: */
21: public class MockConfiguration implements Configuration {
22:
23: private Map packages = new HashMap();
24:
25: public PackageConfig getPackageConfig(String name) {
26: return (PackageConfig) packages.get(name);
27: }
28:
29: public Set getPackageConfigNames() {
30: return packages.keySet();
31: }
32:
33: public Map getPackageConfigs() {
34: return packages;
35: }
36:
37: public RuntimeConfiguration getRuntimeConfiguration() {
38: throw new UnsupportedOperationException();
39: }
40:
41: public void addPackageConfig(String name,
42: PackageConfig packageContext) {
43: packages.put(name, packageContext);
44: }
45:
46: public void buildRuntimeConfiguration() {
47: throw new UnsupportedOperationException();
48: }
49:
50: public void destroy() {
51: throw new UnsupportedOperationException();
52: }
53:
54: public void rebuildRuntimeConfiguration() {
55: throw new UnsupportedOperationException();
56: }
57:
58: public void reload() throws ConfigurationException {
59: throw new UnsupportedOperationException();
60: }
61:
62: public void removePackageConfig(String name) {
63: }
64: }
|