struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r687804 - in /struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent: ./ StaticContentTest.java
Date Thu, 21 Aug 2008 17:11:16 GMT
Author: musachy
Date: Thu Aug 21 10:11:16 2008
New Revision: 687804

URL: http://svn.apache.org/viewvc?rev=687804&view=rev
Log:
Add content loader test

Added:
    struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent/
    struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent/StaticContentTest.java

Added: struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent/StaticContentTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent/StaticContentTest.java?rev=687804&view=auto
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent/StaticContentTest.java
(added)
+++ struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent/StaticContentTest.java
Thu Aug 21 10:11:16 2008
@@ -0,0 +1,37 @@
+package it.org.apache.struts2.showcase.staticcontent;
+
+import it.org.apache.struts2.showcase.ITBaseTest;
+
+import java.io.IOException;
+
+import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
+
+public class StaticContentTest extends ITBaseTest {
+
+    public void testInvalidRersources1() throws IOException {
+        try {
+            beginAt("/struts..");
+            fail("Previous request should have failed");
+        } catch (TestingEngineResponseException ex) {
+            // ok
+        }
+    }
+
+    public void testInvalidRersources2() throws IOException {
+        try {
+            beginAt("/struts/..%252f");
+            fail("Previous request should have failed");
+        } catch (TestingEngineResponseException ex) {
+            // ok
+        }
+    }
+
+    public void testInvalidRersources3() throws IOException {
+        try {
+            beginAt("/struts/..%252f..%252f..%252fWEB-INF/classes/org/apache/struts2/showcase/action/EmployeeAction.class/");
+            fail("Previous request should have failed");
+        } catch (TestingEngineResponseException ex) {
+            // ok
+        }
+    }
+}



Mime
View raw message