Standalone setup

Sniffy comes with an uber-jar which doesn’t require any additional dependencies to be installed. Just grab the sniffy-3.1.7.jar from our releases page and add it to the classpath of your application.

Warning
If you’re using an application server like Tomcat and you’re defining a datasource on application server level, sniffy-3.1.7.jar should be added to the common classloader classpath and should be absent in web application classpath.

Non-Servlet applications

Standalone sniffy uber-jar also works with non-Servlet applications (Currently only fault tolerance testing and TCP delay are supported in this mode). Just add following parameter to your java application command line: -javaagent:sniffy-<VERSION>.jar=5559

Here 5559 is the port where connectivity controls are available - just point your browser to 5559 port on your host (Say http://localhost:5559 ). Below is an example of connections discovered in IntelliJ Idea:

agent ui

Advanced syntax takes comma separated parameters: -javaagent:sniffy-<VERSION>.jar=sniffyPort=5559,monitorNio=true

Spring Boot Integration

If you’re using Spring Boot, add the dependency below to your project in order to use Sniffy.

Maven
<dependency>
    <groupId>io.sniffy</groupId>
    <artifactId>sniffy-web</artifactId>
    <version>3.1.7</version>
</dependency>
Gradle
dependencies {
    compile 'io.sniffy:sniffy-web:3.1.7'
}

Sniffy Test

Sniffy artifacts for unit test frameworks are distributed via Maven Central repository and can be downloaded using your favorite package manager.

JUnit

Maven
<dependency>
    <groupId>io.sniffy</groupId>
    <artifactId>sniffy-junit</artifactId>
    <version>3.1.7</version>
    <scope>test</scope>
</dependency>
Gradle
dependencies {
    testCompile 'io.sniffy:sniffy-junit:3.1.7'
}

Spring Test

Maven
<dependency>
    <groupId>io.sniffy</groupId>
    <artifactId>sniffy-spring-test</artifactId>
    <version>3.1.7</version>
    <scope>test</scope>
</dependency>
Gradle
dependencies {
    testCompile 'io.sniffy:sniffy-spring-test:3.1.7'
}

TestNG

Maven
<dependency>
    <groupId>io.sniffy</groupId>
    <artifactId>sniffy-testng</artifactId>
    <version>3.1.7</version>
    <scope>test</scope>
</dependency>
Gradle
dependencies {
    testCompile 'io.sniffy:sniffy-testng:3.1.7'
}