Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Commit

Permalink
Complete doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoulaj committed May 24, 2011
1 parent 14e6441 commit 659ec22
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 35 deletions.
37 changes: 20 additions & 17 deletions pom.xml
Expand Up @@ -26,11 +26,11 @@


<groupId>net.ju-n.benchmark</groupId> <groupId>net.ju-n.benchmark</groupId>
<artifactId>mock-webapp</artifactId> <artifactId>mock-webapp</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-alpha-1-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>


<name>mock-webapp</name> <name>mock-webapp</name>
<description>Mock web application for performance or integration testing</description> <description>Mock web application for performance or integration testing.</description>
<url>http://nicoulaj.github.com/mock-webapp</url> <url>http://nicoulaj.github.com/mock-webapp</url>
<inceptionYear>2011</inceptionYear> <inceptionYear>2011</inceptionYear>


Expand Down Expand Up @@ -59,31 +59,35 @@
</site> </site>
</distributionManagement> </distributionManagement>


<properties>
<java.version>1.5</java.version>
<servlet-api.version>2.5</servlet-api.version>
<jaxb.version>2.2.2</jaxb.version>
<commons-vfs.version>1.0</commons-vfs.version>
<httpunit.version>1.7</httpunit.version>
<doxia-module-markdown.version>1.0.0</doxia-module-markdown.version>
</properties>

<dependencies> <dependencies>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<version>2.5</version> <version>${servlet-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.xml.bind</groupId> <groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <artifactId>jaxb-api</artifactId>
<version>2.2.2</version> <version>${jaxb.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sun.xml.bind</groupId> <groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId> <artifactId>jaxb-impl</artifactId>
<version>2.2.2</version> <version>${jaxb.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-vfs</groupId> <groupId>commons-vfs</groupId>
<artifactId>commons-vfs</artifactId> <artifactId>commons-vfs</artifactId>
<version>1.0</version> <version>${commons-vfs.version}</version>
</dependency>
<dependency>
<groupId>de.sven-jacobs</groupId>
<artifactId>loremipsum</artifactId>
<version>1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
Expand All @@ -93,7 +97,7 @@
<dependency> <dependency>
<groupId>httpunit</groupId> <groupId>httpunit</groupId>
<artifactId>httpunit</artifactId> <artifactId>httpunit</artifactId>
<version>1.7</version> <version>${httpunit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
Expand All @@ -110,8 +114,8 @@
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.5</source> <source>${java.version}</source>
<target>1.5</target> <target>${java.version}</target>
<optimize>true</optimize> <optimize>true</optimize>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation> <showDeprecation>true</showDeprecation>
Expand All @@ -127,7 +131,6 @@
<plugin> <plugin>
<groupId>com.sun.tools.jxc.maven2</groupId> <groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId> <artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>
<executions> <executions>
<execution> <execution>
<id>generate-xsd-schema</id> <id>generate-xsd-schema</id>
Expand Down Expand Up @@ -177,7 +180,7 @@
<dependency> <dependency>
<groupId>net.ju-n.maven.doxia</groupId> <groupId>net.ju-n.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId> <artifactId>doxia-module-markdown</artifactId>
<version>1.0.0</version> <version>${doxia-module-markdown.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
Expand Down Expand Up @@ -240,7 +243,7 @@
<artifactId>maven-pmd-plugin</artifactId> <artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version> <version>${maven-pmd-plugin.version}</version>
<configuration> <configuration>
<targetJdk>1.5</targetJdk> <targetJdk>${java.version}</targetJdk>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
Expand Down
Expand Up @@ -17,6 +17,18 @@
/** /**
* The treatments that can be applied to requests responses. * The treatments that can be applied to requests responses.
* *
* TODO: Implement following {@link ThenStatement}s:
* * Response content (random content, lorem ipsum, content from file)
* * Response MIME type
* * Response header
* * Response cookie
* * Response encoding
* * Redirection
* * Gaussian delay
* * Other delay types implementations (user provided, Groovy ?)
* * Memory leak
* * JVM crash
*
* @author Julien Nicoulaud <julien.nicoulaud@gmail.com> * @author Julien Nicoulaud <julien.nicoulaud@gmail.com>
* @since 1.0.0 * @since 1.0.0
*/ */
Expand Down
Expand Up @@ -17,6 +17,14 @@
/** /**
* The conditions that can be used to match requests. * The conditions that can be used to match requests.
* *
* TODO: Implement following {@link WhenStatement}s:
* * Authentication or not
* * Authentication type
* * Protocol
* * Port
* * Request has content
* * Request content matching
*
* @author Julien Nicoulaud <julien.nicoulaud@gmail.com> * @author Julien Nicoulaud <julien.nicoulaud@gmail.com>
* @since 1.0.0 * @since 1.0.0
*/ */
Expand Down
10 changes: 1 addition & 9 deletions src/site/markdown/index.md → src/site/markdown/index.md.vm
@@ -1,4 +1,4 @@
**mock web application for performance or integration testing.** **${project.description}**


Sometimes you need to test how the architecture around your application (frontal server, SSO system, etc) Sometimes you need to test how the architecture around your application (frontal server, SSO system, etc)
behaves in particular situations, that can be hard to reproduce. behaves in particular situations, that can be hard to reproduce.
Expand Down Expand Up @@ -29,11 +29,3 @@ This mock web application can easily be setup to behave as you need, through a s
</mapping> </mapping>


</mock-web-app> </mock-web-app>


How to use ?
------------

1. [Download it](usage/1-download.html)
2. [Configure it](usage/2-configure.html)
3. [Deploy it](usage/3-deploy.html)
3 changes: 0 additions & 3 deletions src/site/markdown/usage/1-download.md

This file was deleted.

4 changes: 4 additions & 0 deletions src/site/markdown/usage/1-download.md.vm
@@ -0,0 +1,4 @@
Download ${project.name}
------------------------

Grab the ${project.version} release ${project.packaging} of ${project.name} at [Maven Central repository](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22${project.groupId}%22%20AND%20a%3A%22${project.artifactId}%22).
3 changes: 0 additions & 3 deletions src/site/markdown/usage/2-configure.md

This file was deleted.

23 changes: 23 additions & 0 deletions src/site/markdown/usage/2-configure.md.vm
@@ -0,0 +1,23 @@
Configure ${project.name}
-------------------------

* Grab the XSD schema at [Maven central repository](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22${project.groupId}%22%20AND%20a%3A%22${project.artifactId}%22).
* Start writing your configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<mock-web-app xmlns="net.nicoulaj.benchmark.mockwebapp:mock-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="net.nicoulaj.benchmark.mockwebapp:mock-web-app mock-web-app.xsd">

<mapping>
<when>
<!-- insert conditions here -->
</when>
<then>
<!-- insert actions here -->
</then>
</mapping>

</mock-web-app>

* You can also find some examples [here](${project.scm.url}/tree/master/src/test/resources/net/nicoulaj/benchmark/mockwebapp/test/configs/valid).
3 changes: 0 additions & 3 deletions src/site/markdown/usage/3-deploy.md

This file was deleted.

7 changes: 7 additions & 0 deletions src/site/markdown/usage/3-deploy.md.vm
@@ -0,0 +1,7 @@
Deploy ${project.name}
----------------------

* Deploy the ${project.artifactId}-${project.version}.${project.packaging} to your favorite servlet container (such as [Tomcat](http://tomcat.apache.org) or [Jetty](http://jetty.codehaus.org)).
* Start the server with the pah to the configuration file as Java option:

<start command> -Dmock-web-app-conf=file:path/to/conf/file.xml
24 changes: 24 additions & 0 deletions src/site/site.xml
Expand Up @@ -18,8 +18,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">


<skin>
<groupId>net.ju-n.maven.skins</groupId>
<artifactId>maven-default-code-highlighting-skin</artifactId>
<version>1.0.0</version>
</skin>

<body> <body>


<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2189278-12']);
_gaq.push(['_trackPageview']);
(function()
{
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') +
'.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>

<menu name="Usage"> <menu name="Usage">
<item name="1. Download" href="/usage/1-download.html"/> <item name="1. Download" href="/usage/1-download.html"/>
<item name="2. Configure" href="/usage/2-configure.html"/> <item name="2. Configure" href="/usage/2-configure.html"/>
Expand Down

0 comments on commit 659ec22

Please sign in to comment.