Added quarkus tests

master
Edward M. Kagan 4 years ago
parent 594cf0af56
commit fb179b0fd0

@ -0,0 +1,54 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>twopm.tech.jax-rs-bench</groupId>
<artifactId>bom</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quarkus-resteasy-jackson</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<parameters>${maven.compiler.parameters}</parameters>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,33 @@
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;
import javax.ws.rs.core.MediaType;
@Path("/test")
public class TestResource {
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public String index() {
return "{ \"status\" : \"OK\", \"method\" : \"GET\" }";
}
@GET
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public String get(@PathParam("id") Long id) {
return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }";
}
@POST
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public String post(@PathParam("id") Long id) {
return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }";
}
}

@ -0,0 +1,54 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>twopm.tech.jax-rs-bench</groupId>
<artifactId>bom</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quarkus-resteasy-jsonb</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jsonb</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<parameters>${maven.compiler.parameters}</parameters>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,33 @@
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;
import javax.ws.rs.core.MediaType;
@Path("/test")
public class TestResource {
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public String index() {
return "{ \"status\" : \"OK\", \"method\" : \"GET\" }";
}
@GET
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public String get(@PathParam("id") Long id) {
return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }";
}
@POST
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public String post(@PathParam("id") Long id) {
return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }";
}
}

@ -1,18 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>twopm.tech</groupId>
<artifactId>jax-rs-bench</artifactId>
<groupId>twopm.tech.jax-rs-bench</groupId>
<artifactId>bom</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>rawnetty</artifactId>
<properties>
<app.main.class>com.colobu.rest.nativenetty.Main</app.main.class>
</properties>
<dependencies>
<dependency>
<groupId>io.netty</groupId>

@ -1,19 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<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>
<groupId>twopm.tech</groupId>
<artifactId>jax-rs-bench</artifactId>
<packaging>pom</packaging>
<groupId>twopm.tech.jax-rs-bench</groupId>
<artifactId>bom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>modules/rawnetty</module>
<module>modules/quarkus-resteasy-jackson</module>
<module>modules/quarkus-resteasy-jsonb</module>
</modules>
<properties>
<netty.version>4.1.69.Final</netty.version>
<app.main.class>twopm.tech.bench.jaxrs.Bench</app.main.class>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<java.version>11</java.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<netty.version>4.1.69.Final</netty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>2.4.0.Final</quarkus.platform.version>
</properties>
<modules>
<module>modules/rawnetty</module>
</modules>
</project>
Loading…
Cancel
Save