Skip to content

Commit

Permalink
Increase test timeout.
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Hudalla <kai.hudalla@bosch-si.com>
  • Loading branch information
Kai Hudalla committed May 14, 2018
1 parent a786dc5 commit 07d8122
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/src/test/java/org/eclipse/hono/tests/http/HttpTestBase.java
Expand Up @@ -42,6 +42,7 @@
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.rules.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -66,7 +67,7 @@ public abstract class HttpTestBase {

private static final String ORIGIN_WILDCARD = "*";
private static final Vertx VERTX = Vertx.vertx();
private static final long TEST_TIMEOUT = 5000; // ms
private static final long TEST_TIMEOUT = 10000; // ms
private static final int MESSAGES_TO_SEND = 60;

/**
Expand All @@ -88,6 +89,11 @@ public abstract class HttpTestBase {
*/
@Rule
public final Timeout timeout = Timeout.millis(TEST_TIMEOUT);
/**
* Provide test name to unit tests.
*/
@Rule
public final TestName testName = new TestName();

/**
* A client for connecting to the HTTP adapter.
Expand Down Expand Up @@ -146,6 +152,7 @@ private static Future<X509Certificate> getCertificate(final String path) {
@Before
public void setUp() {

LOGGER.info("running {}", testName.getMethodName());
LOGGER.info("using HTTP adapter [host: {}, http port: {}, https port: {}]",
IntegrationTestSupport.HTTP_HOST,
IntegrationTestSupport.HTTP_PORT,
Expand Down Expand Up @@ -391,10 +398,10 @@ private Future<Void> assertHttpResponse(final MultiMap responseHeaders) {
&& (allowedOrigin.equals(ORIGIN_WILDCARD) || allowedOrigin.equals(ORIGIN_URI));


if (!hasValidOrigin) {
result.fail(new IllegalArgumentException("response contains invalid allowed origin: " + allowedOrigin));
} else {
if (hasValidOrigin) {
result.complete();;
} else {
result.fail(new IllegalArgumentException("response contains invalid allowed origin: " + allowedOrigin));
}
return result;
}
Expand Down

0 comments on commit 07d8122

Please sign in to comment.