profiling different implementations for testing


I’m writing a small library which used JAX-RS API.

<dependency>
  <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0.1</version>
    <scope>provided</scope>
</dependency>

Profiles can help for testing the code against each implementation.

<profile>
  <id>jersey</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
  <dependencies>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>2.23.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</profile>    
<profile>
  <id>cxf</id>
  <dependencies>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-client</artifactId>
      <version>3.1.6</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</profile>    
<profile>
  <id>resteasy</id>
  <dependencies>
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-client</artifactId>
      <version>3.0.17.Final</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</profile>

Test against each implementation like this.

$ mvn -Pjersey verify
$ mvn -Pcxf verify
$ mvn -Presteasy verify
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s