From 365c3d30588bf4233e69f397771bd3e8536f8987 Mon Sep 17 00:00:00 2001 From: nofarb Date: Wed, 11 Aug 2021 10:27:01 -0400 Subject: [PATCH 1/2] Update HttpClientTest.java --- .../jhttp/functional/HttpClientTest.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/test/java/io/harness/jhttp/functional/HttpClientTest.java b/src/test/java/io/harness/jhttp/functional/HttpClientTest.java index 80c9042c..0951e75d 100644 --- a/src/test/java/io/harness/jhttp/functional/HttpClientTest.java +++ b/src/test/java/io/harness/jhttp/functional/HttpClientTest.java @@ -62,15 +62,46 @@ public void testReflection() throws IOException { @Test public void testDirectoryIndex() throws IOException { + Thread.sleep(10000); // sleep 10 sec testRequest("/directory1", "/http-server/server-root/directory1/index.html"); } @Test public void testStaticFile() throws IOException { + Thread.sleep(10000); // sleep 10 sec testRequest("/file1.html", "/http-server/server-root/file1.html"); testRequest("/file2.html", "/http-server/server-root/file2.html"); } + @Test + public void testStaticFile123() throws IOException { + Thread.sleep(10000); // sleep 10 sec + testRequest("/file1.html", "/http-server/server-root/file1.html"); + testRequest("/file2.html", "/http-server/server-root/file2.html"); + } + + @Test + public void testStaticFile1234() throws IOException { + Thread.sleep(10000); // sleep 10 sec + testRequest("/file1.html", "/http-server/server-root/file1.html"); + testRequest("/file2.html", "/http-server/server-root/file2.html"); + } + + @Test + public void testStaticFile2234() throws IOException { + Thread.sleep(10000); // sleep 10 sec + testRequest("/file1.html", "/http-server/server-root/file1.html"); + testRequest("/file2.html", "/http-server/server-root/file2.html"); + } + + + @Test + public void testStaticFile2341() throws IOException { + Thread.sleep(10000); // sleep 10 sec + testRequest("/file1.html", "/http-server/server-root/file1.html"); + testRequest("/file2.html", "/http-server/server-root/file2.html"); + } + @Test public void test404() throws IOException { testRequest("/invalid-file.html", "/http-server/404.html", 404); From f0a96d0709e4a6a37220985abffba4f6f1005f4a Mon Sep 17 00:00:00 2001 From: nofarb Date: Wed, 11 Aug 2021 10:32:17 -0400 Subject: [PATCH 2/2] fixed exceptions --- .../io/harness/jhttp/functional/HttpClientTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/io/harness/jhttp/functional/HttpClientTest.java b/src/test/java/io/harness/jhttp/functional/HttpClientTest.java index 0951e75d..ce1b89a1 100644 --- a/src/test/java/io/harness/jhttp/functional/HttpClientTest.java +++ b/src/test/java/io/harness/jhttp/functional/HttpClientTest.java @@ -61,34 +61,34 @@ public void testReflection() throws IOException { } @Test - public void testDirectoryIndex() throws IOException { + public void testDirectoryIndex() throws IOException, InterruptedException { Thread.sleep(10000); // sleep 10 sec testRequest("/directory1", "/http-server/server-root/directory1/index.html"); } @Test - public void testStaticFile() throws IOException { + public void testStaticFile() throws IOException , InterruptedException { Thread.sleep(10000); // sleep 10 sec testRequest("/file1.html", "/http-server/server-root/file1.html"); testRequest("/file2.html", "/http-server/server-root/file2.html"); } @Test - public void testStaticFile123() throws IOException { + public void testStaticFile123() throws IOException , InterruptedException{ Thread.sleep(10000); // sleep 10 sec testRequest("/file1.html", "/http-server/server-root/file1.html"); testRequest("/file2.html", "/http-server/server-root/file2.html"); } @Test - public void testStaticFile1234() throws IOException { + public void testStaticFile1234() throws IOException , InterruptedException { Thread.sleep(10000); // sleep 10 sec testRequest("/file1.html", "/http-server/server-root/file1.html"); testRequest("/file2.html", "/http-server/server-root/file2.html"); } @Test - public void testStaticFile2234() throws IOException { + public void testStaticFile2234() throws IOException , InterruptedException { Thread.sleep(10000); // sleep 10 sec testRequest("/file1.html", "/http-server/server-root/file1.html"); testRequest("/file2.html", "/http-server/server-root/file2.html"); @@ -96,7 +96,7 @@ public void testStaticFile2234() throws IOException { @Test - public void testStaticFile2341() throws IOException { + public void testStaticFile2341() throws IOException, InterruptedException { Thread.sleep(10000); // sleep 10 sec testRequest("/file1.html", "/http-server/server-root/file1.html"); testRequest("/file2.html", "/http-server/server-root/file2.html");