Commits

rainerh  committed 9dde007

Create a xwork-mock.jar containing all mock objects
o Refactored MockConfiguration to mock package within xwork.jar
Issue number: XW-401
Obtained from:
Submitted by:
Reviewed by:
CVS: ----------------------------------------------------------------------
CVS: Issue number:
CVS: If this change addresses one or more issues,
CVS: then enter the issue number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to the project by someone else; i.e.,
CVS: they sent us a patch or a set of diffs, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.

git-svn-id: http://svn.opensymphony.com/svn/xwork/branches/xwork_1-2/src@1076e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 80b5b49

Comments (0)

Files changed (3)

File java/com/opensymphony/xwork/mock/MockConfiguration.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork.mock;
+
+import com.opensymphony.xwork.config.Configuration;
+import com.opensymphony.xwork.config.ConfigurationException;
+import com.opensymphony.xwork.config.RuntimeConfiguration;
+import com.opensymphony.xwork.config.entities.PackageConfig;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * Mock for an {@link Configuration}.
+ *
+ * @author Mike
+ */
+public class MockConfiguration implements Configuration {
+
+    private Map packages = new HashMap();
+
+
+    public PackageConfig getPackageConfig(String name) {
+        return (PackageConfig) packages.get(name);
+    }
+
+    public Set getPackageConfigNames() {
+        return packages.keySet();
+    }
+
+    public Map getPackageConfigs() {
+        return packages;
+    }
+
+    public RuntimeConfiguration getRuntimeConfiguration() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void addPackageConfig(String name, PackageConfig packageContext) {
+        packages.put(name, packageContext);
+    }
+
+    public void buildRuntimeConfiguration() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void destroy() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void rebuildRuntimeConfiguration() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void reload() throws ConfigurationException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void removePackageConfig(String name) {
+    }
+}

File test/com/opensymphony/xwork/config/impl/MockConfiguration.java

-/*
- * Copyright (c) 2002-2003 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.xwork.config.impl;
-
-import com.opensymphony.xwork.config.Configuration;
-import com.opensymphony.xwork.config.ConfigurationException;
-import com.opensymphony.xwork.config.RuntimeConfiguration;
-import com.opensymphony.xwork.config.entities.PackageConfig;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Created by IntelliJ IDEA.
- * User: Mike
- * Date: May 6, 2003
- * Time: 3:27:37 PM
- * To change this template use Options | File Templates.
- */
-public class MockConfiguration implements Configuration {
-
-    private Map packages = new HashMap();
-
-
-    public PackageConfig getPackageConfig(String name) {
-        return (PackageConfig) packages.get(name);
-    }
-
-    public Set getPackageConfigNames() {
-        return packages.keySet();
-    }
-
-    public Map getPackageConfigs() {
-        return packages;
-    }
-
-    public RuntimeConfiguration getRuntimeConfiguration() {
-        throw new UnsupportedOperationException();
-    }
-
-    public void addPackageConfig(String name, PackageConfig packageContext) {
-        packages.put(name, packageContext);
-    }
-
-    public void buildRuntimeConfiguration() {
-        throw new UnsupportedOperationException();
-    }
-
-    public void destroy() {
-        throw new UnsupportedOperationException();
-    }
-
-    public void rebuildRuntimeConfiguration() {
-        throw new UnsupportedOperationException();
-    }
-
-    public void reload() throws ConfigurationException {
-        throw new UnsupportedOperationException();
-    }
-
-    public void removePackageConfig(String name) {
-    }
-}

File test/com/opensymphony/xwork/config/providers/ConfigurationTestBase.java

 import com.opensymphony.xwork.XWorkTestCase;
 import com.opensymphony.xwork.config.Configuration;
 import com.opensymphony.xwork.config.ConfigurationProvider;
-import com.opensymphony.xwork.config.impl.MockConfiguration;
+import com.opensymphony.xwork.mock.MockConfiguration;
 
 
 /**