Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from paultuckey/feature/test-containers
DRAFT test containers v2
- Loading branch information
Showing
91 changed files
with
4,426 additions
and
3,914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<project> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.tuckey</groupId> | ||
<artifactId>example-webapp</artifactId> | ||
<packaging>war</packaging> | ||
<version>5.0.0-SNAPSHOT</version> | ||
<name>Example Webapp</name> | ||
<url>http://www.tuckey.org/urlrewrite/</url> | ||
<inceptionYear>2001</inceptionYear> | ||
<description>Example webapp for Integration tests for UrlRewriteFilter</description> | ||
<organization> | ||
<name>Paul Tuckey</name> | ||
</organization> | ||
|
||
<licenses> | ||
<license> | ||
<name>BSD</name> | ||
<url>http://www.opensource.org/licenses/bsd-license.php</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<developers> | ||
<developer> | ||
<name>Paul Tuckey</name> | ||
</developer> | ||
</developers> | ||
|
||
<build> | ||
<finalName>webapp</finalName> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.5.1</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.3.1</version> | ||
<configuration> | ||
<webResources> | ||
<resource> | ||
<targetPath>WEB-INF</targetPath> | ||
<directory>target</directory> | ||
<includes> | ||
<include>urlrewrite-generated.xml</include> | ||
</includes> | ||
</resource> | ||
</webResources> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<!-- run `mvn install` locally root of project --> | ||
<groupId>org.tuckey</groupId> | ||
<artifactId>urlrewritefilter</artifactId> | ||
<version>5.0.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.servlet</groupId> | ||
<artifactId>jakarta.servlet-api</artifactId> | ||
<version>6.0.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
</properties> | ||
|
||
</project> |
140 changes: 70 additions & 70 deletions
140
...rewriteviacontainer/MockRewriteMatch.java → ...rewriteviacontainer/MockRewriteMatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
/** | ||
* Copyright (c) 2005-2007, Paul Tuckey | ||
* All rights reserved. | ||
* ==================================================================== | ||
* Licensed under the BSD License. Text as follows. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* - Neither the name tuckey.org nor the names of its contributors | ||
* may be used to endorse or promote products derived from this | ||
* software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
*/ | ||
package org.tuckey.web.filters.urlrewriteviacontainer; | ||
|
||
import org.tuckey.web.filters.urlrewrite.extend.RewriteMatch; | ||
|
||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
|
||
|
||
/** | ||
* Mock RewriteMatch that can be used for testing. Included here and not in test folder as it needs to be deployed with | ||
* the main library. | ||
* | ||
* @author Paul Tuckey | ||
* @version $Revision: 33 $ $Date: 2006-09-12 16:41:56 +1200 (Tue, 12 Sep 2006) $ | ||
*/ | ||
public class MockRewriteMatch extends RewriteMatch { | ||
|
||
private static long calledTime = 0; | ||
|
||
public boolean execute(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
calledTime = System.currentTimeMillis(); | ||
try { | ||
Thread.sleep(10); | ||
} catch (InterruptedException e) { | ||
// don't worry | ||
} | ||
return true; | ||
} | ||
|
||
public static long getCalledTime() { | ||
return calledTime; | ||
} | ||
} | ||
/** | ||
* Copyright (c) 2005-2007, Paul Tuckey | ||
* All rights reserved. | ||
* ==================================================================== | ||
* Licensed under the BSD License. Text as follows. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided | ||
* with the distribution. | ||
* - Neither the name tuckey.org nor the names of its contributors | ||
* may be used to endorse or promote products derived from this | ||
* software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
*/ | ||
package org.tuckey.web.filters.urlrewriteviacontainer; | ||
|
||
import org.tuckey.web.filters.urlrewrite.extend.RewriteMatch; | ||
|
||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import java.io.IOException; | ||
|
||
|
||
/** | ||
* Mock RewriteMatch that can be used for testing. Included here and not in test folder as it needs to be deployed with | ||
* the main library. | ||
* | ||
* @author Paul Tuckey | ||
* @version $Revision: 33 $ $Date: 2006-09-12 16:41:56 +1200 (Tue, 12 Sep 2006) $ | ||
*/ | ||
public class MockRewriteMatch extends RewriteMatch { | ||
|
||
private static long calledTime = 0; | ||
|
||
public boolean execute(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
calledTime = System.currentTimeMillis(); | ||
try { | ||
Thread.sleep(10); | ||
} catch (InterruptedException e) { | ||
// don't worry | ||
} | ||
return true; | ||
} | ||
|
||
public static long getCalledTime() { | ||
return calledTime; | ||
} | ||
} |
Oops, something went wrong.