Browse Source

cache plaintext's content (#6221)

* 初始化edap-http-benchmark的项目

* 修改pom文件以及测试的配置

* 修改端口号,jdk版本以及去掉有问题的plaintext的测试项

* 修改Message启动时初始化为每次请求生成新的对象

* 去掉多余的"s"字符

* 增加plaintext的测试配置

* add edap-http framwork

* cache plaintext's content.

Co-authored-by: louis <[email protected]>
luyongshou 4 years ago
parent
commit
13d0121d6c

+ 3 - 1
frameworks/Java/edap-http/src/main/java/io/edap/http/Bootstrap.java

@@ -12,11 +12,13 @@ import static io.edap.x.http.header.ContentType.PLAIN;
 
 public class Bootstrap {
 
+    static final byte[] PLAIN_TEXT_CONTENT = "Hello, World!".getBytes();
+
     public static void main(String[] args) throws IOException {
 
         HttpServer httpServer = new HttpServerBuilder()
                 .listen(8080)
-                .req("/plaintext", (req, resp) -> resp.contentType(PLAIN).write("Hello, World!"))
+                .req("/plaintext", (req, resp) -> resp.contentType(PLAIN).write(PLAIN_TEXT_CONTENT))
                 .get("/json", (req, resp) -> resp.contentType(JSON).write(new Message("Hello, World!")))
                 .build();
         Edap edap = new Edap();