svn commit: r1157925 - in /struts/struts2/trunk/plugins/junit/src: main/java/org/apache/struts2/ test/java/org/apache/struts2/ test/resources/

2011-08-15 Thread mcucchiara
Author: mcucchiara
Date: Mon Aug 15 17:48:07 2011
New Revision: 1157925

URL: http://svn.apache.org/viewvc?rev=1157925&view=rev
Log:
* Exposed getConfigPath method in order to use custom struts.xml file.
* Renamed JUnitTestAction

Added:

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/JUnitTestAction.java
   (contents, props changed)
  - copied, changed from r1157665, 
struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/JunitTestAction.java

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/StrutsJUnit4TestCaseTest.java
   (with props)
struts/struts2/trunk/plugins/junit/src/test/resources/struts-test.xml   
(with props)
struts/struts2/trunk/plugins/junit/src/test/resources/template2.ftl   (with 
props)
Removed:

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/JunitTestAction.java
Modified:

struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/StrutsSpringJUnit4TestCaseTest.java

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/StrutsSpringTestCaseTest.java

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/StrutsTestCaseTest.java
struts/struts2/trunk/plugins/junit/src/test/resources/applicationContext.xml
struts/struts2/trunk/plugins/junit/src/test/resources/struts.xml

Modified: 
struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java?rev=1157925&r1=1157924&r2=1157925&view=diff
==
--- 
struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java
 (original)
+++ 
struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsJUnit4TestCase.java
 Mon Aug 15 17:48:07 2011
@@ -27,6 +27,7 @@ import com.opensymphony.xwork2.intercept
 import com.opensymphony.xwork2.interceptor.annotations.Before;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import com.opensymphony.xwork2.util.logging.jdk.JdkLoggerFactory;
+import org.apache.commons.lang.StringUtils;
 import org.apache.struts2.dispatcher.Dispatcher;
 import org.apache.struts2.dispatcher.mapper.ActionMapper;
 import org.apache.struts2.dispatcher.mapper.ActionMapping;
@@ -45,11 +46,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Formatter;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
+import java.util.logging.*;
 
 import static org.junit.Assert.assertNotNull;
 
@@ -101,6 +98,7 @@ public abstract class StrutsJUnit4TestCa
 
 /**
  * gets an object from the stack after an action is executed
+ *
  * @return The executed action
  */
 @SuppressWarnings("unchecked")
@@ -110,7 +108,7 @@ public abstract class StrutsJUnit4TestCa
 
 protected boolean containsErrors() {
 T action = this.getAction();
-if(action instanceof ValidationAware) {
+if (action instanceof ValidationAware) {
 return ((ValidationAware) action).hasActionErrors();
 }
 throw new UnsupportedOperationException("Current action does not 
implement ValidationAware interface");
@@ -152,7 +150,7 @@ public abstract class StrutsJUnit4TestCa
 namespace, name, method, new HashMap(), true, 
false);
 
 ActionContext invocationContext = 
proxy.getInvocation().getInvocationContext();
-invocationContext.setParameters(new 
HashMap(request.getParameterMap()));
+invocationContext.setParameters(new HashMap(request.getParameterMap()));
 // set the action context to the one used by the proxy
 ActionContext.setContext(invocationContext);
 
@@ -211,9 +209,17 @@ public abstract class StrutsJUnit4TestCa
 super.setUp();
 initServletMockObjects();
 setupBeforeInitDispatcher();
+initDispatcherParams();
 initDispatcher(dispatcherInitParams);
 }
 
+protected void initDispatcherParams() {
+if (StringUtils.isNotBlank(getConfigPath())) {
+dispatcherInitParams = new HashMap();
+dispatcherInitParams.put("config", "struts-default.xml," + 
getConfigPath());
+}
+}
+
 protected Dispatcher initDispatcher(Map params) {
 Dispatcher du = StrutsTestCaseHelper.initDispatcher(servletContext, 
params);
 configurationManager = du.getConfigurationManager();
@@ -222,6 +228,10 @@ public abstract class StrutsJUnit4TestCa
 return du;
 }
 
+protected String getConfigPath() {
+return null;
+}
+
 @After
 public void tearDown() throws

[CONF] Confluence Changes in the last 24 hours

2011-08-15 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache ActiveMQ (https://cwiki.apache.org/confluence/display/ACTIVEMQ)

Pages
-
JBoss Integration edited by  tabish121  (06:33 PM)
https://cwiki.apache.org/confluence/display/ACTIVEMQ/JBoss+Integration



Apache CXF (https://cwiki.apache.org/confluence/display/CXF)

Pages
-
Index edited by  dkulp  (09:47 AM)
https://cwiki.apache.org/confluence/display/CXF/Index

Apache CXF 2.4.2 Release Notes created by dkulp (09:44 AM)
https://cwiki.apache.org/confluence/display/CXF/Apache+CXF+2.4.2+Release+Notes

Apache CXF 2.3.6 Release Notes created by dkulp (09:42 AM)
https://cwiki.apache.org/confluence/display/CXF/Apache+CXF+2.3.6+Release+Notes

Download edited by  dkulp  (09:40 AM)
https://cwiki.apache.org/confluence/display/CXF/Download



Apache Directory Development 
(https://cwiki.apache.org/confluence/display/DIRxDEV)

Pages
-
Releasing ApacheDS edited by  elecharny  (06:53 PM)
https://cwiki.apache.org/confluence/display/DIRxDEV/Releasing+ApacheDS



Apache MyFaces Extensions CDI 
(https://cwiki.apache.org/confluence/display/EXTCDI)

Pages
-
Core DevDoc edited by  gpetracek  (08:02 PM)
https://cwiki.apache.org/confluence/display/EXTCDI/Core+DevDoc

Core Usage edited by  gpetracek  (07:37 PM)
https://cwiki.apache.org/confluence/display/EXTCDI/Core+Usage

JSF Usage edited by  gpetracek  (06:23 PM)
https://cwiki.apache.org/confluence/display/EXTCDI/JSF+Usage

Problems with Weld edited by  gpetracek  (03:39 PM)
https://cwiki.apache.org/confluence/display/EXTCDI/Problems+with+Weld

Intro edited by  gpetracek  (09:16 AM)
https://cwiki.apache.org/confluence/display/EXTCDI/Intro



Apache Giraph (Incubating) (https://cwiki.apache.org/confluence/display/GIRAPH)

Pages
-
Index created by ipv6guru (08:31 AM)
https://cwiki.apache.org/confluence/display/GIRAPH/Index



Apache Karaf (https://cwiki.apache.org/confluence/display/KARAF)

Pages
-
Board Reports edited by  nanthrax  (12:49 PM)
https://cwiki.apache.org/confluence/display/KARAF/Board+Reports



Apache Mahout (https://cwiki.apache.org/confluence/display/MAHOUT)

Pages
-
Books Tutorials and Talks edited by  sro...@gmail.com  (01:38 PM)
https://cwiki.apache.org/confluence/display/MAHOUT/Books+Tutorials+and+Talks



Apache MyFaces (https://cwiki.apache.org/confluence/display/MYFACES)

Pages
-
MyFaces Archetypes for Maven edited by  bkummel  (03:03 AM)
https://cwiki.apache.org/confluence/display/MYFACES/MyFaces+Archetypes+for+Maven

Configuring MyFaces edited by  bkummel  (02:05 AM)
https://cwiki.apache.org/confluence/display/MYFACES/Configuring+MyFaces



Apache OpenOffice.org Community 
(https://cwiki.apache.org/confluence/display/OOOUSERS)

Pages
-
Help Wanted edited by  cmarcum  (09:06 PM)
https://cwiki.apache.org/confluence/display/OOOUSERS/Help+Wanted

OOo-Sitemap edited by  kschenk  (06:40 PM)
https://cwiki.apache.org/confluence/display/OOOUSERS/OOo-Sitemap

Bugtracking migration edited by  tjfrazier  (02:06 PM)
https://cwiki.apache.org/confluence/display/OOOUSERS/Bugtracking+migration

Community Wiki Infrastructure edited by  terrye  (07:39 AM)
https://cwiki.apache.org/confluence/display/OOOUSERS/Community+Wiki+Infrastructure

Community Forums edited by  terrye  (02:59 AM)
https://cwiki.apache.org/confluence/display/OOOUSERS/Community+Forums



Apache Pig (https://cwiki.apache.org/confluence/display/PIG)

Pages
-
PigInMapCombinerProposal edited by  thejas  (02:01 PM)
https://cwiki.apache.org/confluence/display/PIG/PigInMapCombinerProposal



Apache Qpid (https://cwiki.apache.org/confluence/display/qpid)

Pages
-
Index edited by  aconway  (08:54 AM)
https://cwiki.apache.org/confluence/display/qpid/Index



Apache Sling Website (https://cwiki.apache.org/confluence/display/SLINGxSITE)

Pages
-
Downloads edited by  justinedelson  (07:12 PM)
https://cwiki.apache.org/confluence/display/SLINGxSITE/Downloads

News edited by  justinedelson  (04:11 PM)
https://cwiki.apache.org/confluence/display/SLINGxSITE/News



Apache VCL (https://cwiki.apache.org/conflu