activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [4/4] activemq-artemis git commit: ARTEMIS-119 Added proper tests for webserver component startup checks.
Date Thu, 04 Jun 2015 14:21:39 GMT
ARTEMIS-119 Added proper tests for webserver component startup checks.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/fed0317d
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/fed0317d
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/fed0317d

Branch: refs/heads/master
Commit: fed0317df89520be6278ae0788fad1e69f882fc1
Parents: e2f301d
Author: John D. Ament <johndament@apache.org>
Authored: Thu Jun 4 09:53:49 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Jun 4 10:20:33 2015 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/component/WebServerComponent.java | 2 +-
 .../org/apache/activemq/artemis/test/WebServerComponentTest.java  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fed0317d/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
----------------------------------------------------------------------
diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
index 8453c46..7a1a423 100644
--- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
+++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java
@@ -92,7 +92,7 @@ public class WebServerComponent implements ExternalComponent
 
    public boolean isStarted()
    {
-      return server.isStarted();
+      return server != null && server.isStarted();
    }
 
    private void deployWar(String url, String warURL, String activeMQHome, String path)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fed0317d/artemis-web/src/test/java/org/apache/activemq/artemis/test/WebServerComponentTest.java
----------------------------------------------------------------------
diff --git a/artemis-web/src/test/java/org/apache/activemq/artemis/test/WebServerComponentTest.java
b/artemis-web/src/test/java/org/apache/activemq/artemis/test/WebServerComponentTest.java
index d432d5f..dafd14e 100644
--- a/artemis-web/src/test/java/org/apache/activemq/artemis/test/WebServerComponentTest.java
+++ b/artemis-web/src/test/java/org/apache/activemq/artemis/test/WebServerComponentTest.java
@@ -64,6 +64,7 @@ public class WebServerComponentTest extends Assert
       webServerDTO.bind = "http://localhost:8161";
       webServerDTO.path = "webapps";
       WebServerComponent webServerComponent = new WebServerComponent();
+      Assert.assertFalse(webServerComponent.isStarted());
       webServerComponent.configure(webServerDTO, "./src/test/resources/", "./src/test/resources/");
       webServerComponent.start();
       // Make the connection attempt.
@@ -92,7 +93,9 @@ public class WebServerComponentTest extends Assert
       assertEquals(clientHandler.body, "12345");
       // Wait for the server to close the connection.
       ch.close();
+      Assert.assertTrue(webServerComponent.isStarted());
       webServerComponent.stop();
+      Assert.assertFalse(webServerComponent.isStarted());
    }
 
    class ClientHandler extends SimpleChannelInboundHandler<HttpObject>


Mime
View raw message