diff --git a/.gitignore b/.gitignore index 320e75b..0cb86de 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ dependency-reduced-pom.xml .classpath .settings +.factorypath target \ No newline at end of file diff --git a/modules/jooby-jetty/pom.xml b/modules/jooby-jetty/pom.xml new file mode 100644 index 0000000..a616504 --- /dev/null +++ b/modules/jooby-jetty/pom.xml @@ -0,0 +1,74 @@ + + + + twopm.tech.jax-rs-bench + bom + 1.0-SNAPSHOT + ../../pom.xml + + 4.0.0 + jooby-jetty + + + io.jooby + jooby-jetty + ${jooby.version} + + + + + + io.jooby + jooby-maven-plugin + ${jooby.version} + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin.version} + + + package + + shade + + + false + + + + ${app.main.class} + + + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + + + io.jooby + jooby-apt + ${jooby.version} + + + + + + + + + + + io.jooby + jooby-bom + ${jooby.version} + pom + import + + + + \ No newline at end of file diff --git a/modules/jooby-jetty/src/main/java/twopm/tech/bench/jaxrs/Bench.java b/modules/jooby-jetty/src/main/java/twopm/tech/bench/jaxrs/Bench.java new file mode 100644 index 0000000..00b62fa --- /dev/null +++ b/modules/jooby-jetty/src/main/java/twopm/tech/bench/jaxrs/Bench.java @@ -0,0 +1,14 @@ +package twopm.tech.bench.jaxrs; + +import io.jooby.Jooby; + +public class Bench extends Jooby { + { + mvc(new TestResource()); + } + + public static void main(final String[] args) { + runApp(args, Bench::new); + } + +} diff --git a/modules/jooby-jetty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java b/modules/jooby-jetty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java new file mode 100644 index 0000000..3da7515 --- /dev/null +++ b/modules/jooby-jetty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java @@ -0,0 +1,28 @@ +package twopm.tech.bench.jaxrs; + +import io.jooby.annotations.*; + +@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) + " }"; + } +} \ No newline at end of file diff --git a/modules/jooby-netty/pom.xml b/modules/jooby-netty/pom.xml new file mode 100644 index 0000000..d31a391 --- /dev/null +++ b/modules/jooby-netty/pom.xml @@ -0,0 +1,74 @@ + + + + twopm.tech.jax-rs-bench + bom + 1.0-SNAPSHOT + ../../pom.xml + + 4.0.0 + jooby-netty + + + io.jooby + jooby-netty + ${jooby.version} + + + + + + io.jooby + jooby-maven-plugin + ${jooby.version} + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin.version} + + + package + + shade + + + false + + + + ${app.main.class} + + + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + + + io.jooby + jooby-apt + ${jooby.version} + + + + + + + + + + + io.jooby + jooby-bom + ${jooby.version} + pom + import + + + + \ No newline at end of file diff --git a/modules/jooby-netty/src/main/java/twopm/tech/bench/jaxrs/Bench.java b/modules/jooby-netty/src/main/java/twopm/tech/bench/jaxrs/Bench.java new file mode 100644 index 0000000..00b62fa --- /dev/null +++ b/modules/jooby-netty/src/main/java/twopm/tech/bench/jaxrs/Bench.java @@ -0,0 +1,14 @@ +package twopm.tech.bench.jaxrs; + +import io.jooby.Jooby; + +public class Bench extends Jooby { + { + mvc(new TestResource()); + } + + public static void main(final String[] args) { + runApp(args, Bench::new); + } + +} diff --git a/modules/jooby-netty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java b/modules/jooby-netty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java new file mode 100644 index 0000000..3da7515 --- /dev/null +++ b/modules/jooby-netty/src/main/java/twopm/tech/bench/jaxrs/TestResource.java @@ -0,0 +1,28 @@ +package twopm.tech.bench.jaxrs; + +import io.jooby.annotations.*; + +@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) + " }"; + } +} \ No newline at end of file diff --git a/modules/jooby-undertow/pom.xml b/modules/jooby-undertow/pom.xml new file mode 100644 index 0000000..bbaf57c --- /dev/null +++ b/modules/jooby-undertow/pom.xml @@ -0,0 +1,74 @@ + + + + twopm.tech.jax-rs-bench + bom + 1.0-SNAPSHOT + ../../pom.xml + + 4.0.0 + jooby-undertow + + + io.jooby + jooby-utow + ${jooby.version} + + + + + + io.jooby + jooby-maven-plugin + ${jooby.version} + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin.version} + + + package + + shade + + + false + + + + ${app.main.class} + + + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + + + io.jooby + jooby-apt + ${jooby.version} + + + + + + + + + + + io.jooby + jooby-bom + ${jooby.version} + pom + import + + + + \ No newline at end of file diff --git a/modules/jooby-undertow/src/main/java/twopm/tech/bench/jaxrs/Bench.java b/modules/jooby-undertow/src/main/java/twopm/tech/bench/jaxrs/Bench.java new file mode 100644 index 0000000..00b62fa --- /dev/null +++ b/modules/jooby-undertow/src/main/java/twopm/tech/bench/jaxrs/Bench.java @@ -0,0 +1,14 @@ +package twopm.tech.bench.jaxrs; + +import io.jooby.Jooby; + +public class Bench extends Jooby { + { + mvc(new TestResource()); + } + + public static void main(final String[] args) { + runApp(args, Bench::new); + } + +} diff --git a/modules/jooby-undertow/src/main/java/twopm/tech/bench/jaxrs/TestResource.java b/modules/jooby-undertow/src/main/java/twopm/tech/bench/jaxrs/TestResource.java new file mode 100644 index 0000000..3da7515 --- /dev/null +++ b/modules/jooby-undertow/src/main/java/twopm/tech/bench/jaxrs/TestResource.java @@ -0,0 +1,28 @@ +package twopm.tech.bench.jaxrs; + +import io.jooby.annotations.*; + +@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) + " }"; + } +} \ No newline at end of file diff --git a/modules/rawnetty/pom.xml b/modules/rawnetty/pom.xml index 0551c27..3c350b1 100644 --- a/modules/rawnetty/pom.xml +++ b/modules/rawnetty/pom.xml @@ -20,7 +20,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.4 + ${maven.shade.plugin.version} package @@ -28,6 +28,7 @@ shade + false diff --git a/pom.xml b/pom.xml index fdd5325..392f1ee 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,9 @@ pom modules/rawnetty + modules/jooby-netty + modules/jooby-jetty + modules/jooby-undertow modules/quarkus-resteasy-jackson modules/quarkus-resteasy-jsonb @@ -17,7 +20,9 @@ true 11 11 + 3.2.4 4.1.69.Final + 2.11.0 UTF-8 UTF-8 quarkus-bom diff --git a/workspace.code-workspace b/workspace.code-workspace index 6afd800..d852b87 100644 --- a/workspace.code-workspace +++ b/workspace.code-workspace @@ -1,21 +1,13 @@ { "folders": [ - { - "name": "modules", - "path": "modules" - }, { "name": "jax-rs-bench", - "path": ".", - "files.exclude": ["", ""] + "path": "." } ], "settings": { "java.configuration.updateBuildConfiguration": "automatic", "java.dependency.packagePresentation": "hierarchical", - "java.dependency.syncWithFolderExplorer": true, - "files.exclude": { - "modules": true - } + "java.dependency.syncWithFolderExplorer": true } }