You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2020/05/19 08:26:00 UTC
[karaf] branch master updated: Make HttpResourceExampleTest more
robust
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/master by this push:
new 0f20737 Make HttpResourceExampleTest more robust
0f20737 is described below
commit 0f20737512ac120452e2749b7e41f6857488e9d2
Author: jbonofre <jb...@apache.org>
AuthorDate: Tue May 19 10:26:21 2020 +0200
Make HttpResourceExampleTest more robust
---
.../karaf/itests/examples/HttpResourceExampleTest.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/itests/test/src/test/java/org/apache/karaf/itests/examples/HttpResourceExampleTest.java b/itests/test/src/test/java/org/apache/karaf/itests/examples/HttpResourceExampleTest.java
index cfe76eb..3ed7a11 100644
--- a/itests/test/src/test/java/org/apache/karaf/itests/examples/HttpResourceExampleTest.java
+++ b/itests/test/src/test/java/org/apache/karaf/itests/examples/HttpResourceExampleTest.java
@@ -21,7 +21,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -29,18 +29,22 @@ import java.net.HttpURLConnection;
import java.net.URL;
@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
+@ExamReactorStrategy(PerClass.class)
public class HttpResourceExampleTest extends BaseTest {
- @Test
+ @Test(timeout = 60000L)
public void test() throws Exception {
addFeaturesRepository("mvn:org.apache.karaf.examples/karaf-http-resource-example-features/" + System.getProperty("karaf.version") + "/xml");
installAndAssertFeature("karaf-http-resource-example-whiteboard");
String command = executeCommand("http:list");
- System.out.println(command);
+ while (!command.contains("Deployed")) {
+ Thread.sleep(200);
+ command = executeCommand("http:list");
+ }
assertContains("ResourceServlet", command);
+ assertContains("Deployed", command);
URL url = new URL("http://localhost:" + getHttpPort() + "/example/index.html");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();