Skip to content

Commit

Permalink
HBASE-14344 Add timeouts to TestHttpServerLifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Bertozzi committed Sep 3, 2015
1 parent e489919 commit 5152ac0
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ private void assertNotLive(HttpServer server) {
*
* @throws Throwable on failure
*/
@Test public void testCreatedServerIsNotAlive() throws Throwable {
@Test(timeout=60000)
public void testCreatedServerIsNotAlive() throws Throwable {
HttpServer server = createTestServer();
assertNotLive(server);
}

@Test public void testStopUnstartedServer() throws Throwable {
@Test(timeout=60000)
public void testStopUnstartedServer() throws Throwable {
HttpServer server = createTestServer();
stop(server);
}
Expand All @@ -61,7 +63,7 @@ private void assertNotLive(HttpServer server) {
*
* @throws Throwable on failure
*/
@Test
@Test(timeout=60000)
public void testStartedServerIsAlive() throws Throwable {
HttpServer server = null;
server = createTestServer();
Expand All @@ -87,7 +89,8 @@ private void assertToStringContains(HttpServer server, String text) {
*
* @throws Throwable on failure
*/
@Test public void testStoppedServerIsNotAlive() throws Throwable {
@Test(timeout=60000)
public void testStoppedServerIsNotAlive() throws Throwable {
HttpServer server = createAndStartTestServer();
assertAlive(server);
stop(server);
Expand All @@ -99,7 +102,8 @@ private void assertToStringContains(HttpServer server, String text) {
*
* @throws Throwable on failure
*/
@Test public void testStoppingTwiceServerIsAllowed() throws Throwable {
@Test(timeout=60000)
public void testStoppingTwiceServerIsAllowed() throws Throwable {
HttpServer server = createAndStartTestServer();
assertAlive(server);
stop(server);
Expand All @@ -110,11 +114,11 @@ private void assertToStringContains(HttpServer server, String text) {

/**
* Test that the server is alive once started
*
*
* @throws Throwable
* on failure
*/
@Test
@Test(timeout=60000)
public void testWepAppContextAfterServerStop() throws Throwable {
HttpServer server = null;
String key = "test.attribute.key";
Expand Down

0 comments on commit 5152ac0

Please sign in to comment.