alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Struts example source code file (StaticContentTest.java)

This example Struts source code file (StaticContentTest.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Struts tags/keywords

io, ioexception, ioexception, itbasetest, itbasetest, previous, previous, staticcontenttest, testingengineresponseexception, testingengineresponseexception

The Struts StaticContentTest.java source code

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
        }
    }*/
}

Other Struts examples (source code examples)

Here is a short list of links related to this Struts StaticContentTest.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.