Browse Source

add new framework Baratine

nam 9 years ago
parent
commit
c3b75dba46

+ 26 - 0
frameworks/Java/baratine/README.md

@@ -0,0 +1,26 @@
+# Baratine Benchmarking Test
+
+This is the Baratine portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+
+### Plaintext Test
+
+* [Plaintext test source](src/main/java/testTechempowerBaratine/PlaintextService.java)
+
+### JSON Encoding Test
+
+* [JSON test source](src/main/java/testTechempowerBaratine/JsonService.java)
+
+## Software Versions
+
+* [Java OpenJDK 1.8](http://openjdk.java.net/)
+* [Baratine 0.11.0](http://baratine.io/)
+
+## Test URLs
+
+### Plaintext Test
+
+    http://localhost:8080/plaintext
+
+### JSON Encoding Test
+
+    http://localhost:8080/json

+ 24 - 0
frameworks/Java/baratine/benchmark_config.json

@@ -0,0 +1,24 @@
+{
+  "framework": "baratine",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "None",
+      "framework": "baratine",
+      "language": "Java",
+      "orm": "Raw",
+      "platform": "Baratine",
+      "webserver": "Baratine",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "baratine",
+      "notes": "",
+      "versus": "baratine"
+    }
+  }]
+}

+ 57 - 0
frameworks/Java/baratine/pom.xml

@@ -0,0 +1,57 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>io.baratine</groupId>
+  <artifactId>testTechempowerBaratine</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>testTechempowerBaratine</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.8</maven.compiler.source>
+    <maven.compiler.target>1.8</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.baratine</groupId>
+      <artifactId>baratine</artifactId>
+      <version>0.11.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>2.4.3</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <mainClass>testTechempowerBaratine.Main</mainClass>
+                </transformer>
+              </transformers>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

+ 7 - 0
frameworks/Java/baratine/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+fw_depends java maven
+
+mvn clean package
+
+java -jar target/testTechempowerBaratine-0.0.1-SNAPSHOT.jar ${DBHOST}

+ 3 - 0
frameworks/Java/baratine/source_code

@@ -0,0 +1,3 @@
+./baratine/src/main/java/testTechempowerBaratine/JsonService.java
+./baratine/src/main/java/testTechempowerBaratine/Main.java
+./baratine/src/main/java/testTechempowerBaratine/PlaintextService.java

+ 24 - 0
frameworks/Java/baratine/src/main/java/testTechempowerBaratine/JsonService.java

@@ -0,0 +1,24 @@
+package testTechempowerBaratine;
+
+import io.baratine.service.Result;
+import io.baratine.service.Service;
+import io.baratine.web.http.Get;
+
+@Service
+public class JsonService
+{
+  @Get("/json")
+  public void hello(Result<HelloWorld> result)
+  {
+    result.ok(new HelloWorld("Hello, World!"));
+  }
+
+  public static class HelloWorld {
+    private String message;
+
+    public HelloWorld(String msg)
+    {
+      this.message = msg;
+    }
+  }
+}

+ 16 - 0
frameworks/Java/baratine/src/main/java/testTechempowerBaratine/Main.java

@@ -0,0 +1,16 @@
+package testTechempowerBaratine;
+
+import static io.baratine.web.Web.*;
+
+public class Main
+{
+  public static void main(String[] args)
+  {
+    include(PlaintextService.class);
+    include(JsonService.class);
+
+    start();
+
+    join();
+  }
+}

+ 15 - 0
frameworks/Java/baratine/src/main/java/testTechempowerBaratine/PlaintextService.java

@@ -0,0 +1,15 @@
+package testTechempowerBaratine;
+
+import io.baratine.service.Result;
+import io.baratine.service.Service;
+import io.baratine.web.http.Get;
+
+@Service
+public class PlaintextService
+{
+  @Get("/plaintext")
+  public void hello(Result<String> result)
+  {
+    result.ok("Hello, World!");
+  }
+}