Apache CXF test suite
parent
6d58ec6df8
commit
390e6dcb40
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>twopm.tech.jax-rs-bench</groupId>
|
||||
<artifactId>bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>cxf-jetty</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http-jetty</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>${maven.shade.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<Main-Class>${app.main.class}</Main-Class>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,27 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.cxf.endpoint.Server;
|
||||
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
|
||||
|
||||
public class Bench {
|
||||
|
||||
public static final String BASE_URI = "localhost:8080";
|
||||
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean();
|
||||
factoryBean.setResourceClasses(TestResource.class);
|
||||
factoryBean.setAddress(BASE_URI);
|
||||
Server server = factoryBean.create();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
try {
|
||||
server.stop();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Bench.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}));
|
||||
Thread.currentThread().join();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
|
||||
@Path("test")
|
||||
public class TestResource {
|
||||
|
||||
@GET
|
||||
@Path("/")
|
||||
@Produces("application/json")
|
||||
public String index() {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\" }";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
public String get(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
public String post(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>twopm.tech.jax-rs-bench</groupId>
|
||||
<artifactId>bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>cxf-netty</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http-netty-server</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>${maven.shade.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<Main-Class>${app.main.class}</Main-Class>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,27 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.cxf.endpoint.Server;
|
||||
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
|
||||
|
||||
public class Bench {
|
||||
|
||||
public static final String BASE_URI = "localhost:8080";
|
||||
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean();
|
||||
factoryBean.setResourceClasses(TestResource.class);
|
||||
factoryBean.setAddress(BASE_URI);
|
||||
Server server = factoryBean.create();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
try {
|
||||
server.stop();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Bench.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}));
|
||||
Thread.currentThread().join();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
|
||||
@Path("test")
|
||||
public class TestResource {
|
||||
|
||||
@GET
|
||||
@Path("/")
|
||||
@Produces("application/json")
|
||||
public String index() {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\" }";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
public String get(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
public String post(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>twopm.tech.jax-rs-bench</groupId>
|
||||
<artifactId>bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>cxf-undertow</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http-undertow</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>${maven.shade.plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<Main-Class>${app.main.class}</Main-Class>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,27 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.cxf.endpoint.Server;
|
||||
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
|
||||
|
||||
public class Bench {
|
||||
|
||||
public static final String BASE_URI = "localhost:8080";
|
||||
|
||||
public static void main(String[] args) throws IOException, InterruptedException {
|
||||
JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean();
|
||||
factoryBean.setResourceClasses(TestResource.class);
|
||||
factoryBean.setAddress(BASE_URI);
|
||||
Server server = factoryBean.create();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
try {
|
||||
server.stop();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Bench.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}));
|
||||
Thread.currentThread().join();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
|
||||
@Path("test")
|
||||
public class TestResource {
|
||||
|
||||
@GET
|
||||
@Path("/")
|
||||
@Produces("application/json")
|
||||
public String index() {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\" }";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
public String get(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
public String post(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue