You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2008/08/21 19:11:16 UTC
svn commit: r687804 - in
/struts/struts2/trunk/apps/showcase/src/test/java/it/org/apache/struts2/showcase/staticcontent:
./ StaticContentTest.java
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
+ }
+ }
+}