Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Testing library for Junit3/4 and TestNG for handling multiple server fixture setups for test methods.
Java

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
junit-runner
server-provider
.gitignore
README.md
header.txt
pom.xml

README.md

Testing Harness for http-based tests.

This library provides two main components:

  • server-provider allows easy HTTP server and HTTP Proxy setups to be used in tests
  • junit-runner makes JUnit able to execute same test code for many server configurations, executing test methods multiple times with different server fixtures.

Supported test libraries:

  • JUnit 4.11

ServerProviders:

  • Jetty 8.1.x

Usage as "test" HTTP server

As stubbing/mocking HTTP server: just add following dependency to your POM:

  <dependency>
    <groupId>org.sonatype.http-testing-harness</groupId>
    <artifactId>server-provider</artifactId>
    <version>...</version>
  </dependncy>

And in your test you can either use org.sonatype.tests.http.server.jetty.impl.JettyServerProvider directly, or use "fluent" API using org.sonatype.tests.http.server.fluent.Server.

JUnit integration

To have more tighter JUnit integration, add following dependency to your POM (it will pull in server-provider too):

  <dependency>
    <groupId>org.sonatype.http-testing-harness</groupId>
    <artifactId>junit-runner</artifactId>
    <version>...</version>
  </dependncy>

Using this module, you can use provided annotations to create tests that are running against combinations of server fixtures, and also it provides very simple JUnit Rules to manage Server lifecycle as JUnit ExternalResource.

Authors/contributors

Original author:

Contributor:

Have fun, ~t~

Something went wrong with that request. Please try again.