Browse Source

add support for Test type 6: Plaintext

Jochen Berger 9 years ago
parent
commit
fe2c437578

+ 1 - 0
frameworks/Java/tapestry/benchmark_config.json

@@ -7,6 +7,7 @@
       "db_url": "/tapestry/hellodb",
       "db_url": "/tapestry/hellodb",
       "query_url": "/tapestry/hellodbs?queries=",
       "query_url": "/tapestry/hellodbs?queries=",
       "fortune_url": "/tapestry/hellofortune",
       "fortune_url": "/tapestry/hellofortune",
+      "plaintext_url": "/tapestry/helloplain",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
       "classification": "Fullstack",
       "classification": "Fullstack",

+ 22 - 0
frameworks/Java/tapestry/hello/src/main/java/hello/pages/HelloPlain.java

@@ -0,0 +1,22 @@
+package hello.pages;
+
+import org.apache.tapestry5.StreamResponse;
+import org.apache.tapestry5.annotations.PageLoaded;
+import org.apache.tapestry5.util.TextStreamResponse;
+
+/**
+ * Plain-text response test
+ */
+public class HelloPlain
+{
+  private TextStreamResponse response;
+  
+  @PageLoaded
+  void initializeResponse(){
+    response = new TextStreamResponse("text/plain", "Hello, World!");
+  }
+
+  StreamResponse onActivate() {
+    return response;
+  }
+}