svn commit: r1226265 - in /struts/struts2/trunk: plugins/junit/pom.xml plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java plugins/junit/src/test/java/org/apache/struts2/StrutsTestCaseT

2012-01-01 Thread lukaszlenart
Author: lukaszlenart
Date: Sun Jan  1 17:29:25 2012
New Revision: 1226265

URL: http://svn.apache.org/viewvc?rev=1226265&view=rev
Log:
WW-3733 - adds missing PortletContext to ActionContext to avoid NPE during 
PortletResult initialisation

Modified:
struts/struts2/trunk/plugins/junit/pom.xml

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

struts/struts2/trunk/plugins/junit/src/test/java/org/apache/struts2/StrutsTestCaseTest.java
struts/struts2/trunk/plugins/portlet/pom.xml
struts/struts2/trunk/pom.xml

Modified: struts/struts2/trunk/plugins/junit/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/junit/pom.xml?rev=1226265&r1=1226264&r2=1226265&view=diff
==
--- struts/struts2/trunk/plugins/junit/pom.xml (original)
+++ struts/struts2/trunk/plugins/junit/pom.xml Sun Jan  1 17:29:25 2012
@@ -55,7 +55,6 @@
 
 org.apache.struts
 struts2-spring-plugin
-${project.version}
 true
 
 
@@ -67,5 +66,11 @@
 junit
 junit
 
+
+
+javax.portlet
+portlet-api
+test
+
 
 

Modified: 
struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java?rev=1226265&r1=1226264&r2=1226265&view=diff
==
--- 
struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
 (original)
+++ 
struts/struts2/trunk/plugins/junit/src/main/java/org/apache/struts2/StrutsTestCase.java
 Sun Jan  1 17:29:25 2012
@@ -37,6 +37,7 @@ import org.springframework.mock.web.Mock
 import org.springframework.mock.web.MockHttpServletResponse;
 import org.springframework.mock.web.MockPageContext;
 import org.springframework.mock.web.MockServletContext;
+import org.springframework.mock.web.portlet.MockPortletContext;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -46,7 +47,11 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.*;
+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;
 
 /**
  * Base test case for JUnit testing Struts.
@@ -57,7 +62,7 @@ public abstract class StrutsTestCase ext
 protected MockPageContext pageContext;
 protected MockServletContext servletContext;
 protected Map dispatcherInitParams;
-
+
 protected DefaultResourceLoader resourceLoader = new 
DefaultResourceLoader();
 
 static {
@@ -109,10 +114,9 @@ public abstract class StrutsTestCase ext
 assertNotNull(mapping);
 Dispatcher.getInstance().serviceAction(request, response, 
servletContext, mapping);
 
-if (response.getStatus() != HttpServletResponse.SC_OK)
-throw new ServletException("Error code [" + response.getStatus() + 
"], Error: ["
-+ response.getErrorMessage() + "]");
-
+if (response.getStatus() != HttpServletResponse.SC_OK) {
+throw new ServletException("Error code [" + response.getStatus() + 
"], Error: [" + response.getErrorMessage() + "]");
+}
 return response.getContentAsString();
 }
 
@@ -131,12 +135,9 @@ public abstract class StrutsTestCase ext
 ActionProxy proxy = 
config.getContainer().getInstance(ActionProxyFactory.class).createActionProxy(
 namespace, name, method, new HashMap(), true, 
false);
 
-ActionContext invocationContext = 
proxy.getInvocation().getInvocationContext();
-invocationContext.setParameters(new 
HashMap(request.getParameterMap()));
-// set the action context to the one used by the proxy
-ActionContext.setContext(invocationContext);
+initActionContext(proxy.getInvocation().getInvocationContext());
 
-// this is normaly done in onSetUp(), but we are using Struts internal
+// this is normally done in onSetUp(), but we are using Struts internal
 // objects (proxy and action invocation)
 // so we have to hack around so it works
 ServletActionContext.setServletContext(servletContext);
@@ -146,6 +147,29 @@ public abstract class StrutsTestCase ext
 return proxy;
 }
 
+private void initActionContext(ActionContext actionContext) {
+actionContext.setParameters(new HashMap(request.getParameterMap()));
+
+initMockPortletContext(actionContext);
+applyAdditionalParams(actionContext);
+
+// set the action context to the one used by the proxy
+ActionContext.setContext(action

[CONF] Confluence Changes in the last 24 hours

2012-01-01 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


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

Pages
-
Apache Camel 2.9.0 Released created by hadr...@apache.org (08:46 PM)
https://cwiki.apache.org/confluence/display/CAMEL/2012/01/01/Apache+Camel+2.9.0+Released

Manual edited by  hadr...@apache.org  (08:14 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Manual

Xml Reference edited by  hadr...@apache.org  (08:14 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Xml+Reference

Download edited by  hadr...@apache.org  (08:12 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Download

Camel 2.9.0 Release edited by  hadr...@apache.org  (08:02 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.9.0+Release

Release Guide edited by  muellerc  (01:09 PM)
https://cwiki.apache.org/confluence/display/CAMEL/Release+Guide

Commercial Camel Offerings edited by  mazzag  (10:27 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Commercial+Camel+Offerings



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

Pages
-
Commercial CXF Offerings edited by  mazzag  (10:31 AM)
https://cwiki.apache.org/confluence/display/CXF/Commercial+CXF+Offerings



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

Pages
-
January 2012 edited by  gpetracek  (03:43 PM)
https://cwiki.apache.org/confluence/display/MYFACES/January+2012



OFBiz (Open For Business) Project Open Wiki 
(https://cwiki.apache.org/confluence/display/OFBIZ)

Comments
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+A+Beginners+Development+Guide
 (2)

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

Pages
-
IP_Clearance edited by  p...@apache.org  (12:21 PM)
https://cwiki.apache.org/confluence/display/OOOUSERS/IP_Clearance



Apache Struts 2 Documentation (https://cwiki.apache.org/confluence/display/WW)

Pages
-
Testing Actions edited by  lukaszlenart  (05:51 AM)
https://cwiki.apache.org/confluence/display/WW/Testing+Actions




Change your notification preferences: 
https://cwiki.apache.org/confluence/users/viewnotifications.action