struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r828096 - /struts/struts2/trunk/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java
Date Wed, 21 Oct 2009 16:38:07 GMT
Author: musachy
Date: Wed Oct 21 16:38:06 2009
New Revision: 828096

URL: http://svn.apache.org/viewvc?rev=828096&view=rev
Log:
add test for the key in the servlet context

Modified:
    struts/struts2/trunk/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java

Modified: struts/struts2/trunk/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java?rev=828096&r1=828095&r2=828096&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java
(original)
+++ struts/struts2/trunk/plugins/embeddedjsp/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java
Wed Oct 21 16:38:06 2009
@@ -28,6 +28,7 @@
 import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
 import junit.framework.TestCase;
 import org.apache.commons.lang.xwork.StringUtils;
+import org.apache.struts2.jasper.runtime.JspApplicationContextImpl;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
 import org.springframework.mock.web.MockHttpServletResponse;
@@ -99,6 +100,14 @@
         assertEquals("hello", response.getContentAsString());
     }
 
+    public void testKeyInContext() throws Exception {
+        result.setLocation("org/apache/struts2/simple0.jsp");
+        result.execute(null);
+
+        String key = JspApplicationContextImpl.class.getName() + "@" + this.getClass().getClassLoader().hashCode();
+        assertNotNull(context.getAttribute(key));
+    }
+
     public void testEL() throws Exception {
         result.setLocation("org/apache/struts2/el.jsp");
         result.execute(null);



Mime
View raw message