Fix WebAppIntegrationTest - ensureTomcatIsShutdown needs dependsOnMethod="shutdownApp", otherwise fails because nothing previously asked tomcat to shutdown.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/2a28206a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/2a28206a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/2a28206a Branch: refs/heads/0.5.0 Commit: 2a28206ac5c56350a4e9d3c9edee09ee24fcbd51 Parents: a5c52c0 Author: Aled Sage <[email protected]> Authored: Wed Mar 27 08:37:32 2013 +0000 Committer: Aled Sage <[email protected]> Committed: Wed Mar 27 08:37:32 2013 +0000 ---------------------------------------------------------------------- .../entity/webapp/WebAppIntegrationTest.groovy | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/2a28206a/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppIntegrationTest.groovy ---------------------------------------------------------------------- diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppIntegrationTest.groovy b/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppIntegrationTest.groovy index 80a0da7..f9414d1 100644 --- a/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppIntegrationTest.groovy +++ b/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppIntegrationTest.groovy @@ -90,7 +90,7 @@ public class WebAppIntegrationTest { } } - @AfterMethod(alwaysRun=true) + @AfterMethod(alwaysRun=true, dependsOnMethods="shutdownApp") public void ensureTomcatIsShutDown() { Socket shutdownSocket = null; SocketException gotException = null; @@ -110,17 +110,17 @@ public class WebAppIntegrationTest { .run(); if (socketClosed == false) { - log.error "Tomcat did not shut down - this is a failure of the last test run"; - log.warn "I'm sending a message to the Tomcat shutdown port"; - OutputStreamWriter writer = new OutputStreamWriter(shutdownSocket.getOutputStream()); - writer.write("SHUTDOWN\r\n"); - writer.flush(); - writer.close(); - shutdownSocket.close(); - throw new Exception("Last test run did not shut down Tomcat") +// log.error("Tomcat did not shut down - this is a failure of the last test run"); +// log.warn("I'm sending a message to the Tomcat shutdown port {}", shutdownPort); +// OutputStreamWriter writer = new OutputStreamWriter(shutdownSocket.getOutputStream()); +// writer.write("SHUTDOWN\r\n"); +// writer.flush(); +// writer.close(); +// shutdownSocket.close(); + throw new Exception("Last test run did not shut down Tomcat entity "+entity+" (port "+shutdownPort+")"); } } else { - log.info "Cannot shutdown, because shutdown-port not set for $entity"; + log.info("Cannot shutdown, because shutdown-port not set for {}", entity); } }
