You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ha...@apache.org on 2015/08/04 21:51:58 UTC
[1/4] incubator-brooklyn git commit: brooklyn-logback-includes: add
package org.apache.brooklyn
Repository: incubator-brooklyn
Updated Branches:
refs/heads/master a6c77f39b -> 60af015b7
brooklyn-logback-includes: add package org.apache.brooklyn
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/889880f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/889880f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/889880f5
Branch: refs/heads/master
Commit: 889880f5f85ba1f41e4a2e0be2e4b7f80cb5a4bd
Parents: ffbd6ef
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Tue Aug 4 16:15:06 2015 +0300
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Tue Aug 4 16:15:06 2015 +0300
----------------------------------------------------------------------
.../src/main/resources/brooklyn/logback-logger-debug-all.xml | 2 ++
.../src/main/resources/brooklyn/logback-logger-debug-favs.xml | 4 ++++
.../src/main/resources/brooklyn/logback-logger-trace.xml | 3 ++-
3 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/889880f5/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-all.xml
----------------------------------------------------------------------
diff --git a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-all.xml b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-all.xml
index a270fda..67e1ef1 100644
--- a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-all.xml
+++ b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-all.xml
@@ -22,6 +22,8 @@
<!-- log all brooklyn at debug -->
<logger name="brooklyn" level="DEBUG"/>
<logger name="io.brooklyn" level="DEBUG"/>
+ <logger name="org.apache.brooklyn" level="DEBUG"/>
+
<!-- jclouds uses org.jclouds.* class logging as well as special jclouds.* logger categories -->
<logger name="org.jclouds" level="DEBUG"/>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/889880f5/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-favs.xml
----------------------------------------------------------------------
diff --git a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-favs.xml b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-favs.xml
index 1ab1e03..b4f1ccc 100644
--- a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-favs.xml
+++ b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-debug-favs.xml
@@ -25,4 +25,8 @@
<logger name="brooklyn.location.basic.jclouds" level="DEBUG"/>
<logger name="brooklyn.util.internal.ssh" level="DEBUG"/>
+ <logger name="org.apache.brooklyn.SSH" level="DEBUG"/>
+ <logger name="org.apache.brooklyn.location.basic.jclouds" level="DEBUG"/>
+ <logger name="org.apache.brooklyn.util.internal.ssh" level="DEBUG"/>
+
</included>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/889880f5/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
----------------------------------------------------------------------
diff --git a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
index a4e5376..a33464d 100644
--- a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
+++ b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
@@ -22,5 +22,6 @@
<!-- enable TRACE logging -->
<logger name="brooklyn" level="TRACE"/>
<logger name="io.brooklyn" level="TRACE"/>
-
+ <logger name="org.apache.brooklyn" level="DEBUG"/>
+
</included>
[4/4] incubator-brooklyn git commit: This closes #788
Posted by ha...@apache.org.
This closes #788
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/60af015b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/60af015b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/60af015b
Branch: refs/heads/master
Commit: 60af015b71fe85a2eb31929f0d45c4a12b0b19d7
Parents: a6c77f3 e06e79a
Author: Hadrian Zbarcea <ha...@apache.org>
Authored: Tue Aug 4 15:42:12 2015 -0400
Committer: Hadrian Zbarcea <ha...@apache.org>
Committed: Tue Aug 4 15:42:12 2015 -0400
----------------------------------------------------------------------
.../test/java/brooklyn/BrooklynVersionTest.java | 2 +-
.../brooklyn/camp/lite/CampYamlLiteTest.java | 2 +-
.../entity/rebind/RebindCatalogEntityTest.java | 2 +-
.../persister/XmlMementoSerializerTest.java | 2 +-
.../management/osgi/OsgiStandaloneTest.java | 2 +-
.../osgi/OsgiVersionMoreEntityTest.java | 2 +-
.../test/java/brooklyn/test/HttpService.java | 1 +
parent/pom.xml | 2 +-
.../entity/osgi/karaf/KarafContainerTest.java | 2 +-
.../nginx/NginxClusterIntegrationTest.java | 2 +-
.../nginx/NginxHttpsSslIntegrationTest.java | 2 +-
.../proxy/nginx/NginxIntegrationTest.java | 2 +-
.../proxy/nginx/NginxRebindIntegrationTest.java | 2 +-
.../nginx/NginxRebindWithHaIntegrationTest.java | 2 +-
.../nginx/NginxUrlMappingIntegrationTest.java | 2 +-
.../proxy/nginx/NginxWebClusterEc2LiveTest.java | 2 +-
.../AbstractWebAppFixtureIntegrationTest.java | 2 +-
...lledDynamicWebAppClusterIntegrationTest.java | 2 +-
.../ControlledDynamicWebAppClusterTest.java | 2 +-
...ElasticJavaWebAppServiceIntegrationTest.java | 2 +-
.../webapp/WebAppConcurrentDeployTest.java | 2 +-
...namicWebAppClusterRebindIntegrationTest.java | 2 +-
...namicWebAppClusterRebindIntegrationTest.java | 2 +-
.../jboss/JBoss6ServerAwsEc2LiveTest.java | 2 +-
...Boss6ServerNonInheritingIntegrationTest.java | 2 +-
.../jboss/JBoss7ServerAwsEc2LiveTest.java | 2 +-
.../jboss/JBoss7ServerDockerLiveTest.java | 2 +-
...Boss7ServerNonInheritingIntegrationTest.java | 2 +-
.../JBoss7ServerRebindingIntegrationTest.java | 2 +-
.../Jboss7ServerGoogleComputeLiveTest.java | 2 +-
.../webapp/tomcat/Tomcat8ServerEc2LiveTest.java | 2 +-
.../tomcat/Tomcat8ServerSoftlayerLiveTest.java | 2 +-
...mcat8ServerWebAppFixtureIntegrationTest.java | 2 +-
.../webapp/tomcat/TomcatServerEc2LiveTest.java | 2 +-
.../tomcat/TomcatServerSoftlayerLiveTest.java | 2 +-
...omcatServerWebAppFixtureIntegrationTest.java | 2 +-
.../camp/brooklyn/ReferencedYamlTest.java | 2 +-
.../catalog/AbstractCatalogXmlTest.java | 2 +-
.../CatalogOsgiVersionMoreEntityTest.java | 2 +-
.../brooklyn/catalog/CatalogYamlEntityTest.java | 2 +-
.../catalog/CatalogYamlLocationTest.java | 2 +-
.../brooklyn/catalog/CatalogYamlPolicyTest.java | 2 +-
.../catalog/CatalogYamlTemplateTest.java | 2 +-
usage/downstream-parent/pom.xml | 4 +-
.../brooklyn/launcher/WebAppRunnerTest.java | 2 +-
.../brooklyn/logback-logger-debug-all.xml | 2 +
.../brooklyn/logback-logger-debug-favs.xml | 4 +
.../resources/brooklyn/logback-logger-trace.xml | 3 +-
.../rest/resources/CatalogResourceTest.java | 2 +-
.../brooklyn/test/BrooklynLeakListener.java | 89 -----
.../brooklyn/test/LoggingVerboseReporter.java | 36 --
.../test/PlatformTestSelectorListener.java | 57 ---
.../main/java/brooklyn/test/StatusListener.java | 100 ------
.../test/TestResourceUnavailableException.java | 140 --------
.../java/brooklyn/test/VerboseReporter.java | 343 -------------------
.../brooklyn/test/BrooklynLeakListener.java | 89 +++++
.../brooklyn/test/LoggingVerboseReporter.java | 36 ++
.../test/PlatformTestSelectorListener.java | 57 +++
.../apache/brooklyn/test/StatusListener.java | 100 ++++++
.../test/TestResourceUnavailableException.java | 140 ++++++++
.../apache/brooklyn/test/VerboseReporter.java | 343 +++++++++++++++++++
61 files changed, 820 insertions(+), 812 deletions(-)
----------------------------------------------------------------------
[3/4] incubator-brooklyn git commit: brooklyn-utils-test-support: add
org.apache package prefix
Posted by ha...@apache.org.
brooklyn-utils-test-support: add org.apache package prefix
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/e06e79ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/e06e79ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/e06e79ab
Branch: refs/heads/master
Commit: e06e79abe2334d0265715678e8838df1a25422ae
Parents: 889880f
Author: Ciprian Ciubotariu <ch...@gmx.net>
Authored: Tue Aug 4 17:02:56 2015 +0300
Committer: Ciprian Ciubotariu <ch...@gmx.net>
Committed: Tue Aug 4 17:03:52 2015 +0300
----------------------------------------------------------------------
.../test/java/brooklyn/BrooklynVersionTest.java | 2 +-
.../brooklyn/camp/lite/CampYamlLiteTest.java | 2 +-
.../entity/rebind/RebindCatalogEntityTest.java | 2 +-
.../persister/XmlMementoSerializerTest.java | 2 +-
.../management/osgi/OsgiStandaloneTest.java | 2 +-
.../osgi/OsgiVersionMoreEntityTest.java | 2 +-
.../test/java/brooklyn/test/HttpService.java | 1 +
parent/pom.xml | 2 +-
.../entity/osgi/karaf/KarafContainerTest.java | 2 +-
.../nginx/NginxClusterIntegrationTest.java | 2 +-
.../nginx/NginxHttpsSslIntegrationTest.java | 2 +-
.../proxy/nginx/NginxIntegrationTest.java | 2 +-
.../proxy/nginx/NginxRebindIntegrationTest.java | 2 +-
.../nginx/NginxRebindWithHaIntegrationTest.java | 2 +-
.../nginx/NginxUrlMappingIntegrationTest.java | 2 +-
.../proxy/nginx/NginxWebClusterEc2LiveTest.java | 2 +-
.../AbstractWebAppFixtureIntegrationTest.java | 2 +-
...lledDynamicWebAppClusterIntegrationTest.java | 2 +-
.../ControlledDynamicWebAppClusterTest.java | 2 +-
...ElasticJavaWebAppServiceIntegrationTest.java | 2 +-
.../webapp/WebAppConcurrentDeployTest.java | 2 +-
...namicWebAppClusterRebindIntegrationTest.java | 2 +-
...namicWebAppClusterRebindIntegrationTest.java | 2 +-
.../jboss/JBoss6ServerAwsEc2LiveTest.java | 2 +-
...Boss6ServerNonInheritingIntegrationTest.java | 2 +-
.../jboss/JBoss7ServerAwsEc2LiveTest.java | 2 +-
.../jboss/JBoss7ServerDockerLiveTest.java | 2 +-
...Boss7ServerNonInheritingIntegrationTest.java | 2 +-
.../JBoss7ServerRebindingIntegrationTest.java | 2 +-
.../Jboss7ServerGoogleComputeLiveTest.java | 2 +-
.../webapp/tomcat/Tomcat8ServerEc2LiveTest.java | 2 +-
.../tomcat/Tomcat8ServerSoftlayerLiveTest.java | 2 +-
...mcat8ServerWebAppFixtureIntegrationTest.java | 2 +-
.../webapp/tomcat/TomcatServerEc2LiveTest.java | 2 +-
.../tomcat/TomcatServerSoftlayerLiveTest.java | 2 +-
...omcatServerWebAppFixtureIntegrationTest.java | 2 +-
.../camp/brooklyn/ReferencedYamlTest.java | 2 +-
.../catalog/AbstractCatalogXmlTest.java | 2 +-
.../CatalogOsgiVersionMoreEntityTest.java | 2 +-
.../brooklyn/catalog/CatalogYamlEntityTest.java | 2 +-
.../catalog/CatalogYamlLocationTest.java | 2 +-
.../brooklyn/catalog/CatalogYamlPolicyTest.java | 2 +-
.../catalog/CatalogYamlTemplateTest.java | 2 +-
usage/downstream-parent/pom.xml | 4 +-
.../brooklyn/launcher/WebAppRunnerTest.java | 2 +-
.../rest/resources/CatalogResourceTest.java | 2 +-
.../brooklyn/test/BrooklynLeakListener.java | 89 -----
.../brooklyn/test/LoggingVerboseReporter.java | 36 --
.../test/PlatformTestSelectorListener.java | 57 ---
.../main/java/brooklyn/test/StatusListener.java | 100 ------
.../test/TestResourceUnavailableException.java | 140 --------
.../java/brooklyn/test/VerboseReporter.java | 343 -------------------
.../brooklyn/test/BrooklynLeakListener.java | 89 +++++
.../brooklyn/test/LoggingVerboseReporter.java | 36 ++
.../test/PlatformTestSelectorListener.java | 57 +++
.../apache/brooklyn/test/StatusListener.java | 100 ++++++
.../test/TestResourceUnavailableException.java | 140 ++++++++
.../apache/brooklyn/test/VerboseReporter.java | 343 +++++++++++++++++++
58 files changed, 812 insertions(+), 811 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/BrooklynVersionTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/BrooklynVersionTest.java b/core/src/test/java/brooklyn/BrooklynVersionTest.java
index ff65215..c03f732 100644
--- a/core/src/test/java/brooklyn/BrooklynVersionTest.java
+++ b/core/src/test/java/brooklyn/BrooklynVersionTest.java
@@ -39,7 +39,7 @@ import brooklyn.catalog.internal.CatalogItemBuilder;
import brooklyn.catalog.internal.CatalogItemDtoAbstract;
import brooklyn.management.internal.LocalManagementContext;
import brooklyn.management.osgi.OsgiTestResources;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.test.entity.LocalManagementContextForTests;
import brooklyn.util.text.Strings;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java b/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
index 2739c79..7c26342 100644
--- a/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
+++ b/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
@@ -21,7 +21,7 @@ package brooklyn.camp.lite;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import io.brooklyn.camp.spi.Assembly;
import io.brooklyn.camp.spi.AssemblyTemplate;
import io.brooklyn.camp.spi.pdp.PdpYamlTest;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java b/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java
index 212212f..659e026 100644
--- a/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java
@@ -44,7 +44,7 @@ import brooklyn.event.basic.Sensors;
import brooklyn.management.ManagementContext;
import brooklyn.management.ha.ManagementNodeState;
import brooklyn.management.internal.LocalManagementContext;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.util.javalang.UrlClassLoader;
import com.google.common.base.Function;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
index 7f0f3c9..8b1ecf9 100644
--- a/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
@@ -31,7 +31,7 @@ import java.util.NoSuchElementException;
import java.util.Set;
import brooklyn.management.osgi.OsgiTestResources;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java b/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java
index 487f323..e2c42d6 100644
--- a/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java
+++ b/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java
@@ -26,7 +26,7 @@ import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarInputStream;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.util.exceptions.Exceptions;
import org.apache.commons.io.FileUtils;
import org.osgi.framework.Bundle;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java b/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
index 6863c4c..11342de 100644
--- a/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
+++ b/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
@@ -50,7 +50,7 @@ import brooklyn.management.classloading.BrooklynClassLoadingContext;
import brooklyn.management.internal.LocalManagementContext;
import brooklyn.management.internal.ManagementContextInternal;
import brooklyn.policy.PolicySpec;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.test.entity.LocalManagementContextForTests;
import brooklyn.test.entity.TestApplication;
import brooklyn.util.guava.Maybe;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/core/src/test/java/brooklyn/test/HttpService.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/test/HttpService.java b/core/src/test/java/brooklyn/test/HttpService.java
index 2dd8849..6b9aa94 100644
--- a/core/src/test/java/brooklyn/test/HttpService.java
+++ b/core/src/test/java/brooklyn/test/HttpService.java
@@ -18,6 +18,7 @@
*/
package brooklyn.test;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import java.io.File;
import java.io.InputStream;
import java.net.InetAddress;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index cb900b8..b5dbbeb 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1411,7 +1411,7 @@
<properties>
<property>
<name>listener</name>
- <value>brooklyn.test.LoggingVerboseReporter,brooklyn.test.BrooklynLeakListener,brooklyn.test.PlatformTestSelectorListener</value>
+ <value>org.apache.brooklyn.test.LoggingVerboseReporter,org.apache.brooklyn.test.BrooklynLeakListener,org.apache.brooklyn.test.PlatformTestSelectorListener</value>
</property>
</properties>
<enableAssertions>true</enableAssertions>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/osgi/src/test/java/brooklyn/entity/osgi/karaf/KarafContainerTest.java
----------------------------------------------------------------------
diff --git a/software/osgi/src/test/java/brooklyn/entity/osgi/karaf/KarafContainerTest.java b/software/osgi/src/test/java/brooklyn/entity/osgi/karaf/KarafContainerTest.java
index f54e5ae..c6c76ba 100644
--- a/software/osgi/src/test/java/brooklyn/entity/osgi/karaf/KarafContainerTest.java
+++ b/software/osgi/src/test/java/brooklyn/entity/osgi/karaf/KarafContainerTest.java
@@ -24,7 +24,7 @@ import static org.testng.Assert.assertNull;
import java.net.URL;
import java.util.Map;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
index 31c3a4b..bf76568 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxClusterIntegrationTest.java
@@ -24,7 +24,7 @@ import static org.testng.Assert.assertTrue;
import java.util.Collections;
import java.util.List;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxHttpsSslIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxHttpsSslIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxHttpsSslIntegrationTest.java
index a8004d7..d7d9f41 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxHttpsSslIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxHttpsSslIntegrationTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertTrue;
import java.io.File;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxIntegrationTest.java
index 74d6dcf..80eaa2d 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxIntegrationTest.java
@@ -27,7 +27,7 @@ import static org.testng.Assert.assertTrue;
import java.util.Map;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindIntegrationTest.java
index 98461f6..dcbf35e 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindIntegrationTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindWithHaIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindWithHaIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindWithHaIntegrationTest.java
index 6a32428..3f4fc78 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindWithHaIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxRebindWithHaIntegrationTest.java
@@ -26,7 +26,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
index 2b0d6a5..f705466 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxUrlMappingIntegrationTest.java
@@ -30,7 +30,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxWebClusterEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxWebClusterEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxWebClusterEc2LiveTest.java
index 2e90749..7a78777 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxWebClusterEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxWebClusterEc2LiveTest.java
@@ -22,7 +22,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java
index 6498c32..9e6e2a8 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java
@@ -66,7 +66,7 @@ import brooklyn.management.SubscriptionHandle;
import brooklyn.test.Asserts;
import brooklyn.test.EntityTestUtils;
import brooklyn.test.HttpTestUtils;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.test.entity.LocalManagementContextForTests;
import brooklyn.test.entity.TestApplication;
import brooklyn.util.collections.MutableMap;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java
index ed9d97b..44212d8 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java
@@ -24,7 +24,7 @@ import static org.testng.Assert.assertNotNull;
import java.util.List;
import java.util.concurrent.Callable;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java
index 1fb0d84..66bacc6 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertEquals;
import java.net.URL;
import java.util.List;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
index 5bfea3e..1c2e7aa 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
@@ -18,7 +18,7 @@
*/
package brooklyn.entity.webapp;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppConcurrentDeployTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppConcurrentDeployTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppConcurrentDeployTest.java
index 72f36a8..18b074e 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppConcurrentDeployTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/WebAppConcurrentDeployTest.java
@@ -40,7 +40,7 @@ import brooklyn.location.basic.LocalhostMachineProvisioningLocation;
import brooklyn.management.Task;
import brooklyn.test.Asserts;
import brooklyn.test.EntityTestUtils;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.util.collections.MutableList;
import brooklyn.util.collections.MutableMap;
import brooklyn.util.http.HttpTool;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/ControlledDynamicWebAppClusterRebindIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/ControlledDynamicWebAppClusterRebindIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/ControlledDynamicWebAppClusterRebindIntegrationTest.java
index ce45794..ed1580f 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/ControlledDynamicWebAppClusterRebindIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/ControlledDynamicWebAppClusterRebindIntegrationTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/DynamicWebAppClusterRebindIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/DynamicWebAppClusterRebindIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/DynamicWebAppClusterRebindIntegrationTest.java
index c1624d9..9634d24 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/DynamicWebAppClusterRebindIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/DynamicWebAppClusterRebindIntegrationTest.java
@@ -30,7 +30,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerAwsEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerAwsEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerAwsEc2LiveTest.java
index fe53ef4..11defe8 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerAwsEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerAwsEc2LiveTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.annotations.Test;
import brooklyn.entity.AbstractEc2LiveTest;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerNonInheritingIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerNonInheritingIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerNonInheritingIntegrationTest.java
index 6c5daeb..911109c 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerNonInheritingIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss6ServerNonInheritingIntegrationTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerAwsEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerAwsEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerAwsEc2LiveTest.java
index 60db294..78f6153 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerAwsEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerAwsEc2LiveTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.annotations.Test;
import brooklyn.entity.AbstractEc2LiveTest;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerDockerLiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerDockerLiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerDockerLiveTest.java
index 69eca5f..a15e35d 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerDockerLiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerDockerLiveTest.java
@@ -23,7 +23,7 @@ import brooklyn.entity.software.AbstractDockerLiveTest;
import brooklyn.location.Location;
import brooklyn.test.Asserts;
import brooklyn.test.HttpTestUtils;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import com.google.common.collect.ImmutableList;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerNonInheritingIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerNonInheritingIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerNonInheritingIntegrationTest.java
index 5f13362..31647e6 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerNonInheritingIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerNonInheritingIntegrationTest.java
@@ -36,7 +36,7 @@ import brooklyn.entity.webapp.HttpsSslConfig;
import brooklyn.location.basic.LocalhostMachineProvisioningLocation;
import brooklyn.test.Asserts;
import brooklyn.test.HttpTestUtils;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.test.entity.TestApplication;
import com.google.common.collect.ImmutableList;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerRebindingIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerRebindingIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerRebindingIntegrationTest.java
index 0828fe3..d580a73 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerRebindingIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/JBoss7ServerRebindingIntegrationTest.java
@@ -25,7 +25,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerGoogleComputeLiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerGoogleComputeLiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerGoogleComputeLiveTest.java
index e067c59..d28b1b7 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerGoogleComputeLiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerGoogleComputeLiveTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.annotations.Test;
import brooklyn.entity.AbstractGoogleComputeLiveTest;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerEc2LiveTest.java
index 568ffeb..ecb7356 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerEc2LiveTest.java
@@ -28,7 +28,7 @@ import brooklyn.entity.webapp.tomcat.Tomcat8Server;
import brooklyn.location.Location;
import brooklyn.test.Asserts;
import brooklyn.test.HttpTestUtils;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import com.google.common.collect.ImmutableList;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerSoftlayerLiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerSoftlayerLiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerSoftlayerLiveTest.java
index 176ef86..7268d10 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerSoftlayerLiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerSoftlayerLiveTest.java
@@ -28,7 +28,7 @@ import brooklyn.entity.webapp.tomcat.Tomcat8Server;
import brooklyn.location.Location;
import brooklyn.test.Asserts;
import brooklyn.test.HttpTestUtils;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import com.google.common.collect.ImmutableList;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerWebAppFixtureIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerWebAppFixtureIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerWebAppFixtureIntegrationTest.java
index e3bd45b..f0d7212 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerWebAppFixtureIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/Tomcat8ServerWebAppFixtureIntegrationTest.java
@@ -41,7 +41,7 @@ import brooklyn.entity.webapp.HttpsSslConfig;
import brooklyn.entity.webapp.JavaWebAppSoftwareProcess;
import brooklyn.entity.webapp.tomcat.Tomcat8Server;
import brooklyn.location.basic.PortRanges;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.test.entity.TestApplication;
import brooklyn.util.exceptions.Exceptions;
import brooklyn.util.repeat.Repeater;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java
index e0775b7..5282e3a 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerEc2LiveTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.annotations.Test;
import brooklyn.entity.AbstractEc2LiveTest;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java
index 7772a39..13db672 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerSoftlayerLiveTest.java
@@ -23,7 +23,7 @@ import static org.testng.Assert.assertNotNull;
import java.net.URL;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.annotations.Test;
import brooklyn.entity.AbstractSoftlayerLiveTest;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java
index 49328bc..b25bc58 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/tomcat/TomcatServerWebAppFixtureIntegrationTest.java
@@ -27,7 +27,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/ReferencedYamlTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/ReferencedYamlTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/ReferencedYamlTest.java
index 683bdc3..6c10779 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/ReferencedYamlTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/ReferencedYamlTest.java
@@ -20,7 +20,7 @@ package io.brooklyn.camp.brooklyn;
import java.util.Collection;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.testng.Assert;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
index 4de4cf1..3110f43 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/AbstractCatalogXmlTest.java
@@ -18,7 +18,7 @@
*/
package io.brooklyn.camp.brooklyn.catalog;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import io.brooklyn.camp.brooklyn.AbstractYamlTest;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java
index 412de82..5c4fe72 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityTest.java
@@ -38,7 +38,7 @@ import brooklyn.location.LocationSpec;
import brooklyn.management.osgi.OsgiVersionMoreEntityTest;
import brooklyn.policy.Policy;
import brooklyn.policy.PolicySpec;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.util.ResourceUtils;
import brooklyn.util.text.Strings;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
index 1639588..7dba80d 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
@@ -37,7 +37,7 @@ import brooklyn.entity.Entity;
import brooklyn.entity.basic.BasicEntity;
import brooklyn.management.osgi.OsgiStandaloneTest;
import brooklyn.management.osgi.OsgiTestResources;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.test.entity.TestEntity;
import brooklyn.test.entity.TestEntityImpl;
import brooklyn.util.ResourceUtils;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
index bfc8a9a..4ac6369 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlLocationTest.java
@@ -38,7 +38,7 @@ import brooklyn.location.LocationDefinition;
import brooklyn.location.LocationSpec;
import brooklyn.location.basic.LocalhostMachineProvisioningLocation;
import brooklyn.management.osgi.OsgiStandaloneTest;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import brooklyn.util.text.StringFunctions;
import com.google.common.collect.ImmutableList;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
index f007bae..c987d45 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java
@@ -29,7 +29,7 @@ import brooklyn.entity.Entity;
import brooklyn.event.basic.BasicConfigKey;
import brooklyn.management.osgi.OsgiStandaloneTest;
import brooklyn.policy.Policy;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import com.google.common.collect.Iterables;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
index d5a5b9c..78f657d 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
@@ -30,7 +30,7 @@ import brooklyn.catalog.CatalogItem;
import brooklyn.catalog.CatalogItem.CatalogItemType;
import brooklyn.management.osgi.OsgiStandaloneTest;
import brooklyn.management.osgi.OsgiTestResources;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
public class CatalogYamlTemplateTest extends AbstractYamlTest {
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/downstream-parent/pom.xml
----------------------------------------------------------------------
diff --git a/usage/downstream-parent/pom.xml b/usage/downstream-parent/pom.xml
index 5e403ee..7c3d740 100644
--- a/usage/downstream-parent/pom.xml
+++ b/usage/downstream-parent/pom.xml
@@ -99,7 +99,7 @@
<scope>test</scope>
</dependency>
<dependency>
- <!-- includes brooklyn.test.LoggingVerboseReporter -->
+ <!-- includes org.apache.brooklyn.test.LoggingVerboseReporter -->
<groupId>org.apache.brooklyn</groupId>
<artifactId>brooklyn-utils-test-support</artifactId>
<version>${brooklyn.version}</version>
@@ -327,7 +327,7 @@
<properties>
<property>
<name>listener</name>
- <value>brooklyn.test.LoggingVerboseReporter</value>
+ <value>org.apache.brooklyn.test.LoggingVerboseReporter</value>
</property>
</properties>
<enableAssertions>true</enableAssertions>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java b/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java
index cc2af2b..c89b399 100644
--- a/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java
+++ b/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java
@@ -24,7 +24,7 @@ import static org.testng.Assert.fail;
import java.util.List;
import java.util.Map;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterMethod;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java b/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
index 2255d7d..0ccd042 100644
--- a/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
+++ b/usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java
@@ -51,7 +51,7 @@ import brooklyn.rest.domain.CatalogItemSummary;
import brooklyn.rest.domain.CatalogLocationSummary;
import brooklyn.rest.domain.CatalogPolicySummary;
import brooklyn.rest.testing.BrooklynRestResourceTest;
-import brooklyn.test.TestResourceUnavailableException;
+import org.apache.brooklyn.test.TestResourceUnavailableException;
import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/brooklyn/test/BrooklynLeakListener.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/brooklyn/test/BrooklynLeakListener.java b/utils/test-support/src/main/java/brooklyn/test/BrooklynLeakListener.java
deleted file mode 100644
index c43c31b..0000000
--- a/utils/test-support/src/main/java/brooklyn/test/BrooklynLeakListener.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.test;
-
-import java.util.Arrays;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.ITestContext;
-import org.testng.TestListenerAdapter;
-
-public class BrooklynLeakListener extends TestListenerAdapter {
-
- private static final Logger TEST_RESOURCE_LOG = LoggerFactory.getLogger("test.resource.usage");
-
- @Override
- public void onStart(ITestContext testContext) {
- super.onStart(testContext);
- tryTerminateAll("BrooklynLeakListener.onStart", testContext);
- }
-
- @Override
- public void onFinish(ITestContext testContext) {
- super.onFinish(testContext);
- tryTerminateAll("BrooklynLeakListener.onFinish", testContext);
- }
-
- /**
- * Tries to reflectively invoke {@code LocalManagementContext.logAll(TEST_RESOURCE_LOG); LocalManagementContext.terminateAll()}.
- *
- * It does this reflectively because the listener is executed for all projects, included those that don't
- * depend on brooklyn-core, so LocalManagementContext may not be on the classpath.
- */
- private void tryTerminateAll(String context, ITestContext testContext) {
- String clazzName = "brooklyn.management.internal.LocalManagementContext";
- String message;
- int level;
- try {
- Class<?> clazz = BrooklynLeakListener.class.getClassLoader().loadClass(clazzName);
- clazz.getMethod("logAll", new Class[] {Logger.class}).invoke(null, TEST_RESOURCE_LOG);
- Integer count = (Integer)clazz.getMethod("terminateAll").invoke(null);
- if (count>0) {
- level = 0;
- message = ""+count+" ManagementContexts terminated";
- } else if (count<0) {
- level = 1;
- message = ""+(-count)+" ManagementContexts left dangling";
- } else {
- level = -1;
- message = ""+count+" ManagementContexts terminated";
- }
- } catch (ClassNotFoundException e) {
- TEST_RESOURCE_LOG.debug("Class {} not found in testng listener, so not attempting to terminate all extant ManagementContexts; continuing", clazzName);
- level = 0;
- message = "no "+clazzName+" available, so skipped";
- } catch (Throwable e) {
- TEST_RESOURCE_LOG.error("ERROR in testng listener, attempting to terminate all extant ManagementContexts", e);
- level = 1;
- message = "ERROR: "+e;
- }
-
- String logMessage = context+" attempting to terminate all extant ManagementContexts: "
- + "name=" + testContext.getName()
- + "; includedGroups="+Arrays.toString(testContext.getIncludedGroups())
- + "; excludedGroups="+Arrays.toString(testContext.getExcludedGroups())
- + "; suiteName="+testContext.getSuite().getName()
- + "; outDir="+testContext.getOutputDirectory()
- + ": "+message;
- if (level<0) TEST_RESOURCE_LOG.debug(logMessage);
- else if (level>0) TEST_RESOURCE_LOG.warn(logMessage);
- else TEST_RESOURCE_LOG.info(logMessage);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/brooklyn/test/LoggingVerboseReporter.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/brooklyn/test/LoggingVerboseReporter.java b/utils/test-support/src/main/java/brooklyn/test/LoggingVerboseReporter.java
deleted file mode 100644
index b39e2bc..0000000
--- a/utils/test-support/src/main/java/brooklyn/test/LoggingVerboseReporter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.test;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LoggingVerboseReporter extends VerboseReporter {
-
- private static final Logger log = LoggerFactory.getLogger(LoggingVerboseReporter.class);
-
- public LoggingVerboseReporter() { super(); }
- public LoggingVerboseReporter(String prefix) { super(prefix); }
-
- @Override
- protected void log(String message) {
- log.info("TESTNG "+message);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/brooklyn/test/PlatformTestSelectorListener.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/brooklyn/test/PlatformTestSelectorListener.java b/utils/test-support/src/main/java/brooklyn/test/PlatformTestSelectorListener.java
deleted file mode 100644
index 3cc610d..0000000
--- a/utils/test-support/src/main/java/brooklyn/test/PlatformTestSelectorListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.test;
-
-import org.testng.IInvokedMethod;
-import org.testng.IInvokedMethodListener;
-import org.testng.ITestResult;
-import org.testng.SkipException;
-
-public class PlatformTestSelectorListener implements IInvokedMethodListener {
- private static final String GROUP_UNIX = "UNIX";
- private static final String GROUP_WINDOWS = "Windows";
-
- public static boolean isWindows() {
- return System.getProperty("os.name").startsWith("Windows");
- }
-
- @Override
- public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
- boolean isUnixTest = false;
- boolean isWinTest = false;
-
- String[] groups = method.getTestMethod().getGroups();
- for (String group : groups) {
- isUnixTest = isUnixTest || group.equalsIgnoreCase(GROUP_UNIX);
- isWinTest = isWinTest || group.equalsIgnoreCase(GROUP_WINDOWS);
- }
-
- boolean isWinPlatform = isWindows();
- if (isUnixTest || isWinTest) {
- if (isWinPlatform && isUnixTest && !isWinTest) {
- throw new SkipException("Skipping unix-specific test.");
- } else if (!isWinPlatform && isWinTest && !isUnixTest) {
- throw new SkipException("Skipping windows-specific test.");
- }
- }
- }
-
- @Override
- public void afterInvocation(IInvokedMethod method, ITestResult testResult) {}
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/brooklyn/test/StatusListener.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/brooklyn/test/StatusListener.java b/utils/test-support/src/main/java/brooklyn/test/StatusListener.java
deleted file mode 100644
index ec044e9..0000000
--- a/utils/test-support/src/main/java/brooklyn/test/StatusListener.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.test;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.IClass;
-import org.testng.ITestContext;
-import org.testng.ITestListener;
-import org.testng.ITestResult;
-
-/**
- * adapted from the following class:
- *
- * @see org.jclouds.test.testng.UnitTestStatusListener
- *
- * normally not used, preferring instead LoggingVerboseReporter which prints out config info
- */
-public class StatusListener implements ITestListener {
-
- public static final Logger log = LoggerFactory.getLogger(StatusListener.class);
-
- /**
- * Holds test classes actually running in all threads.
- */
- private ThreadLocal<IClass> threadTestClass = new ThreadLocal<IClass>();
- private ThreadLocal<Long> threadTestStart = new ThreadLocal<Long>();
-
- private AtomicInteger failed = new AtomicInteger(0);
- private AtomicInteger succeded = new AtomicInteger(0);
- private AtomicInteger skipped = new AtomicInteger(0);
-
- //TODO instead of system.out.println we should log -- *and* perhaps write to sysout if logger doesn't?
- protected static void log(String msg) {
- log.info(msg);
- }
-
- public void onTestStart(ITestResult res) {
- log("Starting test " + getTestDesc(res));
- threadTestClass.set(res.getTestClass());
- threadTestStart.set(System.currentTimeMillis());
- }
-
- synchronized public void onTestSuccess(ITestResult arg0) {
- log(getThreadId() + " Test " + getTestDesc(arg0) + " succeeded: " + (System.currentTimeMillis() - threadTestStart.get()) + "ms");
- succeded.incrementAndGet();
- printStatus();
- }
-
- synchronized public void onTestFailure(ITestResult arg0) {
- log(getThreadId() + " Test " + getTestDesc(arg0) + " failed: "+arg0.getThrowable());
- failed.incrementAndGet();
- printStatus();
- }
-
- synchronized public void onTestSkipped(ITestResult arg0) {
- System.out.println(getThreadId() + " Test " + getTestDesc(arg0) + " skipped.");
- skipped.incrementAndGet();
- printStatus();
- }
-
- public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {
- }
-
- public void onStart(ITestContext arg0) {
- }
-
- public void onFinish(ITestContext arg0) {
- }
-
- private String getThreadId() {
- return "[" + Thread.currentThread().getName() + "]";
- }
-
- private String getTestDesc(ITestResult res) {
- return res.getMethod().getMethodName() + "(" + res.getTestClass().getName() + ")";
- }
-
- private void printStatus() {
- log("Test suite progress: tests succeeded: " + succeded.get() + ", failed: " + failed.get() + ", skipped: " + skipped.get() + ".");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/brooklyn/test/TestResourceUnavailableException.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/brooklyn/test/TestResourceUnavailableException.java b/utils/test-support/src/main/java/brooklyn/test/TestResourceUnavailableException.java
deleted file mode 100644
index 0738184..0000000
--- a/utils/test-support/src/main/java/brooklyn/test/TestResourceUnavailableException.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.test;
-
-import com.google.common.base.Throwables;
-import org.testng.SkipException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Indicates that a test cannot be run as a necessary resource is not available.
- *
- * <p>This exception should be used by tests that need a particular test resource (i.e., a file that is conventionally
- * in the <code>src/test/resources</code> folder, and that available as a classpath resource at runtime) is not
- * available. It will cause TestNG to mark the test as "skipped" with a suitable message.</p>
- *
- * <p>Some tests require binary files (such as OSGi bundles) which under Apache conventions are not able to be
- * distributed in our source code release. This exception allows such tests to become "optional" so that they do not
- * cause test failures when running the tests on a source distribution.</p>
- *
- * <p>Note that the single-string constructors expect the string to be the simple name of the classpath resource that
- * is not available. The exception message is then derived from this. The two-string constructors take both the
- * resource name and an explicit exception message.</p>
- */
-@SuppressWarnings("UnusedDeclaration")
-public class TestResourceUnavailableException extends SkipException {
-
- private final String resourceName;
-
- /**
- * Asserts that a resource is available on the classpath; otherwise, throws {@link TestResourceUnavailableException}
- *
- * Note that this will use the same classloader that was used to load this class.
- *
- * @param resourceName the classpath resource name, e.g.
- * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
- */
- public static void throwIfResourceUnavailable(Class<?> relativeToClass, String resourceName) {
- checkNotNull(relativeToClass, relativeToClass);
- checkNotNull(resourceName, "resourceName");
- checkArgument(!resourceName.isEmpty(), "resourceName must not be empty");
- InputStream resource = relativeToClass.getResourceAsStream(resourceName);
- if (resource == null)
- throw new TestResourceUnavailableException(resourceName);
-
- // just make sure we clean up the resource
- try {
- resource.close();
- } catch (IOException e) {
- Throwables.propagate(e);
- }
- }
-
- /**
- * Instantiate an exception, giving the name of the unavailable resource.
- *
- * @param resourceName the name of the resource on the classpath, e.g.
- * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
- */
- public TestResourceUnavailableException(String resourceName) {
- super(messageFromResourceName(resourceName));
- this.resourceName = resourceName;
- }
-
- /**
- * Instantiate an exception, giving the name of the unavailable resource.
- *
- * @param resourceName the name of the resource on the classpath, e.g.
- * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
- * @param cause the underlying exception that caused this one
- */
- public TestResourceUnavailableException(String resourceName, Throwable cause) {
- super(messageFromResourceName(resourceName), cause);
- this.resourceName = resourceName;
- }
-
- /**
- * Instantiate an exception, giving the name of the unavailable resource.
- *
- * @param resourceName the name of the resource on the classpath, e.g.
- * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
- * @param skipMessage the message associated with the exception
- */
- public TestResourceUnavailableException(String resourceName, String skipMessage) {
- super(skipMessage);
- this.resourceName = resourceName;
- }
-
- /**
- * Instantiate an exception, giving the name of the unavailable resource.
- *
- * @param resourceName the name of the resource on the classpath, e.g.
- * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
- * @param skipMessage the message associated with the exception
- * @param cause the underlying exception that caused this one
- */
- public TestResourceUnavailableException(String resourceName, String skipMessage, Throwable cause) {
- super(skipMessage, cause);
- this.resourceName = resourceName;
- }
-
- private static String messageFromResourceName(String resourceName) {
- return String.format("Test resource '%s' not found; test skipped.", resourceName);
- }
-
- /**
- * Get the name of the classpath resource that could not be loaded.
- *
- * @return the name of the classpath resource whose absence caused this exception.
- */
- public String getResourceName() {
- return resourceName;
- }
-
- @Override
- public boolean isSkip() {
- return true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/brooklyn/test/VerboseReporter.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/brooklyn/test/VerboseReporter.java b/utils/test-support/src/main/java/brooklyn/test/VerboseReporter.java
deleted file mode 100644
index d0ea8c1..0000000
--- a/utils/test-support/src/main/java/brooklyn/test/VerboseReporter.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package brooklyn.test;
-
-import java.util.List;
-
-import org.testng.ITestContext;
-import org.testng.ITestNGMethod;
-import org.testng.ITestResult;
-import org.testng.TestListenerAdapter;
-import org.testng.internal.ConstructorOrMethod;
-import org.testng.internal.Utils;
-
-/**
- * Reporter printing out detailed messages about what TestNG
- * is going to run and what is the status of what has been just run.
- *
- * To see messages from this reporter, either run Ant in verbose mode ('ant -v')
- * or set verbose level to 5 or higher
- *
- * @author Lukas Jungmann
- * @since 6.4
- *
- * THIS IS AN EXACT COPY OF THE CLASS IN org.testng.reporters
- * EXCEPT FOR THIS COMMENT AND log(String) CHANGED TO BE PROTECTED
- */
-public class VerboseReporter extends TestListenerAdapter {
-
- /**
- * Default prefix for messages printed out by this reporter
- *
- */
- public static final String LISTENER_PREFIX = "[VerboseTestNG] ";
- private String suiteName;
- private final String prefix;
-
- private enum Status {
-
- SUCCESS(ITestResult.SUCCESS), FAILURE(ITestResult.FAILURE), SKIP(ITestResult.SKIP),
- SUCCESS_PERCENTAGE_FAILURE(ITestResult.SUCCESS_PERCENTAGE_FAILURE), STARTED(ITestResult.STARTED);
- private final int code;
-
- private Status(int i) {
- code = i;
- }
-
- @SuppressWarnings("unused")
- public int getCode() {
- return code;
- }
- }
-
- /**
- * Default constructor
- */
- public VerboseReporter() {
- this(LISTENER_PREFIX);
- }
-
- /**
- * Create VerboseReporter with custom prefix
- *
- * @param prefix prefix for messages printed out by this reporter
- */
- public VerboseReporter(String prefix) {
- this.prefix = prefix;
- }
-
- @Override
- public void beforeConfiguration(ITestResult tr) {
- super.beforeConfiguration(tr);
- logTestResult(Status.STARTED, tr, true);
- }
-
- @Override
- public void onConfigurationFailure(ITestResult tr) {
- super.onConfigurationFailure(tr);
- logTestResult(Status.FAILURE, tr, true);
- }
-
- @Override
- public void onConfigurationSkip(ITestResult tr) {
- super.onConfigurationSkip(tr);
- logTestResult(Status.SKIP, tr, true);
- }
-
- @Override
- public void onConfigurationSuccess(ITestResult tr) {
- super.onConfigurationSuccess(tr);
- logTestResult(Status.SUCCESS, tr, true);
- }
-
- @Override
- public void onTestStart(ITestResult tr) {
- logTestResult(Status.STARTED, tr, false);
- }
-
- @Override
- public void onTestFailure(ITestResult tr) {
- super.onTestFailure(tr);
- logTestResult(Status.FAILURE, tr, false);
- }
-
- @Override
- public void onTestFailedButWithinSuccessPercentage(ITestResult tr) {
- super.onTestFailedButWithinSuccessPercentage(tr);
- logTestResult(Status.SUCCESS_PERCENTAGE_FAILURE, tr, false);
- }
-
- @Override
- public void onTestSkipped(ITestResult tr) {
- super.onTestSkipped(tr);
- logTestResult(Status.SKIP, tr, false);
- }
-
- @Override
- public void onTestSuccess(ITestResult tr) {
- super.onTestSuccess(tr);
- logTestResult(Status.SUCCESS, tr, false);
- }
-
- @Override
- public void onStart(ITestContext ctx) {
- suiteName = ctx.getName();//ctx.getSuite().getXmlSuite().getFileName();
- log("RUNNING: Suite: \"" + suiteName + "\" containing \"" + ctx.getAllTestMethods().length + "\" Tests (config: " + ctx.getSuite().getXmlSuite().getFileName() + ")");
- }
-
- @Override
- public void onFinish(ITestContext context) {
- logResults();
- suiteName = null;
- }
-
- private ITestNGMethod[] resultsToMethods(List<ITestResult> results) {
- ITestNGMethod[] result = new ITestNGMethod[results.size()];
- int i = 0;
- for (ITestResult tr : results) {
- result[i++] = tr.getMethod();
- }
- return result;
- }
-
- /**
- * Print out test summary
- */
- private void logResults() {
- //
- // Log test summary
- //
- ITestNGMethod[] ft = resultsToMethods(getFailedTests());
- StringBuilder sb = new StringBuilder("\n===============================================\n");
- sb.append(" ").append(suiteName).append("\n");
- sb.append(" Tests run: ").append(Utils.calculateInvokedMethodCount(getAllTestMethods()));
- sb.append(", Failures: ").append(Utils.calculateInvokedMethodCount(ft));
- sb.append(", Skips: ").append(Utils.calculateInvokedMethodCount(resultsToMethods(getSkippedTests())));
- int confFailures = getConfigurationFailures().size();
- int confSkips = getConfigurationSkips().size();
- if (confFailures > 0 || confSkips > 0) {
- sb.append("\n").append(" Configuration Failures: ").append(confFailures);
- sb.append(", Skips: ").append(confSkips);
- }
- sb.append("\n===============================================");
- log(sb.toString());
- }
-
- /**
- * Log meaningful message for passed in arguments.
- * Message itself is of form:
- * $status: "$suiteName" - $methodDeclaration ($actualArguments) finished in $x ms ($run of $totalRuns)
- *
- * @param st status of passed in itr
- * @param itr test result to be described
- * @param isConfMethod is itr describing configuration method
- */
- private void logTestResult(Status st, ITestResult itr, boolean isConfMethod) {
- StringBuilder sb = new StringBuilder();
- String stackTrace = "";
- switch (st) {
- case STARTED:
- sb.append("INVOKING");
- break;
- case SKIP:
- sb.append("SKIPPED");
- stackTrace = itr.getThrowable() != null
- ? Utils.stackTrace(itr.getThrowable(), false)[0] : "";
- break;
- case FAILURE:
- sb.append("FAILED");
- stackTrace = itr.getThrowable() != null
- ? Utils.stackTrace(itr.getThrowable(), false)[0] : "";
- break;
- case SUCCESS:
- sb.append("PASSED");
- break;
- case SUCCESS_PERCENTAGE_FAILURE:
- sb.append("PASSED with failures");
- break;
- default:
- //not happen
- throw new RuntimeException("Unsupported test status:" + itr.getStatus());
- }
- if (isConfMethod) {
- sb.append(" CONFIGURATION: ");
- } else {
- sb.append(": ");
- }
- ITestNGMethod tm = itr.getMethod();
- int identLevel = sb.length();
- sb.append(getMethodDeclaration(tm));
- Object[] params = itr.getParameters();
- Class<?>[] paramTypes = tm.getConstructorOrMethod().getParameterTypes();
- if (null != params && params.length > 0) {
- // The error might be a data provider parameter mismatch, so make
- // a special case here
- if (params.length != paramTypes.length) {
- sb.append("Wrong number of arguments were passed by the Data Provider: found ");
- sb.append(params.length);
- sb.append(" but expected ");
- sb.append(paramTypes.length);
- } else {
- sb.append("(value(s): ");
- for (int i = 0; i < params.length; i++) {
- if (i > 0) {
- sb.append(", ");
- }
- sb.append(Utils.toString(params[i], paramTypes[i]));
- }
- sb.append(")");
-
- }
- }
- if (Status.STARTED != st) {
- sb.append(" finished in ");
- sb.append(itr.getEndMillis() - itr.getStartMillis());
- sb.append(" ms");
- if (!Utils.isStringEmpty(tm.getDescription())) {
- sb.append("\n");
- for (int i = 0; i < identLevel; i++) {
- sb.append(" ");
- }
- sb.append(tm.getDescription());
- }
- if (tm.getInvocationCount() > 1) {
- sb.append(" (");
- sb.append(tm.getCurrentInvocationCount());
- sb.append(" of ");
- sb.append(tm.getInvocationCount());
- sb.append(")");
- }
- if (!Utils.isStringEmpty(stackTrace)) {
- sb.append("\n").append(stackTrace.substring(0, stackTrace.lastIndexOf(System.getProperty("line.separator"))));
- }
- } else {
- if (!isConfMethod && tm.getInvocationCount() > 1) {
- sb.append(" success: ");
- sb.append(tm.getSuccessPercentage());
- sb.append("%");
- }
- }
- log(sb.toString());
- }
-
- protected void log(String message) {
- //prefix all output lines
- System.out.println(message.replaceAll("(?m)^", prefix));
- }
-
- /**
- *
- * @param method method to be described
- * @return FQN of a class + method declaration for a method passed in
- * ie. test.triangle.CheckCount.testCheckCount(java.lang.String)
- */
- private String getMethodDeclaration(ITestNGMethod method) {
- //see Utils.detailedMethodName
- //perhaps should rather adopt the original method instead
- ConstructorOrMethod m = method.getConstructorOrMethod();
- StringBuilder buf = new StringBuilder();
- buf.append("\"");
- if (suiteName != null) {
- buf.append(suiteName);
- } else {
- buf.append("UNKNOWN");
- }
- buf.append("\"");
- buf.append(" - ");
- if (method.isBeforeSuiteConfiguration()) {
- buf.append("@BeforeSuite ");
- } else if (method.isBeforeTestConfiguration()) {
- buf.append("@BeforeTest ");
- } else if (method.isBeforeClassConfiguration()) {
- buf.append("@BeforeClass ");
- } else if (method.isBeforeGroupsConfiguration()) {
- buf.append("@BeforeGroups ");
- } else if (method.isBeforeMethodConfiguration()) {
- buf.append("@BeforeMethod ");
- } else if (method.isAfterMethodConfiguration()) {
- buf.append("@AfterMethod ");
- } else if (method.isAfterGroupsConfiguration()) {
- buf.append("@AfterGroups ");
- } else if (method.isAfterClassConfiguration()) {
- buf.append("@AfterClass ");
- } else if (method.isAfterTestConfiguration()) {
- buf.append("@AfterTest ");
- } else if (method.isAfterSuiteConfiguration()) {
- buf.append("@AfterSuite ");
- }
- buf.append(m.getDeclaringClass().getName());
- buf.append(".");
- buf.append(m.getName());
- buf.append("(");
- int i = 0;
- for (Class<?> p : m.getParameterTypes()) {
- if (i++ > 0) {
- buf.append(", ");
- }
- buf.append(p.getName());
- }
- buf.append(")");
- return buf.toString();
- }
-
- @Override
- public String toString() {
- return "VerboseReporter{" + "suiteName=" + suiteName + '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/org/apache/brooklyn/test/BrooklynLeakListener.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/org/apache/brooklyn/test/BrooklynLeakListener.java b/utils/test-support/src/main/java/org/apache/brooklyn/test/BrooklynLeakListener.java
new file mode 100644
index 0000000..7064153
--- /dev/null
+++ b/utils/test-support/src/main/java/org/apache/brooklyn/test/BrooklynLeakListener.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.test;
+
+import java.util.Arrays;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.ITestContext;
+import org.testng.TestListenerAdapter;
+
+public class BrooklynLeakListener extends TestListenerAdapter {
+
+ private static final Logger TEST_RESOURCE_LOG = LoggerFactory.getLogger("test.resource.usage");
+
+ @Override
+ public void onStart(ITestContext testContext) {
+ super.onStart(testContext);
+ tryTerminateAll("BrooklynLeakListener.onStart", testContext);
+ }
+
+ @Override
+ public void onFinish(ITestContext testContext) {
+ super.onFinish(testContext);
+ tryTerminateAll("BrooklynLeakListener.onFinish", testContext);
+ }
+
+ /**
+ * Tries to reflectively invoke {@code LocalManagementContext.logAll(TEST_RESOURCE_LOG); LocalManagementContext.terminateAll()}.
+ *
+ * It does this reflectively because the listener is executed for all projects, included those that don't
+ * depend on brooklyn-core, so LocalManagementContext may not be on the classpath.
+ */
+ private void tryTerminateAll(String context, ITestContext testContext) {
+ String clazzName = "brooklyn.management.internal.LocalManagementContext";
+ String message;
+ int level;
+ try {
+ Class<?> clazz = BrooklynLeakListener.class.getClassLoader().loadClass(clazzName);
+ clazz.getMethod("logAll", new Class[] {Logger.class}).invoke(null, TEST_RESOURCE_LOG);
+ Integer count = (Integer)clazz.getMethod("terminateAll").invoke(null);
+ if (count>0) {
+ level = 0;
+ message = ""+count+" ManagementContexts terminated";
+ } else if (count<0) {
+ level = 1;
+ message = ""+(-count)+" ManagementContexts left dangling";
+ } else {
+ level = -1;
+ message = ""+count+" ManagementContexts terminated";
+ }
+ } catch (ClassNotFoundException e) {
+ TEST_RESOURCE_LOG.debug("Class {} not found in testng listener, so not attempting to terminate all extant ManagementContexts; continuing", clazzName);
+ level = 0;
+ message = "no "+clazzName+" available, so skipped";
+ } catch (Throwable e) {
+ TEST_RESOURCE_LOG.error("ERROR in testng listener, attempting to terminate all extant ManagementContexts", e);
+ level = 1;
+ message = "ERROR: "+e;
+ }
+
+ String logMessage = context+" attempting to terminate all extant ManagementContexts: "
+ + "name=" + testContext.getName()
+ + "; includedGroups="+Arrays.toString(testContext.getIncludedGroups())
+ + "; excludedGroups="+Arrays.toString(testContext.getExcludedGroups())
+ + "; suiteName="+testContext.getSuite().getName()
+ + "; outDir="+testContext.getOutputDirectory()
+ + ": "+message;
+ if (level<0) TEST_RESOURCE_LOG.debug(logMessage);
+ else if (level>0) TEST_RESOURCE_LOG.warn(logMessage);
+ else TEST_RESOURCE_LOG.info(logMessage);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/org/apache/brooklyn/test/LoggingVerboseReporter.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/org/apache/brooklyn/test/LoggingVerboseReporter.java b/utils/test-support/src/main/java/org/apache/brooklyn/test/LoggingVerboseReporter.java
new file mode 100644
index 0000000..a5a5a5c
--- /dev/null
+++ b/utils/test-support/src/main/java/org/apache/brooklyn/test/LoggingVerboseReporter.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LoggingVerboseReporter extends VerboseReporter {
+
+ private static final Logger log = LoggerFactory.getLogger(LoggingVerboseReporter.class);
+
+ public LoggingVerboseReporter() { super(); }
+ public LoggingVerboseReporter(String prefix) { super(prefix); }
+
+ @Override
+ protected void log(String message) {
+ log.info("TESTNG "+message);
+ }
+
+}
[2/4] incubator-brooklyn git commit: brooklyn-utils-test-support: add
org.apache package prefix
Posted by ha...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/org/apache/brooklyn/test/PlatformTestSelectorListener.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/org/apache/brooklyn/test/PlatformTestSelectorListener.java b/utils/test-support/src/main/java/org/apache/brooklyn/test/PlatformTestSelectorListener.java
new file mode 100644
index 0000000..0282eee
--- /dev/null
+++ b/utils/test-support/src/main/java/org/apache/brooklyn/test/PlatformTestSelectorListener.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.test;
+
+import org.testng.IInvokedMethod;
+import org.testng.IInvokedMethodListener;
+import org.testng.ITestResult;
+import org.testng.SkipException;
+
+public class PlatformTestSelectorListener implements IInvokedMethodListener {
+ private static final String GROUP_UNIX = "UNIX";
+ private static final String GROUP_WINDOWS = "Windows";
+
+ public static boolean isWindows() {
+ return System.getProperty("os.name").startsWith("Windows");
+ }
+
+ @Override
+ public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
+ boolean isUnixTest = false;
+ boolean isWinTest = false;
+
+ String[] groups = method.getTestMethod().getGroups();
+ for (String group : groups) {
+ isUnixTest = isUnixTest || group.equalsIgnoreCase(GROUP_UNIX);
+ isWinTest = isWinTest || group.equalsIgnoreCase(GROUP_WINDOWS);
+ }
+
+ boolean isWinPlatform = isWindows();
+ if (isUnixTest || isWinTest) {
+ if (isWinPlatform && isUnixTest && !isWinTest) {
+ throw new SkipException("Skipping unix-specific test.");
+ } else if (!isWinPlatform && isWinTest && !isUnixTest) {
+ throw new SkipException("Skipping windows-specific test.");
+ }
+ }
+ }
+
+ @Override
+ public void afterInvocation(IInvokedMethod method, ITestResult testResult) {}
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/org/apache/brooklyn/test/StatusListener.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/org/apache/brooklyn/test/StatusListener.java b/utils/test-support/src/main/java/org/apache/brooklyn/test/StatusListener.java
new file mode 100644
index 0000000..1803967
--- /dev/null
+++ b/utils/test-support/src/main/java/org/apache/brooklyn/test/StatusListener.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.test;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.IClass;
+import org.testng.ITestContext;
+import org.testng.ITestListener;
+import org.testng.ITestResult;
+
+/**
+ * adapted from the following class:
+ *
+ * @see org.jclouds.test.testng.UnitTestStatusListener
+ *
+ * normally not used, preferring instead LoggingVerboseReporter which prints out config info
+ */
+public class StatusListener implements ITestListener {
+
+ public static final Logger log = LoggerFactory.getLogger(StatusListener.class);
+
+ /**
+ * Holds test classes actually running in all threads.
+ */
+ private ThreadLocal<IClass> threadTestClass = new ThreadLocal<IClass>();
+ private ThreadLocal<Long> threadTestStart = new ThreadLocal<Long>();
+
+ private AtomicInteger failed = new AtomicInteger(0);
+ private AtomicInteger succeded = new AtomicInteger(0);
+ private AtomicInteger skipped = new AtomicInteger(0);
+
+ //TODO instead of system.out.println we should log -- *and* perhaps write to sysout if logger doesn't?
+ protected static void log(String msg) {
+ log.info(msg);
+ }
+
+ public void onTestStart(ITestResult res) {
+ log("Starting test " + getTestDesc(res));
+ threadTestClass.set(res.getTestClass());
+ threadTestStart.set(System.currentTimeMillis());
+ }
+
+ synchronized public void onTestSuccess(ITestResult arg0) {
+ log(getThreadId() + " Test " + getTestDesc(arg0) + " succeeded: " + (System.currentTimeMillis() - threadTestStart.get()) + "ms");
+ succeded.incrementAndGet();
+ printStatus();
+ }
+
+ synchronized public void onTestFailure(ITestResult arg0) {
+ log(getThreadId() + " Test " + getTestDesc(arg0) + " failed: "+arg0.getThrowable());
+ failed.incrementAndGet();
+ printStatus();
+ }
+
+ synchronized public void onTestSkipped(ITestResult arg0) {
+ System.out.println(getThreadId() + " Test " + getTestDesc(arg0) + " skipped.");
+ skipped.incrementAndGet();
+ printStatus();
+ }
+
+ public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {
+ }
+
+ public void onStart(ITestContext arg0) {
+ }
+
+ public void onFinish(ITestContext arg0) {
+ }
+
+ private String getThreadId() {
+ return "[" + Thread.currentThread().getName() + "]";
+ }
+
+ private String getTestDesc(ITestResult res) {
+ return res.getMethod().getMethodName() + "(" + res.getTestClass().getName() + ")";
+ }
+
+ private void printStatus() {
+ log("Test suite progress: tests succeeded: " + succeded.get() + ", failed: " + failed.get() + ", skipped: " + skipped.get() + ".");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/org/apache/brooklyn/test/TestResourceUnavailableException.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/org/apache/brooklyn/test/TestResourceUnavailableException.java b/utils/test-support/src/main/java/org/apache/brooklyn/test/TestResourceUnavailableException.java
new file mode 100644
index 0000000..c49a248
--- /dev/null
+++ b/utils/test-support/src/main/java/org/apache/brooklyn/test/TestResourceUnavailableException.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.test;
+
+import com.google.common.base.Throwables;
+import org.testng.SkipException;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Indicates that a test cannot be run as a necessary resource is not available.
+ *
+ * <p>This exception should be used by tests that need a particular test resource (i.e., a file that is conventionally
+ * in the <code>src/test/resources</code> folder, and that available as a classpath resource at runtime) is not
+ * available. It will cause TestNG to mark the test as "skipped" with a suitable message.</p>
+ *
+ * <p>Some tests require binary files (such as OSGi bundles) which under Apache conventions are not able to be
+ * distributed in our source code release. This exception allows such tests to become "optional" so that they do not
+ * cause test failures when running the tests on a source distribution.</p>
+ *
+ * <p>Note that the single-string constructors expect the string to be the simple name of the classpath resource that
+ * is not available. The exception message is then derived from this. The two-string constructors take both the
+ * resource name and an explicit exception message.</p>
+ */
+@SuppressWarnings("UnusedDeclaration")
+public class TestResourceUnavailableException extends SkipException {
+
+ private final String resourceName;
+
+ /**
+ * Asserts that a resource is available on the classpath; otherwise, throws {@link TestResourceUnavailableException}
+ *
+ * Note that this will use the same classloader that was used to load this class.
+ *
+ * @param resourceName the classpath resource name, e.g.
+ * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
+ */
+ public static void throwIfResourceUnavailable(Class<?> relativeToClass, String resourceName) {
+ checkNotNull(relativeToClass, relativeToClass);
+ checkNotNull(resourceName, "resourceName");
+ checkArgument(!resourceName.isEmpty(), "resourceName must not be empty");
+ InputStream resource = relativeToClass.getResourceAsStream(resourceName);
+ if (resource == null)
+ throw new TestResourceUnavailableException(resourceName);
+
+ // just make sure we clean up the resource
+ try {
+ resource.close();
+ } catch (IOException e) {
+ Throwables.propagate(e);
+ }
+ }
+
+ /**
+ * Instantiate an exception, giving the name of the unavailable resource.
+ *
+ * @param resourceName the name of the resource on the classpath, e.g.
+ * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
+ */
+ public TestResourceUnavailableException(String resourceName) {
+ super(messageFromResourceName(resourceName));
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Instantiate an exception, giving the name of the unavailable resource.
+ *
+ * @param resourceName the name of the resource on the classpath, e.g.
+ * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
+ * @param cause the underlying exception that caused this one
+ */
+ public TestResourceUnavailableException(String resourceName, Throwable cause) {
+ super(messageFromResourceName(resourceName), cause);
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Instantiate an exception, giving the name of the unavailable resource.
+ *
+ * @param resourceName the name of the resource on the classpath, e.g.
+ * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
+ * @param skipMessage the message associated with the exception
+ */
+ public TestResourceUnavailableException(String resourceName, String skipMessage) {
+ super(skipMessage);
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Instantiate an exception, giving the name of the unavailable resource.
+ *
+ * @param resourceName the name of the resource on the classpath, e.g.
+ * <code>/brooklyn/osgi/brooklyn-test-osgi-entities.jar</code>
+ * @param skipMessage the message associated with the exception
+ * @param cause the underlying exception that caused this one
+ */
+ public TestResourceUnavailableException(String resourceName, String skipMessage, Throwable cause) {
+ super(skipMessage, cause);
+ this.resourceName = resourceName;
+ }
+
+ private static String messageFromResourceName(String resourceName) {
+ return String.format("Test resource '%s' not found; test skipped.", resourceName);
+ }
+
+ /**
+ * Get the name of the classpath resource that could not be loaded.
+ *
+ * @return the name of the classpath resource whose absence caused this exception.
+ */
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ @Override
+ public boolean isSkip() {
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e06e79ab/utils/test-support/src/main/java/org/apache/brooklyn/test/VerboseReporter.java
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/java/org/apache/brooklyn/test/VerboseReporter.java b/utils/test-support/src/main/java/org/apache/brooklyn/test/VerboseReporter.java
new file mode 100644
index 0000000..0ec78e1
--- /dev/null
+++ b/utils/test-support/src/main/java/org/apache/brooklyn/test/VerboseReporter.java
@@ -0,0 +1,343 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.test;
+
+import java.util.List;
+
+import org.testng.ITestContext;
+import org.testng.ITestNGMethod;
+import org.testng.ITestResult;
+import org.testng.TestListenerAdapter;
+import org.testng.internal.ConstructorOrMethod;
+import org.testng.internal.Utils;
+
+/**
+ * Reporter printing out detailed messages about what TestNG
+ * is going to run and what is the status of what has been just run.
+ *
+ * To see messages from this reporter, either run Ant in verbose mode ('ant -v')
+ * or set verbose level to 5 or higher
+ *
+ * @author Lukas Jungmann
+ * @since 6.4
+ *
+ * THIS IS AN EXACT COPY OF THE CLASS IN org.testng.reporters
+ * EXCEPT FOR THIS COMMENT AND log(String) CHANGED TO BE PROTECTED
+ */
+public class VerboseReporter extends TestListenerAdapter {
+
+ /**
+ * Default prefix for messages printed out by this reporter
+ *
+ */
+ public static final String LISTENER_PREFIX = "[VerboseTestNG] ";
+ private String suiteName;
+ private final String prefix;
+
+ private enum Status {
+
+ SUCCESS(ITestResult.SUCCESS), FAILURE(ITestResult.FAILURE), SKIP(ITestResult.SKIP),
+ SUCCESS_PERCENTAGE_FAILURE(ITestResult.SUCCESS_PERCENTAGE_FAILURE), STARTED(ITestResult.STARTED);
+ private final int code;
+
+ private Status(int i) {
+ code = i;
+ }
+
+ @SuppressWarnings("unused")
+ public int getCode() {
+ return code;
+ }
+ }
+
+ /**
+ * Default constructor
+ */
+ public VerboseReporter() {
+ this(LISTENER_PREFIX);
+ }
+
+ /**
+ * Create VerboseReporter with custom prefix
+ *
+ * @param prefix prefix for messages printed out by this reporter
+ */
+ public VerboseReporter(String prefix) {
+ this.prefix = prefix;
+ }
+
+ @Override
+ public void beforeConfiguration(ITestResult tr) {
+ super.beforeConfiguration(tr);
+ logTestResult(Status.STARTED, tr, true);
+ }
+
+ @Override
+ public void onConfigurationFailure(ITestResult tr) {
+ super.onConfigurationFailure(tr);
+ logTestResult(Status.FAILURE, tr, true);
+ }
+
+ @Override
+ public void onConfigurationSkip(ITestResult tr) {
+ super.onConfigurationSkip(tr);
+ logTestResult(Status.SKIP, tr, true);
+ }
+
+ @Override
+ public void onConfigurationSuccess(ITestResult tr) {
+ super.onConfigurationSuccess(tr);
+ logTestResult(Status.SUCCESS, tr, true);
+ }
+
+ @Override
+ public void onTestStart(ITestResult tr) {
+ logTestResult(Status.STARTED, tr, false);
+ }
+
+ @Override
+ public void onTestFailure(ITestResult tr) {
+ super.onTestFailure(tr);
+ logTestResult(Status.FAILURE, tr, false);
+ }
+
+ @Override
+ public void onTestFailedButWithinSuccessPercentage(ITestResult tr) {
+ super.onTestFailedButWithinSuccessPercentage(tr);
+ logTestResult(Status.SUCCESS_PERCENTAGE_FAILURE, tr, false);
+ }
+
+ @Override
+ public void onTestSkipped(ITestResult tr) {
+ super.onTestSkipped(tr);
+ logTestResult(Status.SKIP, tr, false);
+ }
+
+ @Override
+ public void onTestSuccess(ITestResult tr) {
+ super.onTestSuccess(tr);
+ logTestResult(Status.SUCCESS, tr, false);
+ }
+
+ @Override
+ public void onStart(ITestContext ctx) {
+ suiteName = ctx.getName();//ctx.getSuite().getXmlSuite().getFileName();
+ log("RUNNING: Suite: \"" + suiteName + "\" containing \"" + ctx.getAllTestMethods().length + "\" Tests (config: " + ctx.getSuite().getXmlSuite().getFileName() + ")");
+ }
+
+ @Override
+ public void onFinish(ITestContext context) {
+ logResults();
+ suiteName = null;
+ }
+
+ private ITestNGMethod[] resultsToMethods(List<ITestResult> results) {
+ ITestNGMethod[] result = new ITestNGMethod[results.size()];
+ int i = 0;
+ for (ITestResult tr : results) {
+ result[i++] = tr.getMethod();
+ }
+ return result;
+ }
+
+ /**
+ * Print out test summary
+ */
+ private void logResults() {
+ //
+ // Log test summary
+ //
+ ITestNGMethod[] ft = resultsToMethods(getFailedTests());
+ StringBuilder sb = new StringBuilder("\n===============================================\n");
+ sb.append(" ").append(suiteName).append("\n");
+ sb.append(" Tests run: ").append(Utils.calculateInvokedMethodCount(getAllTestMethods()));
+ sb.append(", Failures: ").append(Utils.calculateInvokedMethodCount(ft));
+ sb.append(", Skips: ").append(Utils.calculateInvokedMethodCount(resultsToMethods(getSkippedTests())));
+ int confFailures = getConfigurationFailures().size();
+ int confSkips = getConfigurationSkips().size();
+ if (confFailures > 0 || confSkips > 0) {
+ sb.append("\n").append(" Configuration Failures: ").append(confFailures);
+ sb.append(", Skips: ").append(confSkips);
+ }
+ sb.append("\n===============================================");
+ log(sb.toString());
+ }
+
+ /**
+ * Log meaningful message for passed in arguments.
+ * Message itself is of form:
+ * $status: "$suiteName" - $methodDeclaration ($actualArguments) finished in $x ms ($run of $totalRuns)
+ *
+ * @param st status of passed in itr
+ * @param itr test result to be described
+ * @param isConfMethod is itr describing configuration method
+ */
+ private void logTestResult(Status st, ITestResult itr, boolean isConfMethod) {
+ StringBuilder sb = new StringBuilder();
+ String stackTrace = "";
+ switch (st) {
+ case STARTED:
+ sb.append("INVOKING");
+ break;
+ case SKIP:
+ sb.append("SKIPPED");
+ stackTrace = itr.getThrowable() != null
+ ? Utils.stackTrace(itr.getThrowable(), false)[0] : "";
+ break;
+ case FAILURE:
+ sb.append("FAILED");
+ stackTrace = itr.getThrowable() != null
+ ? Utils.stackTrace(itr.getThrowable(), false)[0] : "";
+ break;
+ case SUCCESS:
+ sb.append("PASSED");
+ break;
+ case SUCCESS_PERCENTAGE_FAILURE:
+ sb.append("PASSED with failures");
+ break;
+ default:
+ //not happen
+ throw new RuntimeException("Unsupported test status:" + itr.getStatus());
+ }
+ if (isConfMethod) {
+ sb.append(" CONFIGURATION: ");
+ } else {
+ sb.append(": ");
+ }
+ ITestNGMethod tm = itr.getMethod();
+ int identLevel = sb.length();
+ sb.append(getMethodDeclaration(tm));
+ Object[] params = itr.getParameters();
+ Class<?>[] paramTypes = tm.getConstructorOrMethod().getParameterTypes();
+ if (null != params && params.length > 0) {
+ // The error might be a data provider parameter mismatch, so make
+ // a special case here
+ if (params.length != paramTypes.length) {
+ sb.append("Wrong number of arguments were passed by the Data Provider: found ");
+ sb.append(params.length);
+ sb.append(" but expected ");
+ sb.append(paramTypes.length);
+ } else {
+ sb.append("(value(s): ");
+ for (int i = 0; i < params.length; i++) {
+ if (i > 0) {
+ sb.append(", ");
+ }
+ sb.append(Utils.toString(params[i], paramTypes[i]));
+ }
+ sb.append(")");
+
+ }
+ }
+ if (Status.STARTED != st) {
+ sb.append(" finished in ");
+ sb.append(itr.getEndMillis() - itr.getStartMillis());
+ sb.append(" ms");
+ if (!Utils.isStringEmpty(tm.getDescription())) {
+ sb.append("\n");
+ for (int i = 0; i < identLevel; i++) {
+ sb.append(" ");
+ }
+ sb.append(tm.getDescription());
+ }
+ if (tm.getInvocationCount() > 1) {
+ sb.append(" (");
+ sb.append(tm.getCurrentInvocationCount());
+ sb.append(" of ");
+ sb.append(tm.getInvocationCount());
+ sb.append(")");
+ }
+ if (!Utils.isStringEmpty(stackTrace)) {
+ sb.append("\n").append(stackTrace.substring(0, stackTrace.lastIndexOf(System.getProperty("line.separator"))));
+ }
+ } else {
+ if (!isConfMethod && tm.getInvocationCount() > 1) {
+ sb.append(" success: ");
+ sb.append(tm.getSuccessPercentage());
+ sb.append("%");
+ }
+ }
+ log(sb.toString());
+ }
+
+ protected void log(String message) {
+ //prefix all output lines
+ System.out.println(message.replaceAll("(?m)^", prefix));
+ }
+
+ /**
+ *
+ * @param method method to be described
+ * @return FQN of a class + method declaration for a method passed in
+ * ie. test.triangle.CheckCount.testCheckCount(java.lang.String)
+ */
+ private String getMethodDeclaration(ITestNGMethod method) {
+ //see Utils.detailedMethodName
+ //perhaps should rather adopt the original method instead
+ ConstructorOrMethod m = method.getConstructorOrMethod();
+ StringBuilder buf = new StringBuilder();
+ buf.append("\"");
+ if (suiteName != null) {
+ buf.append(suiteName);
+ } else {
+ buf.append("UNKNOWN");
+ }
+ buf.append("\"");
+ buf.append(" - ");
+ if (method.isBeforeSuiteConfiguration()) {
+ buf.append("@BeforeSuite ");
+ } else if (method.isBeforeTestConfiguration()) {
+ buf.append("@BeforeTest ");
+ } else if (method.isBeforeClassConfiguration()) {
+ buf.append("@BeforeClass ");
+ } else if (method.isBeforeGroupsConfiguration()) {
+ buf.append("@BeforeGroups ");
+ } else if (method.isBeforeMethodConfiguration()) {
+ buf.append("@BeforeMethod ");
+ } else if (method.isAfterMethodConfiguration()) {
+ buf.append("@AfterMethod ");
+ } else if (method.isAfterGroupsConfiguration()) {
+ buf.append("@AfterGroups ");
+ } else if (method.isAfterClassConfiguration()) {
+ buf.append("@AfterClass ");
+ } else if (method.isAfterTestConfiguration()) {
+ buf.append("@AfterTest ");
+ } else if (method.isAfterSuiteConfiguration()) {
+ buf.append("@AfterSuite ");
+ }
+ buf.append(m.getDeclaringClass().getName());
+ buf.append(".");
+ buf.append(m.getName());
+ buf.append("(");
+ int i = 0;
+ for (Class<?> p : m.getParameterTypes()) {
+ if (i++ > 0) {
+ buf.append(", ");
+ }
+ buf.append(p.getName());
+ }
+ buf.append(")");
+ return buf.toString();
+ }
+
+ @Override
+ public String toString() {
+ return "VerboseReporter{" + "suiteName=" + suiteName + '}';
+ }
+}