You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ri...@apache.org on 2014/12/09 16:48:07 UTC

[1/9] incubator-brooklyn git commit: Add TestResourceUnavailableException

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/0.7.0-M2-incubating be9fedde5 -> 3b2eac0df


Add TestResourceUnavailableException

Provides a way to skip TestNG tests if a test resource is not available (such as in the source distribution, which does not carry binary test resources)


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/722e47ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/722e47ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/722e47ff

Branch: refs/heads/0.7.0-M2-incubating
Commit: 722e47ff6af9468d108534758b68c4ae3b4f059e
Parents: be9fedd
Author: Richard Downer <ri...@apache.org>
Authored: Wed Nov 26 13:05:44 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:14:42 2014 +0000

----------------------------------------------------------------------
 .../test/TestResourceUnavailableException.java  | 140 +++++++++++++++++++
 1 file changed, 140 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/722e47ff/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
new file mode 100644
index 0000000..0738184
--- /dev/null
+++ b/utils/test-support/src/main/java/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 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;
+    }
+
+}


[9/9] incubator-brooklyn git commit: rest-server/src/test: skip test if binaries absent

Posted by ri...@apache.org.
rest-server/src/test: skip test if binaries absent

Conflicts:
	usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3b2eac0d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3b2eac0d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3b2eac0d

Branch: refs/heads/0.7.0-M2-incubating
Commit: 3b2eac0df44a8565aa2b4feec546e0a5fb486485
Parents: fcbcc1d
Author: Richard Downer <ri...@apache.org>
Authored: Tue Dec 9 11:54:54 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:40:15 2014 +0000

----------------------------------------------------------------------
 .../test/java/brooklyn/rest/resources/CatalogResourceTest.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3b2eac0d/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 8047ef5..0ea47f0 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
@@ -31,6 +31,7 @@ import java.util.Set;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -69,6 +70,8 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
   @Test
   /** based on CampYamlLiteTest */
   public void testRegisterCustomEntityWithBundleWhereEntityIsFromCoreAndIconFromBundle() {
+    TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
     String registeredTypeName = "my.catalog.entity.id";
     String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;
     String yaml =
@@ -119,6 +122,8 @@ public class CatalogResourceTest extends BrooklynRestResourceTest {
 
   @Test
   public void testRegisterOSGiPolicy() {
+    TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
     String registeredTypeName = "my.catalog.policy.id";
     String policyType = "brooklyn.osgi.tests.SimplePolicy";
     String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;


[4/9] incubator-brooklyn git commit: CampYamlLiteTest: skip tests if binaries absent

Posted by ri...@apache.org.
CampYamlLiteTest: skip tests if binaries absent

Conflicts:
	core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/232d3114
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/232d3114
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/232d3114

Branch: refs/heads/0.7.0-M2-incubating
Commit: 232d311485118f4d74ce59bb526544f3d6efec76
Parents: 9980f85
Author: Richard Downer <ri...@apache.org>
Authored: Tue Dec 9 10:50:39 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:34:09 2014 +0000

----------------------------------------------------------------------
 core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/232d3114/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 e952f00..6d1746e 100644
--- a/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
+++ b/core/src/test/java/brooklyn/camp/lite/CampYamlLiteTest.java
@@ -20,6 +20,8 @@ package brooklyn.camp.lite;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
+
+import brooklyn.test.TestResourceUnavailableException;
 import io.brooklyn.camp.spi.Assembly;
 import io.brooklyn.camp.spi.AssemblyTemplate;
 import io.brooklyn.camp.spi.pdp.PdpYamlTest;
@@ -152,6 +154,8 @@ public class CampYamlLiteTest {
 
     @Test
     public void testYamlServiceForCatalog() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         CatalogItem<?, ?> realItem = mgmt.getCatalog().addItem(Streams.readFullyString(getClass().getResourceAsStream("test-app-service-blueprint.yaml")));
         Iterable<CatalogItem<Object, Object>> retrievedItems = mgmt.getCatalog()
                 .getCatalogItems(CatalogPredicates.registeredType(Predicates.equalTo("catalog-name")));
@@ -173,6 +177,8 @@ public class CampYamlLiteTest {
 
     @Test
     public void testRegisterCustomEntityWithBundleWhereEntityIsFromCoreAndIconFromBundle() throws IOException {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String registeredTypeName = "my.catalog.app.id";
         String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;
         String yaml = getSampleMyCatalogAppYaml(registeredTypeName, bundleUrl);
@@ -184,6 +190,8 @@ public class CampYamlLiteTest {
 
     @Test
     public void testResetXmlWithCustomEntity() throws IOException {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String registeredTypeName = "my.catalog.app.id";
         String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;
         String yaml = getSampleMyCatalogAppYaml(registeredTypeName, bundleUrl);


[8/9] incubator-brooklyn git commit: usage/camp/src/test: skip test if binary is absent

Posted by ri...@apache.org.
usage/camp/src/test: skip test if binary is absent

Conflicts:
	usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
	usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlPolicyTest.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/fcbcc1db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/fcbcc1db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/fcbcc1db

Branch: refs/heads/0.7.0-M2-incubating
Commit: fcbcc1dbac2635f99fa80d21ca38c9b852f6b3f7
Parents: 232d311
Author: Richard Downer <ri...@apache.org>
Authored: Tue Dec 9 11:29:55 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:40:10 2014 +0000

----------------------------------------------------------------------
 .../camp/brooklyn/ReferencedYamlTest.java       |  3 +++
 .../CatalogOsgiVersionMoreEntityTest.java       | 21 ++++++++++++++++++++
 .../brooklyn/catalog/CatalogYamlEntityTest.java | 16 +++++++++++++++
 .../brooklyn/catalog/CatalogYamlPolicyTest.java |  4 ++++
 4 files changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fcbcc1db/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 05bb8c0..1ab683f 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,6 +20,7 @@ package io.brooklyn.camp.brooklyn;
 
 import java.util.Collection;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -130,6 +131,8 @@ public class ReferencedYamlTest extends AbstractYamlTest {
      */
     @Test
     public void testCatalogLeaksBundlesToReferencedYaml() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String parentCatalogId = "my.catalog.app.id.url.parent";
         addCatalogItem(
             "brooklyn.catalog:",

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fcbcc1db/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 9281e61..1f09db0 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
@@ -18,6 +18,7 @@
  */
 package io.brooklyn.camp.brooklyn.catalog;
 
+import brooklyn.test.TestResourceUnavailableException;
 import io.brooklyn.camp.brooklyn.AbstractYamlTest;
 import io.brooklyn.camp.brooklyn.spi.creation.BrooklynEntityMatcher;
 
@@ -41,6 +42,8 @@ public class CatalogOsgiVersionMoreEntityTest extends AbstractYamlTest {
     
     @Test
     public void testMoreEntityV1() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar");
+
         addCatalogItem(getLocalResource("more-entity-v1-osgi-catalog.yaml"));
         Entity app = createAndStartApplication("services: [ { type: more-entity } ]");
         Entity moreEntity = Iterables.getOnlyElement(app.getChildren());
@@ -54,6 +57,9 @@ public class CatalogOsgiVersionMoreEntityTest extends AbstractYamlTest {
      * if we passed the correct loader at that point we could avoid those warnings. */ 
     @Test
     public void testMoreEntityV1WithPolicy() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-entities.jar");
+
         addCatalogItem(getLocalResource("simple-policy-osgi-catalog.yaml"));
         addCatalogItem(getLocalResource("more-entity-v1-with-policy-osgi-catalog.yaml"));
         Entity app = createAndStartApplication("services: [ { type: more-entity } ]");
@@ -69,6 +75,9 @@ public class CatalogOsgiVersionMoreEntityTest extends AbstractYamlTest {
 
     @Test
     public void testMoreEntityV2() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-entities.jar");
+
         addCatalogItem(getLocalResource("more-entity-v2-osgi-catalog.yaml"));
         Entity app = createAndStartApplication("services: [ { type: more-entity } ]");
         Entity moreEntity = Iterables.getOnlyElement(app.getChildren());
@@ -86,6 +95,10 @@ public class CatalogOsgiVersionMoreEntityTest extends AbstractYamlTest {
     @Test
     /** TODO this test works if we assume most recent version wins, but semantics TBC */
     public void testMoreEntityV2ThenV1GivesV1() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-entities.jar");
+
         addCatalogItem(getLocalResource("more-entity-v2-osgi-catalog.yaml"));
         addCatalogItem(getLocalResource("more-entity-v1-osgi-catalog.yaml"));
         Entity app = createAndStartApplication("services: [ { type: more-entity } ]");
@@ -100,6 +113,10 @@ public class CatalogOsgiVersionMoreEntityTest extends AbstractYamlTest {
      * in either case this works */
     @Test
     public void testMoreEntityV1ThenV2GivesV2() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-entities.jar");
+
         addCatalogItem(getLocalResource("more-entity-v1-osgi-catalog.yaml"));
         addCatalogItem(getLocalResource("more-entity-v2-osgi-catalog.yaml"));
         Entity app = createAndStartApplication("services: [ { type: more-entity } ]");
@@ -111,6 +128,10 @@ public class CatalogOsgiVersionMoreEntityTest extends AbstractYamlTest {
 
     @Test
     public void testMoreEntityBothV1AndV2() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.jar");
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/brooklyn/osgi/brooklyn-test-osgi-entities.jar");
+
         addCatalogItem(getLocalResource("more-entity-v1-called-v1-osgi-catalog.yaml"));
         addCatalogItem(getLocalResource("more-entity-v2-osgi-catalog.yaml"));
         Entity v1 = createAndStartApplication("services: [ { type: more-entity-v1 } ]");

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fcbcc1db/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 83cd46d..712d8df 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
@@ -21,6 +21,8 @@ package io.brooklyn.camp.brooklyn.catalog;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
+
+import brooklyn.test.TestResourceUnavailableException;
 import io.brooklyn.camp.brooklyn.AbstractYamlTest;
 
 import java.util.Collection;
@@ -42,6 +44,8 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
     @Test
     public void testAddCatalogItem() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String registeredTypeName = "my.catalog.app.id.load";
         addCatalogOSGiEntity(registeredTypeName);
 
@@ -53,12 +57,16 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
     @Test
     public void testLaunchApplicationReferencingCatalog() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String registeredTypeName = "my.catalog.app.id.launch";
         registerAndLaunchAndAssertSimpleEntity(registeredTypeName, SIMPLE_ENTITY_TYPE);
     }
 
     @Test
     public void testLaunchApplicationWithCatalogReferencingOtherCatalog() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String referencedRegisteredTypeName = "my.catalog.app.id.referenced";
         String referrerRegisteredTypeName = "my.catalog.app.id.referring";
         addCatalogOSGiEntity(referencedRegisteredTypeName, SIMPLE_ENTITY_TYPE);
@@ -79,6 +87,8 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
     @Test
     public void testLaunchApplicationChildWithCatalogReferencingOtherCatalog() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String referencedRegisteredTypeName = "my.catalog.app.id.child.referenced";
         String referrerRegisteredTypeName = "my.catalog.app.id.child.referring";
         addCatalogOSGiEntity(referencedRegisteredTypeName, SIMPLE_ENTITY_TYPE);
@@ -111,6 +121,8 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
     @Test
     public void testLaunchApplicationWithTypeUsingJavaColonPrefix() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String registeredTypeName = SIMPLE_ENTITY_TYPE;
         String serviceName = "java:"+SIMPLE_ENTITY_TYPE;
         registerAndLaunchAndAssertSimpleEntity(registeredTypeName, serviceName);
@@ -118,6 +130,8 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
     @Test
     public void testLaunchApplicationLoopWithJavaTypeName() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String registeredTypeName = SIMPLE_ENTITY_TYPE;
         String serviceName = SIMPLE_ENTITY_TYPE;
         registerAndLaunchAndAssertSimpleEntity(registeredTypeName, serviceName);
@@ -125,6 +139,8 @@ public class CatalogYamlEntityTest extends AbstractYamlTest {
 
     @Test
     public void testLaunchApplicationChildLoopCatalogIdFails() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         String referrerRegisteredTypeName = "my.catalog.app.id.child.referring";
         try {
             addCatalogChildOSGiEntity(referrerRegisteredTypeName, referrerRegisteredTypeName);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/fcbcc1db/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 0d5c44d..a9980bb 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
@@ -19,6 +19,8 @@
 package io.brooklyn.camp.brooklyn.catalog;
 
 import static org.testng.Assert.assertEquals;
+
+import brooklyn.test.TestResourceUnavailableException;
 import io.brooklyn.camp.brooklyn.AbstractYamlTest;
 
 import org.testng.annotations.Test;
@@ -111,6 +113,8 @@ public class CatalogYamlPolicyTest extends AbstractYamlTest {
     }
 
     private void addCatalogOSGiPolicy(String registeredTypeName, String serviceType) {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         addCatalogItem(
             "brooklyn.catalog:",
             "  id: " + registeredTypeName,


[6/9] incubator-brooklyn git commit: Remove ZeroClipboard.swf from docs

Posted by ri...@apache.org.
Remove ZeroClipboard.swf from docs

Substitute with CDN-hosted version. Tested on a https-hosted location to
ensure correct behaviour on an environment like our live website.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/afc42867
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/afc42867
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/afc42867

Branch: refs/heads/0.7.0-M2-incubating
Commit: afc42867f6fd9a858979c9b9a3ce695e000e56dd
Parents: 14a4d55
Author: Richard Downer <ri...@apache.org>
Authored: Mon Dec 8 16:33:49 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:34:09 2014 +0000

----------------------------------------------------------------------
 docs/_layouts/page.html                         |    4 +-
 docs/style/js/zeroclipboard/ZeroClipboard.js    | 1010 ------------------
 .../style/js/zeroclipboard/ZeroClipboard.min.js |    9 -
 docs/style/js/zeroclipboard/ZeroClipboard.swf   |  Bin 1891 -> 0 bytes
 4 files changed, 2 insertions(+), 1021 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afc42867/docs/_layouts/page.html
----------------------------------------------------------------------
diff --git a/docs/_layouts/page.html b/docs/_layouts/page.html
index fc92ffa..ffadd05 100644
--- a/docs/_layouts/page.html
+++ b/docs/_layouts/page.html
@@ -41,7 +41,7 @@ under the License.
 	
 	
 <!-- Clipboard support -->
-<script src="{{ site.url }}/style/js/zeroclipboard/ZeroClipboard.min.js"></script>
+<script src="//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.min.js"></script>
 <style type="text/css">
 .clipboard_container { float: right; padding: 8px; }
 .clipboard_button {
@@ -53,7 +53,7 @@ under the License.
 .clipboard_button:active, .clipboard_button.zeroclipboard-is-active { background-image: url("{{ site.url }}/style/icons/clipboard-green-click.png"); }'
 </style>
 <script type="text/javascript"> <!-- clipboard -->
-  ZeroClipboard.config({ moviePath: '{{ site.url }}/style/js/zeroclipboard/ZeroClipboard.swf' });
+  ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
 </script>
 <script type="text/javascript"> <!-- clipboard positioning -->
 $(document).ready(function() {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afc42867/docs/style/js/zeroclipboard/ZeroClipboard.js
----------------------------------------------------------------------
diff --git a/docs/style/js/zeroclipboard/ZeroClipboard.js b/docs/style/js/zeroclipboard/ZeroClipboard.js
deleted file mode 100644
index f7794ef..0000000
--- a/docs/style/js/zeroclipboard/ZeroClipboard.js
+++ /dev/null
@@ -1,1010 +0,0 @@
-/*!
-* ZeroClipboard
-* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
-* Copyright (c) 2014 Jon Rohan, James M. Greene
-* Licensed MIT
-* http://zeroclipboard.org/
-* v1.3.1
-*/
-(function() {
-  "use strict";
-  var currentElement;
-  var flashState = {
-    bridge: null,
-    version: "0.0.0",
-    disabled: null,
-    outdated: null,
-    ready: null
-  };
-  var _clipData = {};
-  var clientIdCounter = 0;
-  var _clientMeta = {};
-  var elementIdCounter = 0;
-  var _elementMeta = {};
-  var _amdModuleId = null;
-  var _cjsModuleId = null;
-  var _swfPath = function() {
-    var i, jsDir, tmpJsPath, jsPath, swfPath = "ZeroClipboard.swf";
-    if (document.currentScript && (jsPath = document.currentScript.src)) {} else {
-      var scripts = document.getElementsByTagName("script");
-      if ("readyState" in scripts[0]) {
-        for (i = scripts.length; i--; ) {
-          if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
-            break;
-          }
-        }
-      } else if (document.readyState === "loading") {
-        jsPath = scripts[scripts.length - 1].src;
-      } else {
-        for (i = scripts.length; i--; ) {
-          tmpJsPath = scripts[i].src;
-          if (!tmpJsPath) {
-            jsDir = null;
-            break;
-          }
-          tmpJsPath = tmpJsPath.split("#")[0].split("?")[0];
-          tmpJsPath = tmpJsPath.slice(0, tmpJsPath.lastIndexOf("/") + 1);
-          if (jsDir == null) {
-            jsDir = tmpJsPath;
-          } else if (jsDir !== tmpJsPath) {
-            jsDir = null;
-            break;
-          }
-        }
-        if (jsDir !== null) {
-          jsPath = jsDir;
-        }
-      }
-    }
-    if (jsPath) {
-      jsPath = jsPath.split("#")[0].split("?")[0];
-      swfPath = jsPath.slice(0, jsPath.lastIndexOf("/") + 1) + swfPath;
-    }
-    return swfPath;
-  }();
-  var _camelizeCssPropName = function() {
-    var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
-      return group.toUpperCase();
-    };
-    return function(prop) {
-      return prop.replace(matcherRegex, replacerFn);
-    };
-  }();
-  var _getStyle = function(el, prop) {
-    var value, camelProp, tagName, possiblePointers, i, len;
-    if (window.getComputedStyle) {
-      value = window.getComputedStyle(el, null).getPropertyValue(prop);
-    } else {
-      camelProp = _camelizeCssPropName(prop);
-      if (el.currentStyle) {
-        value = el.currentStyle[camelProp];
-      } else {
-        value = el.style[camelProp];
-      }
-    }
-    if (prop === "cursor") {
-      if (!value || value === "auto") {
-        tagName = el.tagName.toLowerCase();
-        if (tagName === "a") {
-          return "pointer";
-        }
-      }
-    }
-    return value;
-  };
-  var _elementMouseOver = function(event) {
-    if (!event) {
-      event = window.event;
-    }
-    var target;
-    if (this !== window) {
-      target = this;
-    } else if (event.target) {
-      target = event.target;
-    } else if (event.srcElement) {
-      target = event.srcElement;
-    }
-    ZeroClipboard.activate(target);
-  };
-  var _addEventHandler = function(element, method, func) {
-    if (!element || element.nodeType !== 1) {
-      return;
-    }
-    if (element.addEventListener) {
-      element.addEventListener(method, func, false);
-    } else if (element.attachEvent) {
-      element.attachEvent("on" + method, func);
-    }
-  };
-  var _removeEventHandler = function(element, method, func) {
-    if (!element || element.nodeType !== 1) {
-      return;
-    }
-    if (element.removeEventListener) {
-      element.removeEventListener(method, func, false);
-    } else if (element.detachEvent) {
-      element.detachEvent("on" + method, func);
-    }
-  };
-  var _addClass = function(element, value) {
-    if (!element || element.nodeType !== 1) {
-      return element;
-    }
-    if (element.classList) {
-      if (!element.classList.contains(value)) {
-        element.classList.add(value);
-      }
-      return element;
-    }
-    if (value && typeof value === "string") {
-      var classNames = (value || "").split(/\s+/);
-      if (element.nodeType === 1) {
-        if (!element.className) {
-          element.className = value;
-        } else {
-          var className = " " + element.className + " ", setClass = element.className;
-          for (var c = 0, cl = classNames.length; c < cl; c++) {
-            if (className.indexOf(" " + classNames[c] + " ") < 0) {
-              setClass += " " + classNames[c];
-            }
-          }
-          element.className = setClass.replace(/^\s+|\s+$/g, "");
-        }
-      }
-    }
-    return element;
-  };
-  var _removeClass = function(element, value) {
-    if (!element || element.nodeType !== 1) {
-      return element;
-    }
-    if (element.classList) {
-      if (element.classList.contains(value)) {
-        element.classList.remove(value);
-      }
-      return element;
-    }
-    if (value && typeof value === "string" || value === undefined) {
-      var classNames = (value || "").split(/\s+/);
-      if (element.nodeType === 1 && element.className) {
-        if (value) {
-          var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
-          for (var c = 0, cl = classNames.length; c < cl; c++) {
-            className = className.replace(" " + classNames[c] + " ", " ");
-          }
-          element.className = className.replace(/^\s+|\s+$/g, "");
-        } else {
-          element.className = "";
-        }
-      }
-    }
-    return element;
-  };
-  var _getZoomFactor = function() {
-    var rect, physicalWidth, logicalWidth, zoomFactor = 1;
-    if (typeof document.body.getBoundingClientRect === "function") {
-      rect = document.body.getBoundingClientRect();
-      physicalWidth = rect.right - rect.left;
-      logicalWidth = document.body.offsetWidth;
-      zoomFactor = Math.round(physicalWidth / logicalWidth * 100) / 100;
-    }
-    return zoomFactor;
-  };
-  var _getDOMObjectPosition = function(obj, defaultZIndex) {
-    var info = {
-      left: 0,
-      top: 0,
-      width: 0,
-      height: 0,
-      zIndex: _getSafeZIndex(defaultZIndex) - 1
-    };
-    if (obj.getBoundingClientRect) {
-      var rect = obj.getBoundingClientRect();
-      var pageXOffset, pageYOffset, zoomFactor;
-      if ("pageXOffset" in window && "pageYOffset" in window) {
-        pageXOffset = window.pageXOffset;
-        pageYOffset = window.pageYOffset;
-      } else {
-        zoomFactor = _getZoomFactor();
-        pageXOffset = Math.round(document.documentElement.scrollLeft / zoomFactor);
-        pageYOffset = Math.round(document.documentElement.scrollTop / zoomFactor);
-      }
-      var leftBorderWidth = document.documentElement.clientLeft || 0;
-      var topBorderWidth = document.documentElement.clientTop || 0;
-      info.left = rect.left + pageXOffset - leftBorderWidth;
-      info.top = rect.top + pageYOffset - topBorderWidth;
-      info.width = "width" in rect ? rect.width : rect.right - rect.left;
-      info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
-    }
-    return info;
-  };
-  var _cacheBust = function(path, options) {
-    var cacheBust = options == null || options && options.cacheBust === true && options.useNoCache === true;
-    if (cacheBust) {
-      return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + new Date().getTime();
-    } else {
-      return "";
-    }
-  };
-  var _vars = function(options) {
-    var i, len, domain, str = [], domains = [], trustedOriginsExpanded = [];
-    if (options.trustedOrigins) {
-      if (typeof options.trustedOrigins === "string") {
-        domains.push(options.trustedOrigins);
-      } else if (typeof options.trustedOrigins === "object" && "length" in options.trustedOrigins) {
-        domains = domains.concat(options.trustedOrigins);
-      }
-    }
-    if (options.trustedDomains) {
-      if (typeof options.trustedDomains === "string") {
-        domains.push(options.trustedDomains);
-      } else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
-        domains = domains.concat(options.trustedDomains);
-      }
-    }
-    if (domains.length) {
-      for (i = 0, len = domains.length; i < len; i++) {
-        if (domains.hasOwnProperty(i) && domains[i] && typeof domains[i] === "string") {
-          domain = _extractDomain(domains[i]);
-          if (!domain) {
-            continue;
-          }
-          if (domain === "*") {
-            trustedOriginsExpanded = [ domain ];
-            break;
-          }
-          trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, window.location.protocol + "//" + domain ]);
-        }
-      }
-    }
-    if (trustedOriginsExpanded.length) {
-      str.push("trustedOrigins=" + encodeURIComponent(trustedOriginsExpanded.join(",")));
-    }
-    if (typeof options.jsModuleId === "string" && options.jsModuleId) {
-      str.push("jsModuleId=" + encodeURIComponent(options.jsModuleId));
-    }
-    return str.join("&");
-  };
-  var _inArray = function(elem, array, fromIndex) {
-    if (typeof array.indexOf === "function") {
-      return array.indexOf(elem, fromIndex);
-    }
-    var i, len = array.length;
-    if (typeof fromIndex === "undefined") {
-      fromIndex = 0;
-    } else if (fromIndex < 0) {
-      fromIndex = len + fromIndex;
-    }
-    for (i = fromIndex; i < len; i++) {
-      if (array.hasOwnProperty(i) && array[i] === elem) {
-        return i;
-      }
-    }
-    return -1;
-  };
-  var _prepClip = function(elements) {
-    if (typeof elements === "string") throw new TypeError("ZeroClipboard doesn't accept query strings.");
-    if (!elements.length) return [ elements ];
-    return elements;
-  };
-  var _dispatchCallback = function(func, context, args, async) {
-    if (async) {
-      window.setTimeout(function() {
-        func.apply(context, args);
-      }, 0);
-    } else {
-      func.apply(context, args);
-    }
-  };
-  var _getSafeZIndex = function(val) {
-    var zIndex, tmp;
-    if (val) {
-      if (typeof val === "number" && val > 0) {
-        zIndex = val;
-      } else if (typeof val === "string" && (tmp = parseInt(val, 10)) && !isNaN(tmp) && tmp > 0) {
-        zIndex = tmp;
-      }
-    }
-    if (!zIndex) {
-      if (typeof _globalConfig.zIndex === "number" && _globalConfig.zIndex > 0) {
-        zIndex = _globalConfig.zIndex;
-      } else if (typeof _globalConfig.zIndex === "string" && (tmp = parseInt(_globalConfig.zIndex, 10)) && !isNaN(tmp) && tmp > 0) {
-        zIndex = tmp;
-      }
-    }
-    return zIndex || 0;
-  };
-  var _deprecationWarning = function(deprecatedApiName, debugEnabled) {
-    if (deprecatedApiName && debugEnabled !== false && typeof console !== "undefined" && console && (console.warn || console.log)) {
-      var deprecationWarning = "`" + deprecatedApiName + "` is deprecated. See docs for more info:\n" + "    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";
-      if (console.warn) {
-        console.warn(deprecationWarning);
-      } else {
-        console.log(deprecationWarning);
-      }
-    }
-  };
-  var _extend = function() {
-    var i, len, arg, prop, src, copy, target = arguments[0] || {};
-    for (i = 1, len = arguments.length; i < len; i++) {
-      if ((arg = arguments[i]) != null) {
-        for (prop in arg) {
-          if (arg.hasOwnProperty(prop)) {
-            src = target[prop];
-            copy = arg[prop];
-            if (target === copy) {
-              continue;
-            }
-            if (copy !== undefined) {
-              target[prop] = copy;
-            }
-          }
-        }
-      }
-    }
-    return target;
-  };
-  var _extractDomain = function(originOrUrl) {
-    if (originOrUrl == null || originOrUrl === "") {
-      return null;
-    }
-    originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
-    if (originOrUrl === "") {
-      return null;
-    }
-    var protocolIndex = originOrUrl.indexOf("//");
-    originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
-    var pathIndex = originOrUrl.indexOf("/");
-    originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
-    if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
-      return null;
-    }
-    return originOrUrl || null;
-  };
-  var _determineScriptAccess = function() {
-    var _extractAllDomains = function(origins, resultsArray) {
-      var i, len, tmp;
-      if (origins != null && resultsArray[0] !== "*") {
-        if (typeof origins === "string") {
-          origins = [ origins ];
-        }
-        if (typeof origins === "object" && "length" in origins) {
-          for (i = 0, len = origins.length; i < len; i++) {
-            if (origins.hasOwnProperty(i)) {
-              tmp = _extractDomain(origins[i]);
-              if (tmp) {
-                if (tmp === "*") {
-                  resultsArray.length = 0;
-                  resultsArray.push("*");
-                  break;
-                }
-                if (_inArray(tmp, resultsArray) === -1) {
-                  resultsArray.push(tmp);
-                }
-              }
-            }
-          }
-        }
-      }
-    };
-    var _accessLevelLookup = {
-      always: "always",
-      samedomain: "sameDomain",
-      never: "never"
-    };
-    return function(currentDomain, configOptions) {
-      var asaLower, allowScriptAccess = configOptions.allowScriptAccess;
-      if (typeof allowScriptAccess === "string" && (asaLower = allowScriptAccess.toLowerCase()) && /^always|samedomain|never$/.test(asaLower)) {
-        return _accessLevelLookup[asaLower];
-      }
-      var swfDomain = _extractDomain(configOptions.moviePath);
-      if (swfDomain === null) {
-        swfDomain = currentDomain;
-      }
-      var trustedDomains = [];
-      _extractAllDomains(configOptions.trustedOrigins, trustedDomains);
-      _extractAllDomains(configOptions.trustedDomains, trustedDomains);
-      var len = trustedDomains.length;
-      if (len > 0) {
-        if (len === 1 && trustedDomains[0] === "*") {
-          return "always";
-        }
-        if (_inArray(currentDomain, trustedDomains) !== -1) {
-          if (len === 1 && currentDomain === swfDomain) {
-            return "sameDomain";
-          }
-          return "always";
-        }
-      }
-      return "never";
-    };
-  }();
-  var _objectKeys = function(obj) {
-    if (obj == null) {
-      return [];
-    }
-    if (Object.keys) {
-      return Object.keys(obj);
-    }
-    var keys = [];
-    for (var prop in obj) {
-      if (obj.hasOwnProperty(prop)) {
-        keys.push(prop);
-      }
-    }
-    return keys;
-  };
-  var _deleteOwnProperties = function(obj) {
-    if (obj) {
-      for (var prop in obj) {
-        if (obj.hasOwnProperty(prop)) {
-          delete obj[prop];
-        }
-      }
-    }
-    return obj;
-  };
-  var _detectFlashSupport = function() {
-    var hasFlash = false;
-    if (typeof flashState.disabled === "boolean") {
-      hasFlash = flashState.disabled === false;
-    } else {
-      if (typeof ActiveXObject === "function") {
-        try {
-          if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
-            hasFlash = true;
-          }
-        } catch (error) {}
-      }
-      if (!hasFlash && navigator.mimeTypes["application/x-shockwave-flash"]) {
-        hasFlash = true;
-      }
-    }
-    return hasFlash;
-  };
-  function _parseFlashVersion(flashVersion) {
-    return flashVersion.replace(/,/g, ".").replace(/[^0-9\.]/g, "");
-  }
-  function _isFlashVersionSupported(flashVersion) {
-    return parseFloat(_parseFlashVersion(flashVersion)) >= 10;
-  }
-  var ZeroClipboard = function(elements, options) {
-    if (!(this instanceof ZeroClipboard)) {
-      return new ZeroClipboard(elements, options);
-    }
-    this.id = "" + clientIdCounter++;
-    _clientMeta[this.id] = {
-      instance: this,
-      elements: [],
-      handlers: {}
-    };
-    if (elements) {
-      this.clip(elements);
-    }
-    if (typeof options !== "undefined") {
-      _deprecationWarning("new ZeroClipboard(elements, options)", _globalConfig.debug);
-      ZeroClipboard.config(options);
-    }
-    this.options = ZeroClipboard.config();
-    if (typeof flashState.disabled !== "boolean") {
-      flashState.disabled = !_detectFlashSupport();
-    }
-    if (flashState.disabled === false && flashState.outdated !== true) {
-      if (flashState.bridge === null) {
-        flashState.outdated = false;
-        flashState.ready = false;
-        _bridge();
-      }
-    }
-  };
-  ZeroClipboard.prototype.setText = function(newText) {
-    if (newText && newText !== "") {
-      _clipData["text/plain"] = newText;
-      if (flashState.ready === true && flashState.bridge) {
-        flashState.bridge.setText(newText);
-      } else {}
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.setSize = function(width, height) {
-    if (flashState.ready === true && flashState.bridge) {
-      flashState.bridge.setSize(width, height);
-    } else {}
-    return this;
-  };
-  var _setHandCursor = function(enabled) {
-    if (flashState.ready === true && flashState.bridge) {
-      flashState.bridge.setHandCursor(enabled);
-    } else {}
-  };
-  ZeroClipboard.prototype.destroy = function() {
-    this.unclip();
-    this.off();
-    delete _clientMeta[this.id];
-  };
-  var _getAllClients = function() {
-    var i, len, client, clients = [], clientIds = _objectKeys(_clientMeta);
-    for (i = 0, len = clientIds.length; i < len; i++) {
-      client = _clientMeta[clientIds[i]].instance;
-      if (client && client instanceof ZeroClipboard) {
-        clients.push(client);
-      }
-    }
-    return clients;
-  };
-  ZeroClipboard.version = "1.3.1";
-  var _globalConfig = {
-    swfPath: _swfPath,
-    trustedDomains: window.location.host ? [ window.location.host ] : [],
-    cacheBust: true,
-    forceHandCursor: false,
-    zIndex: 999999999,
-    debug: true,
-    title: null,
-    autoActivate: true
-  };
-  ZeroClipboard.config = function(options) {
-    if (typeof options === "object" && options !== null) {
-      _extend(_globalConfig, options);
-    }
-    if (typeof options === "string" && options) {
-      if (_globalConfig.hasOwnProperty(options)) {
-        return _globalConfig[options];
-      }
-      return;
-    }
-    var copy = {};
-    for (var prop in _globalConfig) {
-      if (_globalConfig.hasOwnProperty(prop)) {
-        if (typeof _globalConfig[prop] === "object" && _globalConfig[prop] !== null) {
-          if ("length" in _globalConfig[prop]) {
-            copy[prop] = _globalConfig[prop].slice(0);
-          } else {
-            copy[prop] = _extend({}, _globalConfig[prop]);
-          }
-        } else {
-          copy[prop] = _globalConfig[prop];
-        }
-      }
-    }
-    return copy;
-  };
-  ZeroClipboard.destroy = function() {
-    ZeroClipboard.deactivate();
-    for (var clientId in _clientMeta) {
-      if (_clientMeta.hasOwnProperty(clientId) && _clientMeta[clientId]) {
-        var client = _clientMeta[clientId].instance;
-        if (client && typeof client.destroy === "function") {
-          client.destroy();
-        }
-      }
-    }
-    var htmlBridge = _getHtmlBridge(flashState.bridge);
-    if (htmlBridge && htmlBridge.parentNode) {
-      htmlBridge.parentNode.removeChild(htmlBridge);
-      flashState.ready = null;
-      flashState.bridge = null;
-    }
-  };
-  ZeroClipboard.activate = function(element) {
-    if (currentElement) {
-      _removeClass(currentElement, _globalConfig.hoverClass);
-      _removeClass(currentElement, _globalConfig.activeClass);
-    }
-    currentElement = element;
-    _addClass(element, _globalConfig.hoverClass);
-    _reposition();
-    var newTitle = _globalConfig.title || element.getAttribute("title");
-    if (newTitle) {
-      var htmlBridge = _getHtmlBridge(flashState.bridge);
-      if (htmlBridge) {
-        htmlBridge.setAttribute("title", newTitle);
-      }
-    }
-    var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
-    _setHandCursor(useHandCursor);
-  };
-  ZeroClipboard.deactivate = function() {
-    var htmlBridge = _getHtmlBridge(flashState.bridge);
-    if (htmlBridge) {
-      htmlBridge.style.left = "0px";
-      htmlBridge.style.top = "-9999px";
-      htmlBridge.removeAttribute("title");
-    }
-    if (currentElement) {
-      _removeClass(currentElement, _globalConfig.hoverClass);
-      _removeClass(currentElement, _globalConfig.activeClass);
-      currentElement = null;
-    }
-  };
-  var _bridge = function() {
-    var flashBridge, len;
-    var container = document.getElementById("global-zeroclipboard-html-bridge");
-    if (!container) {
-      var opts = ZeroClipboard.config();
-      opts.jsModuleId = typeof _amdModuleId === "string" && _amdModuleId || typeof _cjsModuleId === "string" && _cjsModuleId || null;
-      var allowScriptAccess = _determineScriptAccess(window.location.host, _globalConfig);
-      var flashvars = _vars(opts);
-      var swfUrl = _globalConfig.moviePath + _cacheBust(_globalConfig.moviePath, _globalConfig);
-      var html = '      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="' + swfUrl + '"/>         <param name="allowScriptAccess" value="' + allowScriptAccess + '"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="' + flashvars + '"/>         <embed src="' + swfUrl + '"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="' + allowScriptAccess + '"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"          
  pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="' + flashvars + '"           scale="exactfit">         </embed>       </object>';
-      container = document.createElement("div");
-      container.id = "global-zeroclipboard-html-bridge";
-      container.setAttribute("class", "global-zeroclipboard-container");
-      container.style.position = "absolute";
-      container.style.left = "0px";
-      container.style.top = "-9999px";
-      container.style.width = "15px";
-      container.style.height = "15px";
-      container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
-      document.body.appendChild(container);
-      container.innerHTML = html;
-    }
-    flashBridge = document["global-zeroclipboard-flash-bridge"];
-    if (flashBridge && (len = flashBridge.length)) {
-      flashBridge = flashBridge[len - 1];
-    }
-    flashState.bridge = flashBridge || container.children[0].lastElementChild;
-  };
-  var _getHtmlBridge = function(flashBridge) {
-    var isFlashElement = /^OBJECT|EMBED$/;
-    var htmlBridge = flashBridge && flashBridge.parentNode;
-    while (htmlBridge && isFlashElement.test(htmlBridge.nodeName) && htmlBridge.parentNode) {
-      htmlBridge = htmlBridge.parentNode;
-    }
-    return htmlBridge || null;
-  };
-  var _reposition = function() {
-    if (currentElement) {
-      var pos = _getDOMObjectPosition(currentElement, _globalConfig.zIndex);
-      var htmlBridge = _getHtmlBridge(flashState.bridge);
-      if (htmlBridge) {
-        htmlBridge.style.top = pos.top + "px";
-        htmlBridge.style.left = pos.left + "px";
-        htmlBridge.style.width = pos.width + "px";
-        htmlBridge.style.height = pos.height + "px";
-        htmlBridge.style.zIndex = pos.zIndex + 1;
-      }
-      if (flashState.ready === true && flashState.bridge) {
-        flashState.bridge.setSize(pos.width, pos.height);
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.on = function(eventName, func) {
-    var i, len, events, added = {}, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
-    if (typeof eventName === "string" && eventName) {
-      events = eventName.toLowerCase().split(/\s+/);
-    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
-      for (i in eventName) {
-        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
-          this.on(i, eventName[i]);
-        }
-      }
-    }
-    if (events && events.length) {
-      for (i = 0, len = events.length; i < len; i++) {
-        eventName = events[i].replace(/^on/, "");
-        added[eventName] = true;
-        if (!handlers[eventName]) {
-          handlers[eventName] = [];
-        }
-        handlers[eventName].push(func);
-      }
-      if (added.noflash && flashState.disabled) {
-        _receiveEvent.call(this, "noflash", {});
-      }
-      if (added.wrongflash && flashState.outdated) {
-        _receiveEvent.call(this, "wrongflash", {
-          flashVersion: flashState.version
-        });
-      }
-      if (added.load && flashState.ready) {
-        _receiveEvent.call(this, "load", {
-          flashVersion: flashState.version
-        });
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.off = function(eventName, func) {
-    var i, len, foundIndex, events, perEventHandlers, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
-    if (arguments.length === 0) {
-      events = _objectKeys(handlers);
-    } else if (typeof eventName === "string" && eventName) {
-      events = eventName.split(/\s+/);
-    } else if (typeof eventName === "object" && eventName && typeof func === "undefined") {
-      for (i in eventName) {
-        if (eventName.hasOwnProperty(i) && typeof i === "string" && i && typeof eventName[i] === "function") {
-          this.off(i, eventName[i]);
-        }
-      }
-    }
-    if (events && events.length) {
-      for (i = 0, len = events.length; i < len; i++) {
-        eventName = events[i].toLowerCase().replace(/^on/, "");
-        perEventHandlers = handlers[eventName];
-        if (perEventHandlers && perEventHandlers.length) {
-          if (func) {
-            foundIndex = _inArray(func, perEventHandlers);
-            while (foundIndex !== -1) {
-              perEventHandlers.splice(foundIndex, 1);
-              foundIndex = _inArray(func, perEventHandlers, foundIndex);
-            }
-          } else {
-            handlers[eventName].length = 0;
-          }
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.handlers = function(eventName) {
-    var prop, copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
-    if (handlers) {
-      if (typeof eventName === "string" && eventName) {
-        return handlers[eventName] ? handlers[eventName].slice(0) : null;
-      }
-      copy = {};
-      for (prop in handlers) {
-        if (handlers.hasOwnProperty(prop) && handlers[prop]) {
-          copy[prop] = handlers[prop].slice(0);
-        }
-      }
-    }
-    return copy;
-  };
-  var _dispatchClientCallbacks = function(eventName, context, args, async) {
-    var handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers[eventName];
-    if (handlers && handlers.length) {
-      var i, len, func, originalContext = context || this;
-      for (i = 0, len = handlers.length; i < len; i++) {
-        func = handlers[i];
-        context = originalContext;
-        if (typeof func === "string" && typeof window[func] === "function") {
-          func = window[func];
-        }
-        if (typeof func === "object" && func && typeof func.handleEvent === "function") {
-          context = func;
-          func = func.handleEvent;
-        }
-        if (typeof func === "function") {
-          _dispatchCallback(func, context, args, async);
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.clip = function(elements) {
-    elements = _prepClip(elements);
-    for (var i = 0; i < elements.length; i++) {
-      if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
-        if (!elements[i].zcClippingId) {
-          elements[i].zcClippingId = "zcClippingId_" + elementIdCounter++;
-          _elementMeta[elements[i].zcClippingId] = [ this.id ];
-          if (_globalConfig.autoActivate === true) {
-            _addEventHandler(elements[i], "mouseover", _elementMouseOver);
-          }
-        } else if (_inArray(this.id, _elementMeta[elements[i].zcClippingId]) === -1) {
-          _elementMeta[elements[i].zcClippingId].push(this.id);
-        }
-        var clippedElements = _clientMeta[this.id].elements;
-        if (_inArray(elements[i], clippedElements) === -1) {
-          clippedElements.push(elements[i]);
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.unclip = function(elements) {
-    var meta = _clientMeta[this.id];
-    if (meta) {
-      var clippedElements = meta.elements;
-      var arrayIndex;
-      if (typeof elements === "undefined") {
-        elements = clippedElements.slice(0);
-      } else {
-        elements = _prepClip(elements);
-      }
-      for (var i = elements.length; i--; ) {
-        if (elements.hasOwnProperty(i) && elements[i] && elements[i].nodeType === 1) {
-          arrayIndex = 0;
-          while ((arrayIndex = _inArray(elements[i], clippedElements, arrayIndex)) !== -1) {
-            clippedElements.splice(arrayIndex, 1);
-          }
-          var clientIds = _elementMeta[elements[i].zcClippingId];
-          if (clientIds) {
-            arrayIndex = 0;
-            while ((arrayIndex = _inArray(this.id, clientIds, arrayIndex)) !== -1) {
-              clientIds.splice(arrayIndex, 1);
-            }
-            if (clientIds.length === 0) {
-              if (_globalConfig.autoActivate === true) {
-                _removeEventHandler(elements[i], "mouseover", _elementMouseOver);
-              }
-              delete elements[i].zcClippingId;
-            }
-          }
-        }
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.prototype.elements = function() {
-    var meta = _clientMeta[this.id];
-    return meta && meta.elements ? meta.elements.slice(0) : [];
-  };
-  var _getAllClientsClippedToElement = function(element) {
-    var elementMetaId, clientIds, i, len, client, clients = [];
-    if (element && element.nodeType === 1 && (elementMetaId = element.zcClippingId) && _elementMeta.hasOwnProperty(elementMetaId)) {
-      clientIds = _elementMeta[elementMetaId];
-      if (clientIds && clientIds.length) {
-        for (i = 0, len = clientIds.length; i < len; i++) {
-          client = _clientMeta[clientIds[i]].instance;
-          if (client && client instanceof ZeroClipboard) {
-            clients.push(client);
-          }
-        }
-      }
-    }
-    return clients;
-  };
-  _globalConfig.hoverClass = "zeroclipboard-is-hover";
-  _globalConfig.activeClass = "zeroclipboard-is-active";
-  _globalConfig.trustedOrigins = null;
-  _globalConfig.allowScriptAccess = null;
-  _globalConfig.useNoCache = true;
-  _globalConfig.moviePath = "ZeroClipboard.swf";
-  ZeroClipboard.detectFlashSupport = function() {
-    _deprecationWarning("ZeroClipboard.detectFlashSupport", _globalConfig.debug);
-    return _detectFlashSupport();
-  };
-  ZeroClipboard.dispatch = function(eventName, args) {
-    if (typeof eventName === "string" && eventName) {
-      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
-      if (cleanEventName) {
-        var clients = currentElement ? _getAllClientsClippedToElement(currentElement) : _getAllClients();
-        for (var i = 0, len = clients.length; i < len; i++) {
-          _receiveEvent.call(clients[i], cleanEventName, args);
-        }
-      }
-    }
-  };
-  ZeroClipboard.prototype.setHandCursor = function(enabled) {
-    _deprecationWarning("ZeroClipboard.prototype.setHandCursor", _globalConfig.debug);
-    enabled = typeof enabled === "boolean" ? enabled : !!enabled;
-    _setHandCursor(enabled);
-    _globalConfig.forceHandCursor = enabled;
-    return this;
-  };
-  ZeroClipboard.prototype.reposition = function() {
-    _deprecationWarning("ZeroClipboard.prototype.reposition", _globalConfig.debug);
-    return _reposition();
-  };
-  ZeroClipboard.prototype.receiveEvent = function(eventName, args) {
-    _deprecationWarning("ZeroClipboard.prototype.receiveEvent", _globalConfig.debug);
-    if (typeof eventName === "string" && eventName) {
-      var cleanEventName = eventName.toLowerCase().replace(/^on/, "");
-      if (cleanEventName) {
-        _receiveEvent.call(this, cleanEventName, args);
-      }
-    }
-  };
-  ZeroClipboard.prototype.setCurrent = function(element) {
-    _deprecationWarning("ZeroClipboard.prototype.setCurrent", _globalConfig.debug);
-    ZeroClipboard.activate(element);
-    return this;
-  };
-  ZeroClipboard.prototype.resetBridge = function() {
-    _deprecationWarning("ZeroClipboard.prototype.resetBridge", _globalConfig.debug);
-    ZeroClipboard.deactivate();
-    return this;
-  };
-  ZeroClipboard.prototype.setTitle = function(newTitle) {
-    _deprecationWarning("ZeroClipboard.prototype.setTitle", _globalConfig.debug);
-    newTitle = newTitle || _globalConfig.title || currentElement && currentElement.getAttribute("title");
-    if (newTitle) {
-      var htmlBridge = _getHtmlBridge(flashState.bridge);
-      if (htmlBridge) {
-        htmlBridge.setAttribute("title", newTitle);
-      }
-    }
-    return this;
-  };
-  ZeroClipboard.setDefaults = function(options) {
-    _deprecationWarning("ZeroClipboard.setDefaults", _globalConfig.debug);
-    ZeroClipboard.config(options);
-  };
-  ZeroClipboard.prototype.addEventListener = function(eventName, func) {
-    _deprecationWarning("ZeroClipboard.prototype.addEventListener", _globalConfig.debug);
-    return this.on(eventName, func);
-  };
-  ZeroClipboard.prototype.removeEventListener = function(eventName, func) {
-    _deprecationWarning("ZeroClipboard.prototype.removeEventListener", _globalConfig.debug);
-    return this.off(eventName, func);
-  };
-  ZeroClipboard.prototype.ready = function() {
-    _deprecationWarning("ZeroClipboard.prototype.ready", _globalConfig.debug);
-    return flashState.ready === true;
-  };
-  var _receiveEvent = function(eventName, args) {
-    eventName = eventName.toLowerCase().replace(/^on/, "");
-    var cleanVersion = args && args.flashVersion && _parseFlashVersion(args.flashVersion) || null;
-    var element = currentElement;
-    var performCallbackAsync = true;
-    switch (eventName) {
-     case "load":
-      if (cleanVersion) {
-        if (!_isFlashVersionSupported(cleanVersion)) {
-          _receiveEvent.call(this, "onWrongFlash", {
-            flashVersion: cleanVersion
-          });
-          return;
-        }
-        flashState.outdated = false;
-        flashState.ready = true;
-        flashState.version = cleanVersion;
-      }
-      break;
-
-     case "wrongflash":
-      if (cleanVersion && !_isFlashVersionSupported(cleanVersion)) {
-        flashState.outdated = true;
-        flashState.ready = false;
-        flashState.version = cleanVersion;
-      }
-      break;
-
-     case "mouseover":
-      _addClass(element, _globalConfig.hoverClass);
-      break;
-
-     case "mouseout":
-      if (_globalConfig.autoActivate === true) {
-        ZeroClipboard.deactivate();
-      }
-      break;
-
-     case "mousedown":
-      _addClass(element, _globalConfig.activeClass);
-      break;
-
-     case "mouseup":
-      _removeClass(element, _globalConfig.activeClass);
-      break;
-
-     case "datarequested":
-      var targetId = element.getAttribute("data-clipboard-target"), targetEl = !targetId ? null : document.getElementById(targetId);
-      if (targetEl) {
-        var textContent = targetEl.value || targetEl.textContent || targetEl.innerText;
-        if (textContent) {
-          this.setText(textContent);
-        }
-      } else {
-        var defaultText = element.getAttribute("data-clipboard-text");
-        if (defaultText) {
-          this.setText(defaultText);
-        }
-      }
-      performCallbackAsync = false;
-      break;
-
-     case "complete":
-      _deleteOwnProperties(_clipData);
-      break;
-    }
-    var context = element;
-    var eventArgs = [ this, args ];
-    return _dispatchClientCallbacks.call(this, eventName, context, eventArgs, performCallbackAsync);
-  };
-  if (typeof define === "function" && define.amd) {
-    define([ "require", "exports", "module" ], function(require, exports, module) {
-      _amdModuleId = module && module.id || null;
-      return ZeroClipboard;
-    });
-  } else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
-    _cjsModuleId = module.id || null;
-    module.exports = ZeroClipboard;
-  } else {
-    window.ZeroClipboard = ZeroClipboard;
-  }
-})();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afc42867/docs/style/js/zeroclipboard/ZeroClipboard.min.js
----------------------------------------------------------------------
diff --git a/docs/style/js/zeroclipboard/ZeroClipboard.min.js b/docs/style/js/zeroclipboard/ZeroClipboard.min.js
deleted file mode 100644
index 46703e1..0000000
--- a/docs/style/js/zeroclipboard/ZeroClipboard.min.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
-* ZeroClipboard
-* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
-* Copyright (c) 2014 Jon Rohan, James M. Greene
-* Licensed MIT
-* http://zeroclipboard.org/
-* v1.3.1
-*/
-!function(){"use strict";function a(a){return a.replace(/,/g,".").replace(/[^0-9\.]/g,"")}function b(b){return parseFloat(a(b))>=10}var c,d={bridge:null,version:"0.0.0",disabled:null,outdated:null,ready:null},e={},f=0,g={},h=0,i={},j=null,k=null,l=function(){var a,b,c,d,e="ZeroClipboard.swf";if(document.currentScript&&(d=document.currentScript.src));else{var f=document.getElementsByTagName("script");if("readyState"in f[0])for(a=f.length;a--&&("interactive"!==f[a].readyState||!(d=f[a].src)););else if("loading"===document.readyState)d=f[f.length-1].src;else{for(a=f.length;a--;){if(c=f[a].src,!c){b=null;break}if(c=c.split("#")[0].split("?")[0],c=c.slice(0,c.lastIndexOf("/")+1),null==b)b=c;else if(b!==c){b=null;break}}null!==b&&(d=b)}}return d&&(d=d.split("#")[0].split("?")[0],e=d.slice(0,d.lastIndexOf("/")+1)+e),e}(),m=function(){var a=/\-([a-z])/g,b=function(a,b){return b.toUpperCase()};return function(c){return c.replace(a,b)}}(),n=function(a,b){var c,d,e;return window.getComputedSty
 le?c=window.getComputedStyle(a,null).getPropertyValue(b):(d=m(b),c=a.currentStyle?a.currentStyle[d]:a.style[d]),"cursor"!==b||c&&"auto"!==c||(e=a.tagName.toLowerCase(),"a"!==e)?c:"pointer"},o=function(a){a||(a=window.event);var b;this!==window?b=this:a.target?b=a.target:a.srcElement&&(b=a.srcElement),I.activate(b)},p=function(a,b,c){a&&1===a.nodeType&&(a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c))},q=function(a,b,c){a&&1===a.nodeType&&(a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c))},r=function(a,b){if(!a||1!==a.nodeType)return a;if(a.classList)return a.classList.contains(b)||a.classList.add(b),a;if(b&&"string"==typeof b){var c=(b||"").split(/\s+/);if(1===a.nodeType)if(a.className){for(var d=" "+a.className+" ",e=a.className,f=0,g=c.length;g>f;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}else a.className=b}return a},s=function(a,b){if(!a||1!==a.nodeType)return a
 ;if(a.classList)return a.classList.contains(b)&&a.classList.remove(b),a;if(b&&"string"==typeof b||void 0===b){var c=(b||"").split(/\s+/);if(1===a.nodeType&&a.className)if(b){for(var d=(" "+a.className+" ").replace(/[\n\t]/g," "),e=0,f=c.length;f>e;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}else a.className=""}return a},t=function(){var a,b,c,d=1;return"function"==typeof document.body.getBoundingClientRect&&(a=document.body.getBoundingClientRect(),b=a.right-a.left,c=document.body.offsetWidth,d=Math.round(b/c*100)/100),d},u=function(a,b){var c={left:0,top:0,width:0,height:0,zIndex:A(b)-1};if(a.getBoundingClientRect){var d,e,f,g=a.getBoundingClientRect();"pageXOffset"in window&&"pageYOffset"in window?(d=window.pageXOffset,e=window.pageYOffset):(f=t(),d=Math.round(document.documentElement.scrollLeft/f),e=Math.round(document.documentElement.scrollTop/f));var h=document.documentElement.clientLeft||0,i=document.documentElement.clientTop||0;c.left=g.left+d-h,c.
 top=g.top+e-i,c.width="width"in g?g.width:g.right-g.left,c.height="height"in g?g.height:g.bottom-g.top}return c},v=function(a,b){var c=null==b||b&&b.cacheBust===!0&&b.useNoCache===!0;return c?(-1===a.indexOf("?")?"?":"&")+"noCache="+(new Date).getTime():""},w=function(a){var b,c,d,e=[],f=[],g=[];if(a.trustedOrigins&&("string"==typeof a.trustedOrigins?f.push(a.trustedOrigins):"object"==typeof a.trustedOrigins&&"length"in a.trustedOrigins&&(f=f.concat(a.trustedOrigins))),a.trustedDomains&&("string"==typeof a.trustedDomains?f.push(a.trustedDomains):"object"==typeof a.trustedDomains&&"length"in a.trustedDomains&&(f=f.concat(a.trustedDomains))),f.length)for(b=0,c=f.length;c>b;b++)if(f.hasOwnProperty(b)&&f[b]&&"string"==typeof f[b]){if(d=D(f[b]),!d)continue;if("*"===d){g=[d];break}g.push.apply(g,[d,"//"+d,window.location.protocol+"//"+d])}return g.length&&e.push("trustedOrigins="+encodeURIComponent(g.join(","))),"string"==typeof a.jsModuleId&&a.jsModuleId&&e.push("jsModuleId="+encodeURICo
 mponent(a.jsModuleId)),e.join("&")},x=function(a,b,c){if("function"==typeof b.indexOf)return b.indexOf(a,c);var d,e=b.length;for("undefined"==typeof c?c=0:0>c&&(c=e+c),d=c;e>d;d++)if(b.hasOwnProperty(d)&&b[d]===a)return d;return-1},y=function(a){if("string"==typeof a)throw new TypeError("ZeroClipboard doesn't accept query strings.");return a.length?a:[a]},z=function(a,b,c,d){d?window.setTimeout(function(){a.apply(b,c)},0):a.apply(b,c)},A=function(a){var b,c;return a&&("number"==typeof a&&a>0?b=a:"string"==typeof a&&(c=parseInt(a,10))&&!isNaN(c)&&c>0&&(b=c)),b||("number"==typeof L.zIndex&&L.zIndex>0?b=L.zIndex:"string"==typeof L.zIndex&&(c=parseInt(L.zIndex,10))&&!isNaN(c)&&c>0&&(b=c)),b||0},B=function(a,b){if(a&&b!==!1&&"undefined"!=typeof console&&console&&(console.warn||console.log)){var c="`"+a+"` is deprecated. See docs for more info:\n    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations";console.warn?console.warn(c):console.log(c)}},C
 =function(){var a,b,c,d,e,f,g=arguments[0]||{};for(a=1,b=arguments.length;b>a;a++)if(null!=(c=arguments[a]))for(d in c)if(c.hasOwnProperty(d)){if(e=g[d],f=c[d],g===f)continue;void 0!==f&&(g[d]=f)}return g},D=function(a){if(null==a||""===a)return null;if(a=a.replace(/^\s+|\s+$/g,""),""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return a=-1===c?a:-1===b||0===c?null:a.slice(0,c),a&&".swf"===a.slice(-4).toLowerCase()?null:a||null},E=function(){var a=function(a,b){var c,d,e;if(null!=a&&"*"!==b[0]&&("string"==typeof a&&(a=[a]),"object"==typeof a&&"length"in a))for(c=0,d=a.length;d>c;c++)if(a.hasOwnProperty(c)&&(e=D(a[c]))){if("*"===e){b.length=0,b.push("*");break}-1===x(e,b)&&b.push(e)}},b={always:"always",samedomain:"sameDomain",never:"never"};return function(c,d){var e,f=d.allowScriptAccess;if("string"==typeof f&&(e=f.toLowerCase())&&/^always|samedomain|never$/.test(e))return b[e];var g=D(d.moviePath);null===g&&(g=c);var h=[];a(d.trustedOrigins,h)
 ,a(d.trustedDomains,h);var i=h.length;if(i>0){if(1===i&&"*"===h[0])return"always";if(-1!==x(c,h))return 1===i&&c===g?"sameDomain":"always"}return"never"}}(),F=function(a){if(null==a)return[];if(Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},G=function(a){if(a)for(var b in a)a.hasOwnProperty(b)&&delete a[b];return a},H=function(){var a=!1;if("boolean"==typeof d.disabled)a=d.disabled===!1;else{if("function"==typeof ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(a=!0)}catch(b){}!a&&navigator.mimeTypes["application/x-shockwave-flash"]&&(a=!0)}return a},I=function(a,b){return this instanceof I?(this.id=""+f++,g[this.id]={instance:this,elements:[],handlers:{}},a&&this.clip(a),"undefined"!=typeof b&&(B("new ZeroClipboard(elements, options)",L.debug),I.config(b)),this.options=I.config(),"boolean"!=typeof d.disabled&&(d.disabled=!H()),d.disabled===!1&&d.outdated!==!0&&null===d.bridge&&(d.outdated=!1,d.ready=!1,M()),v
 oid 0):new I(a,b)};I.prototype.setText=function(a){return a&&""!==a&&(e["text/plain"]=a,d.ready===!0&&d.bridge&&d.bridge.setText(a)),this},I.prototype.setSize=function(a,b){return d.ready===!0&&d.bridge&&d.bridge.setSize(a,b),this};var J=function(a){d.ready===!0&&d.bridge&&d.bridge.setHandCursor(a)};I.prototype.destroy=function(){this.unclip(),this.off(),delete g[this.id]};var K=function(){var a,b,c,d=[],e=F(g);for(a=0,b=e.length;b>a;a++)c=g[e[a]].instance,c&&c instanceof I&&d.push(c);return d};I.version="1.3.1";var L={swfPath:l,trustedDomains:window.location.host?[window.location.host]:[],cacheBust:!0,forceHandCursor:!1,zIndex:999999999,debug:!0,title:null,autoActivate:!0};I.config=function(a){"object"==typeof a&&null!==a&&C(L,a);{if("string"!=typeof a||!a){var b={};for(var c in L)L.hasOwnProperty(c)&&(b[c]="object"==typeof L[c]&&null!==L[c]?"length"in L[c]?L[c].slice(0):C({},L[c]):L[c]);return b}if(L.hasOwnProperty(a))return L[a]}},I.destroy=function(){I.deactivate();for(var a in 
 g)if(g.hasOwnProperty(a)&&g[a]){var b=g[a].instance;b&&"function"==typeof b.destroy&&b.destroy()}var c=N(d.bridge);c&&c.parentNode&&(c.parentNode.removeChild(c),d.ready=null,d.bridge=null)},I.activate=function(a){c&&(s(c,L.hoverClass),s(c,L.activeClass)),c=a,r(a,L.hoverClass),O();var b=L.title||a.getAttribute("title");if(b){var e=N(d.bridge);e&&e.setAttribute("title",b)}var f=L.forceHandCursor===!0||"pointer"===n(a,"cursor");J(f)},I.deactivate=function(){var a=N(d.bridge);a&&(a.style.left="0px",a.style.top="-9999px",a.removeAttribute("title")),c&&(s(c,L.hoverClass),s(c,L.activeClass),c=null)};var M=function(){var a,b,c=document.getElementById("global-zeroclipboard-html-bridge");if(!c){var e=I.config();e.jsModuleId="string"==typeof j&&j||"string"==typeof k&&k||null;var f=E(window.location.host,L),g=w(e),h=L.moviePath+v(L.moviePath,L),i='      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param 
 name="movie" value="'+h+'"/>         <param name="allowScriptAccess" value="'+f+'"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="'+g+'"/>         <embed src="'+h+'"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="'+f+'"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"           pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="'+g+'"           scale="exactfit">         </embed>       </object>';c=document.createElement("div"),c.id="global-zeroclipboard-html-bridge",c.setAttribute("
 class","global-zeroclipboard-container"),c.style.position="absolute",c.style.left="0px",c.style.top="-9999px",c.style.width="15px",c.style.height="15px",c.style.zIndex=""+A(L.zIndex),document.body.appendChild(c),c.innerHTML=i}a=document["global-zeroclipboard-flash-bridge"],a&&(b=a.length)&&(a=a[b-1]),d.bridge=a||c.children[0].lastElementChild},N=function(a){for(var b=/^OBJECT|EMBED$/,c=a&&a.parentNode;c&&b.test(c.nodeName)&&c.parentNode;)c=c.parentNode;return c||null},O=function(){if(c){var a=u(c,L.zIndex),b=N(d.bridge);b&&(b.style.top=a.top+"px",b.style.left=a.left+"px",b.style.width=a.width+"px",b.style.height=a.height+"px",b.style.zIndex=a.zIndex+1),d.ready===!0&&d.bridge&&d.bridge.setSize(a.width,a.height)}return this};I.prototype.on=function(a,b){var c,e,f,h={},i=g[this.id]&&g[this.id].handlers;if("string"==typeof a&&a)f=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)a.hasOwnProperty(c)&&"string"==typeof c&&c&&"function"==typeof a[c
 ]&&this.on(c,a[c]);if(f&&f.length){for(c=0,e=f.length;e>c;c++)a=f[c].replace(/^on/,""),h[a]=!0,i[a]||(i[a]=[]),i[a].push(b);h.noflash&&d.disabled&&R.call(this,"noflash",{}),h.wrongflash&&d.outdated&&R.call(this,"wrongflash",{flashVersion:d.version}),h.load&&d.ready&&R.call(this,"load",{flashVersion:d.version})}return this},I.prototype.off=function(a,b){var c,d,e,f,h,i=g[this.id]&&g[this.id].handlers;if(0===arguments.length)f=F(i);else if("string"==typeof a&&a)f=a.split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)a.hasOwnProperty(c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&this.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;d>c;c++)if(a=f[c].toLowerCase().replace(/^on/,""),h=i[a],h&&h.length)if(b)for(e=x(b,h);-1!==e;)h.splice(e,1),e=x(b,h,e);else i[a].length=0;return this},I.prototype.handlers=function(a){var b,c=null,d=g[this.id]&&g[this.id].handlers;if(d){if("string"==typeof a&&a)return d[a]?d[a].slice(0):null;c={};for(b in d)d.hasOwnProperty(b)&&d
 [b]&&(c[b]=d[b].slice(0))}return c};var P=function(a,b,c,d){var e=g[this.id]&&g[this.id].handlers[a];if(e&&e.length){var f,h,i,j=b||this;for(f=0,h=e.length;h>f;f++)i=e[f],b=j,"string"==typeof i&&"function"==typeof window[i]&&(i=window[i]),"object"==typeof i&&i&&"function"==typeof i.handleEvent&&(b=i,i=i.handleEvent),"function"==typeof i&&z(i,b,c,d)}return this};I.prototype.clip=function(a){a=y(a);for(var b=0;b<a.length;b++)if(a.hasOwnProperty(b)&&a[b]&&1===a[b].nodeType){a[b].zcClippingId?-1===x(this.id,i[a[b].zcClippingId])&&i[a[b].zcClippingId].push(this.id):(a[b].zcClippingId="zcClippingId_"+h++,i[a[b].zcClippingId]=[this.id],L.autoActivate===!0&&p(a[b],"mouseover",o));var c=g[this.id].elements;-1===x(a[b],c)&&c.push(a[b])}return this},I.prototype.unclip=function(a){var b=g[this.id];if(b){var c,d=b.elements;a="undefined"==typeof a?d.slice(0):y(a);for(var e=a.length;e--;)if(a.hasOwnProperty(e)&&a[e]&&1===a[e].nodeType){for(c=0;-1!==(c=x(a[e],d,c));)d.splice(c,1);var f=i[a[e].zcCli
 ppingId];if(f){for(c=0;-1!==(c=x(this.id,f,c));)f.splice(c,1);0===f.length&&(L.autoActivate===!0&&q(a[e],"mouseover",o),delete a[e].zcClippingId)}}}return this},I.prototype.elements=function(){var a=g[this.id];return a&&a.elements?a.elements.slice(0):[]};var Q=function(a){var b,c,d,e,f,h=[];if(a&&1===a.nodeType&&(b=a.zcClippingId)&&i.hasOwnProperty(b)&&(c=i[b],c&&c.length))for(d=0,e=c.length;e>d;d++)f=g[c[d]].instance,f&&f instanceof I&&h.push(f);return h};L.hoverClass="zeroclipboard-is-hover",L.activeClass="zeroclipboard-is-active",L.trustedOrigins=null,L.allowScriptAccess=null,L.useNoCache=!0,L.moviePath="ZeroClipboard.swf",I.detectFlashSupport=function(){return B("ZeroClipboard.detectFlashSupport",L.debug),H()},I.dispatch=function(a,b){if("string"==typeof a&&a){var d=a.toLowerCase().replace(/^on/,"");if(d)for(var e=c?Q(c):K(),f=0,g=e.length;g>f;f++)R.call(e[f],d,b)}},I.prototype.setHandCursor=function(a){return B("ZeroClipboard.prototype.setHandCursor",L.debug),a="boolean"==typeo
 f a?a:!!a,J(a),L.forceHandCursor=a,this},I.prototype.reposition=function(){return B("ZeroClipboard.prototype.reposition",L.debug),O()},I.prototype.receiveEvent=function(a,b){if(B("ZeroClipboard.prototype.receiveEvent",L.debug),"string"==typeof a&&a){var c=a.toLowerCase().replace(/^on/,"");c&&R.call(this,c,b)}},I.prototype.setCurrent=function(a){return B("ZeroClipboard.prototype.setCurrent",L.debug),I.activate(a),this},I.prototype.resetBridge=function(){return B("ZeroClipboard.prototype.resetBridge",L.debug),I.deactivate(),this},I.prototype.setTitle=function(a){if(B("ZeroClipboard.prototype.setTitle",L.debug),a=a||L.title||c&&c.getAttribute("title")){var b=N(d.bridge);b&&b.setAttribute("title",a)}return this},I.setDefaults=function(a){B("ZeroClipboard.setDefaults",L.debug),I.config(a)},I.prototype.addEventListener=function(a,b){return B("ZeroClipboard.prototype.addEventListener",L.debug),this.on(a,b)},I.prototype.removeEventListener=function(a,b){return B("ZeroClipboard.prototype.rem
 oveEventListener",L.debug),this.off(a,b)},I.prototype.ready=function(){return B("ZeroClipboard.prototype.ready",L.debug),d.ready===!0};var R=function(f,g){f=f.toLowerCase().replace(/^on/,"");var h=g&&g.flashVersion&&a(g.flashVersion)||null,i=c,j=!0;switch(f){case"load":if(h){if(!b(h))return R.call(this,"onWrongFlash",{flashVersion:h}),void 0;d.outdated=!1,d.ready=!0,d.version=h}break;case"wrongflash":h&&!b(h)&&(d.outdated=!0,d.ready=!1,d.version=h);break;case"mouseover":r(i,L.hoverClass);break;case"mouseout":L.autoActivate===!0&&I.deactivate();break;case"mousedown":r(i,L.activeClass);break;case"mouseup":s(i,L.activeClass);break;case"datarequested":var k=i.getAttribute("data-clipboard-target"),l=k?document.getElementById(k):null;if(l){var m=l.value||l.textContent||l.innerText;m&&this.setText(m)}else{var n=i.getAttribute("data-clipboard-text");n&&this.setText(n)}j=!1;break;case"complete":G(e)}var o=i,p=[this,g];return P.call(this,f,o,p,j)};"function"==typeof define&&define.amd?define(
 ["require","exports","module"],function(a,b,c){return j=c&&c.id||null,I}):"object"==typeof module&&module&&"object"==typeof module.exports&&module.exports?(k=module.id||null,module.exports=I):window.ZeroClipboard=I}();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afc42867/docs/style/js/zeroclipboard/ZeroClipboard.swf
----------------------------------------------------------------------
diff --git a/docs/style/js/zeroclipboard/ZeroClipboard.swf b/docs/style/js/zeroclipboard/ZeroClipboard.swf
deleted file mode 100644
index 56637ff..0000000
Binary files a/docs/style/js/zeroclipboard/ZeroClipboard.swf and /dev/null differ


[5/9] incubator-brooklyn git commit: Use remotely hosted ZeroClipboard.swf

Posted by ri...@apache.org.
Use remotely hosted ZeroClipboard.swf

Don't include it in the repository due to licensing issues.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/14a4d550
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/14a4d550
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/14a4d550

Branch: refs/heads/0.7.0-M2-incubating
Commit: 14a4d550eb65057270fe6b1aa232716caad9368a
Parents: a184a0f
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Dec 2 12:15:21 2014 +0200
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:34:09 2014 +0000

----------------------------------------------------------------------
 .../main/webapp/assets/js/libs/ZeroClipboard.swf    | Bin 1891 -> 0 bytes
 .../src/main/webapp/assets/js/view/entity-config.js |   2 +-
 .../main/webapp/assets/js/view/entity-sensors.js    |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/14a4d550/usage/jsgui/src/main/webapp/assets/js/libs/ZeroClipboard.swf
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/libs/ZeroClipboard.swf b/usage/jsgui/src/main/webapp/assets/js/libs/ZeroClipboard.swf
deleted file mode 100644
index 56637ff..0000000
Binary files a/usage/jsgui/src/main/webapp/assets/js/libs/ZeroClipboard.swf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/14a4d550/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js b/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js
index 7524d38..6c3a964 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/entity-config.js
@@ -28,7 +28,7 @@ define([
 ], function (_, $, Backbone, Util, ZeroClipboard, ViewUtils, ConfigSummary, ConfigHtml, ConfigNameHtml) {
 
     // TODO consider extracting all such usages to a shared ZeroClipboard wrapper?
-    ZeroClipboard.config({ moviePath: 'assets/js/libs/ZeroClipboard.swf' });
+    ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
 
     var configHtml = _.template(ConfigHtml),
         configNameHtml = _.template(ConfigNameHtml);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/14a4d550/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js b/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js
index 5f791b4..c7a0070 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/entity-sensors.js
@@ -28,7 +28,7 @@ define([
 ], function (_, $, Backbone, Util, ZeroClipboard, ViewUtils, SensorSummary, SensorsHtml, SensorNameHtml) {
 
     // TODO consider extracting all such usages to a shared ZeroClipboard wrapper?
-    ZeroClipboard.config({ moviePath: 'assets/js/libs/ZeroClipboard.swf' });
+    ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.1/ZeroClipboard.swf' });
     
     var sensorHtml = _.template(SensorsHtml),
         sensorNameHtml = _.template(SensorNameHtml);


[7/9] incubator-brooklyn git commit: Minor changes to docs build

Posted by ri...@apache.org.
Minor changes to docs build

Add #ruby line to Gemfile so that current versions of rvm detect a
known-good Ruby version and a gemset. Modify _config.yml to exclude some
source code files from the built site.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/9980f853
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/9980f853
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/9980f853

Branch: refs/heads/0.7.0-M2-incubating
Commit: 9980f8533418fa0d676b241a637aa1e705a91f20
Parents: afc4286
Author: Richard Downer <ri...@apache.org>
Authored: Mon Dec 8 16:36:39 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:34:09 2014 +0000

----------------------------------------------------------------------
 docs/Gemfile     | 1 +
 docs/_config.yml | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/9980f853/docs/Gemfile
----------------------------------------------------------------------
diff --git a/docs/Gemfile b/docs/Gemfile
index d2b4450..99a2d5a 100644
--- a/docs/Gemfile
+++ b/docs/Gemfile
@@ -17,6 +17,7 @@
 # under the License.
 #
 
+#ruby=ruby-2.1.2
 #ruby-gemset=brooklyn-docs
 
 source 'https://rubygems.org'

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/9980f853/docs/_config.yml
----------------------------------------------------------------------
diff --git a/docs/_config.yml b/docs/_config.yml
index 0c778b4..cb21cb3 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -16,6 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+exclude: [ LICENSE.txt, Gemfile, Gemfile.lock ]
 markdown: rdiscount
 brooklyn-version: 0.7.0-M2-incubating # BROOKLYN_VERSION
 brooklyn-snapshot-git-branch: master   # if line above is SNAPSHOT this should point to corresponding git branch (e.g. master, 0.4)


[2/9] incubator-brooklyn git commit: Make embedded jars optional

Posted by ri...@apache.org.
Make embedded jars optional

Modifies code that relies on jar files as an embedded resource to
gracefully handle cases where the files are missing. Limited to tests,
which will cause TestNG to skip the test if the resource is missing.
Required for our source distribution, as Apache convention is to not
ship binaries in releases.

Conflicts:
	core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
	core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_evil-twin_0.2.0.txt

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d9d3f3bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d9d3f3bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d9d3f3bd

Branch: refs/heads/0.7.0-M2-incubating
Commit: d9d3f3bdeaf1fbb769d923edfc96dc407322652f
Parents: 722e47f
Author: Richard Downer <ri...@apache.org>
Authored: Wed Nov 26 13:08:09 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:22:44 2014 +0000

----------------------------------------------------------------------
 .../entity/rebind/RebindCatalogEntityTest.java  |  6 ++--
 .../management/osgi/OsgiStandaloneTest.java     | 30 ++++++++++++++------
 .../osgi/OsgiVersionMoreEntityTest.java         | 17 +++++++++++
 .../entity/rebind/brooklyn-AppInCatalog.txt     |  5 +++-
 .../osgi/brooklyn-osgi-test-a_0.1.0.txt         |  5 +++-
 .../osgi/brooklyn-test-osgi-entities.txt        |  5 ++++
 .../brooklyn-test-osgi-more-entities_0.1.0.txt  |  5 ++++
 .../brooklyn-test-osgi-more-entities_0.2.0.txt  |  5 ++++
 .../cassandra/cassandra-multicloud-snitch.txt   |  6 +++-
 .../entity/osgi/karaf/KarafContainerTest.java   | 10 +++++--
 .../osgi/src/test/resources/hello-world.txt     |  5 +++-
 11 files changed, 81 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/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 2e3c621..cf9e5fe 100644
--- a/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/RebindCatalogEntityTest.java
@@ -25,6 +25,7 @@ import static org.testng.Assert.assertNotSame;
 import java.net.URL;
 import java.util.List;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeMethod;
@@ -59,7 +60,7 @@ public class RebindCatalogEntityTest extends RebindTestFixture<StartableApplicat
      * }
      */
 
-    private static final String JAR_PATH = "brooklyn/entity/rebind/brooklyn-AppInCatalog.jar";
+    private static final String JAR_PATH = "/brooklyn/entity/rebind/brooklyn-AppInCatalog.jar";
     private static final String APP_CLASSNAME = "brooklyn.entity.rebind.AppInCatalog";
 
     private URL url;
@@ -78,7 +79,8 @@ public class RebindCatalogEntityTest extends RebindTestFixture<StartableApplicat
     @BeforeMethod(alwaysRun=true)
     @Override
     public void setUp() throws Exception {
-        url = getClass().getClassLoader().getResource(JAR_PATH);
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), JAR_PATH);
+        url = getClass().getResource(JAR_PATH);
         assertNotNull(url, "Could not find on classpath: "+JAR_PATH);
         super.setUp();
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/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 9947fad..deb1e37 100644
--- a/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java
+++ b/core/src/test/java/brooklyn/management/osgi/OsgiStandaloneTest.java
@@ -26,6 +26,8 @@ import java.util.Enumeration;
 import java.util.List;
 import java.util.jar.JarInputStream;
 
+import brooklyn.test.TestResourceUnavailableException;
+import brooklyn.util.exceptions.Exceptions;
 import org.apache.commons.io.FileUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
@@ -97,15 +99,24 @@ public class OsgiStandaloneTest {
         }
     }
 
+    protected Bundle installFromClasspath(String resourceName) throws BundleException {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), resourceName);
+        try {
+            return Osgis.install(framework, String.format("classpath:%s", resourceName));
+        } catch (Exception e) {
+            throw Exceptions.propagate(e);
+        }
+    }
+
     @Test
     public void testInstallBundle() throws Exception {
-        Bundle bundle = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         checkMath(bundle, 3, 6);
     }
 
     @Test
     public void testBootBundle() throws Exception {
-        Bundle bundle = install(BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+        Bundle bundle = installFromClasspath(BROOKLYN_TEST_OSGI_ENTITIES_PATH);
         Class<?> bundleCls = bundle.loadClass("brooklyn.osgi.tests.SimpleEntity");
         Assert.assertEquals(Entity.class,  bundle.loadClass(Entity.class.getName()));
         Assert.assertEquals(Entity.class, bundleCls.getClassLoader().loadClass(Entity.class.getName()));
@@ -137,7 +148,7 @@ public class OsgiStandaloneTest {
 
     @Test
     public void testAMultiplier() throws Exception {
-        Bundle bundle = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         checkMath(bundle, 3, 6);
         setAMultiplier(bundle, 5);
         checkMath(bundle, 3, 15);
@@ -147,7 +158,7 @@ public class OsgiStandaloneTest {
      * on a fresh install the multiplier is reset */
     @Test
     public void testANOtherMultiple() throws Exception {
-        Bundle bundle = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         checkMath(bundle, 3, 6);
         setAMultiplier(bundle, 14);
         checkMath(bundle, 3, 42);
@@ -155,23 +166,23 @@ public class OsgiStandaloneTest {
 
     @Test
     public void testGetBundle() throws Exception {
-        Bundle bundle = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         setAMultiplier(bundle, 3);
 
         // can look it up based on the same location string (no other "location identifier" reference string seems to work here, however) 
-        Bundle bundle2 = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle2 = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         checkMath(bundle2, 3, 9);
     }
 
     @Test
     public void testUninstallAndReinstallBundle() throws Exception {
-        Bundle bundle = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         checkMath(bundle, 3, 6);
         setAMultiplier(bundle, 3);
         checkMath(bundle, 3, 9);
         bundle.uninstall();
         
-        Bundle bundle2 = install(BROOKLYN_OSGI_TEST_A_0_1_0_URL);
+        Bundle bundle2 = installFromClasspath(BROOKLYN_OSGI_TEST_A_0_1_0_PATH);
         checkMath(bundle2, 3, 6);
     }
 
@@ -207,6 +218,7 @@ public class OsgiStandaloneTest {
     
     @Test
     public void testReadKnownManifest() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_OSGI_ENTITIES_PATH);
         InputStream in = this.getClass().getResourceAsStream(BROOKLYN_TEST_OSGI_ENTITIES_PATH);
         JarInputStream jarIn = new JarInputStream(in);
         ManifestHelper helper = Osgis.ManifestHelper.forManifest(jarIn.getManifest());
@@ -217,7 +229,7 @@ public class OsgiStandaloneTest {
     
     @Test
     public void testLoadOsgiBundleDependencies() throws Exception {
-        Bundle bundle = install(BROOKLYN_TEST_OSGI_ENTITIES_URL);
+        Bundle bundle = installFromClasspath(BROOKLYN_TEST_OSGI_ENTITIES_PATH);
         Assert.assertNotNull(bundle);
         Class<?> aClass = bundle.loadClass("brooklyn.osgi.tests.SimpleApplicationImpl");
         Object aInst = aClass.newInstance();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/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 c5df30d..9d434f2 100644
--- a/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
+++ b/core/src/test/java/brooklyn/management/osgi/OsgiVersionMoreEntityTest.java
@@ -22,6 +22,7 @@ import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.launch.Framework;
@@ -98,6 +99,7 @@ public class OsgiVersionMoreEntityTest {
             InternalPolicyFactory policyFactory = new InternalPolicyFactory(managementContext);
             factory = new InternalEntityFactory(managementContext, managementContext.getEntityManager().getEntityTypeRegistry(), policyFactory);
 
+            TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_OSGI_ENTITIES_PATH);
             Bundle bundle = Osgis.install(framework, BROOKLYN_TEST_OSGI_ENTITIES_PATH);
             @SuppressWarnings("unchecked")
             Class<? extends Entity> bundleCls = (Class<? extends Entity>) bundle.loadClass("brooklyn.osgi.tests.SimpleEntityImpl");
@@ -167,6 +169,8 @@ public class OsgiVersionMoreEntityTest {
 
     @Test
     public void testMoreEntitiesV1() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V1_PATH);
+
         CatalogItem<?, ?> c2 = addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, BROOKLYN_TEST_MORE_ENTITIES_V1_URL);
         
         // test load and instantiate
@@ -193,6 +197,9 @@ public class OsgiVersionMoreEntityTest {
 
     @Test
     public void testMoreEntitiesV1Policy() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V1_PATH);
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_OSGI_ENTITIES_PATH);
+
         CatalogItem<?, ?> c2 = addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, BROOKLYN_TEST_MORE_ENTITIES_V1_URL);
         
         // test load and instantiate
@@ -213,6 +220,8 @@ public class OsgiVersionMoreEntityTest {
 
     @Test
     public void testMoreEntitiesV2FailsWithoutBasicTestOsgiEntitiesBundle() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V2_PATH);
+
         CatalogItem<?, ?> c2 = addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, 
             BROOKLYN_TEST_MORE_ENTITIES_V2_URL);
         
@@ -231,6 +240,8 @@ public class OsgiVersionMoreEntityTest {
     // and has policy, with policy item catalog ID is reasonable
     @Test
     public void testMoreEntitiesV2() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V2_PATH);
+
         CatalogItem<?, ?> c2 = addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, 
             BROOKLYN_TEST_MORE_ENTITIES_V2_URL, BROOKLYN_TEST_OSGI_ENTITIES_URL);
         
@@ -250,6 +261,9 @@ public class OsgiVersionMoreEntityTest {
 
     @Test
     public void testMoreEntitiesV1ThenV2GivesV2() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V1_PATH);
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V2_PATH);
+
         addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, 
             BROOKLYN_TEST_MORE_ENTITIES_V1_URL);
         addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, 
@@ -265,6 +279,9 @@ public class OsgiVersionMoreEntityTest {
 
     @Test
     public void testMoreEntitiesV2ThenV1GivesV1() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V1_PATH);
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), BROOKLYN_TEST_MORE_ENTITIES_V2_PATH);
+
         addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, 
             BROOKLYN_TEST_MORE_ENTITIES_V2_URL, BROOKLYN_TEST_OSGI_ENTITIES_URL);
         addCatalogItem(OsgiTestResources.BROOKLYN_TEST_MORE_ENTITIES_MORE_ENTITY, 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.txt b/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.txt
index 5c5a4c5..b4f6a9f 100644
--- a/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.txt
+++ b/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.txt
@@ -21,5 +21,8 @@ on the classpath.
 
 The jar contains its source code. 
 
-It is included as a (small) binary to prevent build complication.
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn
 ~

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/core/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt b/core/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
index dfe77bc..e6dde72 100644
--- a/core/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
+++ b/core/src/test/resources/brooklyn/osgi/brooklyn-osgi-test-a_0.1.0.txt
@@ -20,4 +20,7 @@ used in brooklyn.management.osgi.OsgiStandaloneTest.
 
 The jar contains its source.
 
-It is included here in binary form to simplify the Brooklyn build process.
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
index 74cc33d..9cf43a4 100644
--- a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
+++ b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-entities.txt
@@ -19,3 +19,8 @@ The file brooklyn-test-osgi-entities.jar is for testing a deployment of
 an OSGi bundle containing entities.
 
 The source is in core/src/test/dependencies/osgi/entities
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
index b1879d7..80067a4 100644
--- a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
+++ b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.1.0.txt
@@ -19,3 +19,8 @@ The file brooklyn-test-osgi-entities.jar is for testing a deployment of
 an OSGi bundle containing entities.
 
 The source is in core/src/test/dependencies/osgi/more-entities-v1
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
index bd307eb..3fb2d31 100644
--- a/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
+++ b/core/src/test/resources/brooklyn/osgi/brooklyn-test-osgi-more-entities_0.2.0.txt
@@ -19,3 +19,8 @@ The file brooklyn-test-osgi-entities.jar is for testing a deployment of
 an OSGi bundle containing entities.
 
 The source is in core/src/test/dependencies/osgi/more-entities-v2
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/software/nosql/src/main/resources/brooklyn/entity/nosql/cassandra/cassandra-multicloud-snitch.txt
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/resources/brooklyn/entity/nosql/cassandra/cassandra-multicloud-snitch.txt b/software/nosql/src/main/resources/brooklyn/entity/nosql/cassandra/cassandra-multicloud-snitch.txt
index bc4d3a2..205b18d 100644
--- a/software/nosql/src/main/resources/brooklyn/entity/nosql/cassandra/cassandra-multicloud-snitch.txt
+++ b/software/nosql/src/main/resources/brooklyn/entity/nosql/cassandra/cassandra-multicloud-snitch.txt
@@ -24,6 +24,10 @@ The source will be contributed to the Cassandra project; when it is available in
 Cassandra distro (and when we don't want to give backwards compatibility support for
 older Cassandra versions), then we can delete it from Brooklyn.
 
-It is included here in binary form to simplify the Brooklyn build process.
 The jar can be uploaded to a Cassandra Node as part of deployment, for if
 this multi-cloud snitch is desired.
+
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/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 f43255d..f54e5ae 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,6 +24,7 @@ import static org.testng.Assert.assertNull;
 import java.net.URL;
 import java.util.Map;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -44,6 +45,8 @@ import com.google.common.collect.ImmutableList;
 
 public class KarafContainerTest extends BrooklynAppLiveTestSupport {
 
+    private static final String HELLO_WORLD_JAR = "/hello-world.jar";
+
     LocalhostMachineProvisioningLocation localhost;
     KarafContainer karaf;
 
@@ -116,6 +119,10 @@ public class KarafContainerTest extends BrooklynAppLiveTestSupport {
     // registered so we are never able to connect to them over jmx.
     @Test(groups = {"Integration", "WIP"})
     public void testCanInstallAndUninstallBundle() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), HELLO_WORLD_JAR);
+        URL jarUrl = getClass().getResource(HELLO_WORLD_JAR);
+        assertNotNull(jarUrl);
+
         karaf = app.createAndManageChild(EntitySpec.create(KarafContainer.class)
             .configure("name", Identifiers.makeRandomId(8))
             .configure("displayName", "Karaf Test")
@@ -124,9 +131,6 @@ public class KarafContainerTest extends BrooklynAppLiveTestSupport {
         
         app.start(ImmutableList.of(localhost));
         
-        URL jarUrl = getClass().getClassLoader().getResource("hello-world.jar");
-        assertNotNull(jarUrl);
-        
         long bundleId = karaf.installBundle("wrap:"+jarUrl.toString());
         
         Map<Long, Map<String,?>> bundles = karaf.listBundles();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d9d3f3bd/software/osgi/src/test/resources/hello-world.txt
----------------------------------------------------------------------
diff --git a/software/osgi/src/test/resources/hello-world.txt b/software/osgi/src/test/resources/hello-world.txt
index 0d88aa6..f3060f0 100644
--- a/software/osgi/src/test/resources/hello-world.txt
+++ b/software/osgi/src/test/resources/hello-world.txt
@@ -20,4 +20,7 @@ simple OSGi bundle that can be deployed.
 
 The jar contains its source code.
 
-It is included as a (small) binary to prevent build complication.
+Under Apache conventions, binary files are not part of the source
+release. If you are using the source release, you may add this file
+by copying it from the master repository, which is accessible on the
+web at https://github.com/apache/incubator-brooklyn


[3/9] incubator-brooklyn git commit: Make embedded wars optional

Posted by ri...@apache.org.
Make embedded wars optional

Modifies code that relies on war files as an embedded resource to
gracefully handle cases where the files are missing. Limited to tests,
which will cause TestNG to skip the test if the resource is missing.
Required for our source distribution, as Apache convention is to not
ship binaries in releases.

Conflicts:
	software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
	software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerEc2LiveTest.java
	software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerEc2LiveTest.java
	software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerIntegrationTest.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/a184a0f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/a184a0f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/a184a0f8

Branch: refs/heads/0.7.0-M2-incubating
Commit: a184a0f8799b0e5a06315fa21a8d122e8ef93f55
Parents: d9d3f3b
Author: Richard Downer <ri...@apache.org>
Authored: Wed Nov 26 16:22:56 2014 +0000
Committer: Richard Downer <ri...@apache.org>
Committed: Tue Dec 9 14:34:03 2014 +0000

----------------------------------------------------------------------
 .../test/java/brooklyn/test/HttpService.java    |  5 ++-
 .../nginx/NginxClusterIntegrationTest.java      | 12 ++++--
 .../nginx/NginxHttpsSslIntegrationTest.java     | 12 ++++--
 .../proxy/nginx/NginxIntegrationTest.java       | 18 +++++----
 .../proxy/nginx/NginxLightIntegrationTest.java  |  3 --
 .../proxy/nginx/NginxRebindIntegrationTest.java | 12 ++++--
 .../nginx/NginxRebindWithHaIntegrationTest.java | 12 ++++--
 .../nginx/NginxUrlMappingIntegrationTest.java   | 41 +++++++++-----------
 .../proxy/nginx/NginxWebClusterEc2LiveTest.java |  8 ++--
 .../AbstractWebAppFixtureIntegrationTest.java   |  2 +
 ...lledDynamicWebAppClusterIntegrationTest.java | 22 ++++++-----
 .../ControlledDynamicWebAppClusterTest.java     | 17 ++++----
 ...ElasticJavaWebAppServiceIntegrationTest.java |  8 +++-
 ...namicWebAppClusterRebindIntegrationTest.java | 13 ++++---
 ...namicWebAppClusterRebindIntegrationTest.java | 12 +++---
 .../webapp/jboss/Jboss6ServerEc2LiveTest.java   | 10 +++--
 .../jboss/Jboss6ServerIntegrationTest.java      | 11 ++++--
 .../webapp/jboss/Jboss7DockerLiveTest.java      |  8 +++-
 .../webapp/jboss/Jboss7ServerEc2LiveTest.java   | 12 ++++--
 .../Jboss7ServerGoogleComputeLiveTest.java      | 12 ++++--
 .../jboss/Jboss7ServerIntegrationTest.java      | 19 ++++-----
 .../Jboss7ServerRebindIntegrationTest.java      | 14 ++++---
 .../webapp/tomcat/TomcatServerEc2LiveTest.java  | 12 ++++--
 .../tomcat/TomcatServerSoftlayerLiveTest.java   | 12 ++++--
 ...omcatServerWebAppFixtureIntegrationTest.java |  2 +
 .../brooklyn/launcher/WebAppRunnerTest.java     |  9 ++++-
 26 files changed, 196 insertions(+), 122 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 aa9a338..2dd8849 100644
--- a/core/src/test/java/brooklyn/test/HttpService.java
+++ b/core/src/test/java/brooklyn/test/HttpService.java
@@ -60,7 +60,8 @@ public class HttpService {
 
     private static final Logger log = LoggerFactory.getLogger(HttpService.class);
 
-    public static final String ROOT_WAR_URL = "classpath://hello-world.war";
+    public static final String ROOT_WAR_PATH = "/hello-world.war";
+    public static final String ROOT_WAR_URL = "classpath:" + ROOT_WAR_PATH;
     public static final String SERVER_KEYSTORE = "classpath://server.ks";
     
     private final boolean httpsEnabled;
@@ -109,6 +110,8 @@ public class HttpService {
     }
 
     public HttpService start() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), ROOT_WAR_PATH);
+
         try {
             if (httpsEnabled) {
                 //by default the server is configured with a http connector, this needs to be removed since we are going

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 bf653f1..31c3a4b 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,6 +24,7 @@ import static org.testng.Assert.assertTrue;
 import java.util.Collections;
 import java.util.List;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeMethod;
@@ -62,7 +63,6 @@ public class NginxClusterIntegrationTest extends BrooklynAppLiveTestSupport {
 
     private static final long TIMEOUT_MS = 60*1000;
     
-    private String war;
     private Location localhostProvisioningLoc;
     private EntityManager entityManager;
     private LoadBalancerCluster loadBalancerCluster;
@@ -73,7 +73,6 @@ public class NginxClusterIntegrationTest extends BrooklynAppLiveTestSupport {
     @Override
     public void setUp() throws Exception {
         super.setUp();
-        war = "classpath://hello-world.war";
         localhostProvisioningLoc = app.newLocalhostProvisioningLocation();
         
         urlMappings = app.createAndManageChild(EntitySpec.create(BasicGroup.class)
@@ -83,6 +82,11 @@ public class NginxClusterIntegrationTest extends BrooklynAppLiveTestSupport {
         nginxSpec = EntitySpec.create(NginxController.class);
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Test(groups = "Integration")
     public void testCreatesNginxInstancesAndResizes() {
         loadBalancerCluster = app.createAndManageChild(EntitySpec.create(LoadBalancerCluster.class)
@@ -107,7 +111,7 @@ public class NginxClusterIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster serverPool = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.ROOT_WAR, war.toString()));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         loadBalancerCluster = app.createAndManageChild(EntitySpec.create(LoadBalancerCluster.class)
                 .configure("serverPool", serverPool)
@@ -129,7 +133,7 @@ public class NginxClusterIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster c1 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.NAMED_WARS, ImmutableList.of(war)));
+                .configure(JavaWebAppService.NAMED_WARS, ImmutableList.of(getTestWar())));
 
         UrlMapping urlMapping = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost")

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 826bd0f..8ba88b7 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,6 +23,7 @@ import static org.testng.Assert.assertTrue;
 
 import java.io.File;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -41,7 +42,6 @@ import brooklyn.entity.webapp.jboss.JBoss7Server;
 import brooklyn.location.Location;
 import brooklyn.test.Asserts;
 import brooklyn.test.HttpTestUtils;
-import brooklyn.test.entity.TestApplication;
 
 import com.google.common.collect.ImmutableList;
 
@@ -56,7 +56,6 @@ public class NginxHttpsSslIntegrationTest extends BrooklynAppLiveTestSupport {
     private DynamicCluster cluster;
     private Location localLoc;
 
-    private static final String WAR_URL = "classpath://hello-world.war";
     private static final String CERTIFICATE_URL = "classpath://ssl/certs/localhost/server.crt";
     private static final String KEY_URL = "classpath://ssl/certs/localhost/server.key";
     
@@ -67,6 +66,11 @@ public class NginxHttpsSslIntegrationTest extends BrooklynAppLiveTestSupport {
         localLoc = mgmt.getLocationRegistry().resolve("localhost");
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     /**
      * Test that the Nginx proxy starts up and sets SERVICE_UP correctly.
      */
@@ -75,7 +79,7 @@ public class NginxHttpsSslIntegrationTest extends BrooklynAppLiveTestSupport {
         cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
             .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
             .configure("initialSize", 1)
-            .configure(JavaWebAppService.ROOT_WAR, WAR_URL));
+            .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         ProxySslConfig ssl = ProxySslConfig.builder()
                 .certificateSourceUrl(CERTIFICATE_URL)
@@ -132,7 +136,7 @@ public class NginxHttpsSslIntegrationTest extends BrooklynAppLiveTestSupport {
         cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
             .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
             .configure("initialSize", 1)
-            .configure(JavaWebAppService.ROOT_WAR, WAR_URL));
+            .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         ProxySslConfig ssl = ProxySslConfig.builder()
                 .certificateDestination(getFile("ssl/certs/localhost/server.crt"))

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 2dd5567..74d6dcf 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,6 +27,7 @@ import static org.testng.Assert.assertTrue;
 
 import java.util.Map;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeMethod;
@@ -56,8 +57,6 @@ import com.google.common.collect.Iterables;
 public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
     private static final Logger log = LoggerFactory.getLogger(NginxIntegrationTest.class);
 
-    static final String HELLO_WAR_URL = "classpath://hello-world.war";
-
     private NginxController nginx;
     private DynamicCluster serverPool;
     private Location localLoc;
@@ -69,6 +68,11 @@ public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
         localLoc = mgmt.getLocationRegistry().resolve("localhost");
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     /**
      * Test that the Nginx proxy starts up and sets SERVICE_UP correctly.
      */
@@ -120,7 +124,7 @@ public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
         serverPool = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.ROOT_WAR, HELLO_WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         nginx = app.createAndManageChild(EntitySpec.create(NginxController.class)
                 .configure("serverPool", serverPool)
@@ -162,7 +166,7 @@ public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
         serverPool = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.ROOT_WAR, HELLO_WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
 
         nginx = app.createAndManageChild(EntitySpec.create(NginxController.class)
                 .configure("serverPool", serverPool)
@@ -205,7 +209,7 @@ public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
         serverPool = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.ROOT_WAR, HELLO_WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         nginx = app.createAndManageChild(EntitySpec.create(NginxController.class)
                 .configure("serverPool", serverPool)
@@ -281,7 +285,7 @@ public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
         serverPool = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.ROOT_WAR, HELLO_WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         nginx = app.createAndManageChild(EntitySpec.create(NginxController.class)
                 .configure("serverPool", serverPool));
@@ -341,7 +345,7 @@ public class NginxIntegrationTest extends BrooklynAppLiveTestSupport {
         serverPool = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class))
                 .configure("initialSize", 1)
-                .configure(JavaWebAppService.ROOT_WAR, HELLO_WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         nginx = app.createAndManageChild(EntitySpec.create(NginxController.class)
                 .configure("serverPool", serverPool));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxLightIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxLightIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxLightIntegrationTest.java
index 4605735..b55e598 100644
--- a/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxLightIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/proxy/nginx/NginxLightIntegrationTest.java
@@ -44,9 +44,6 @@ public class NginxLightIntegrationTest extends BrooklynAppUnitTestSupport {
     private NginxController nginx;
     private DynamicCluster cluster;
 
-    private URL war;
-    private static final String WAR_URL = "classpath://hello-world.war";
-    
     // FIXME Fails because getting addEntity callback for group members while nginx is still starting,
     // so important nginx fields are still null. Therefore get NPE for cluster members, and thus targets
     // is of size zero.

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 364ef47..1965212 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
@@ -30,6 +30,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -65,7 +66,6 @@ public class NginxRebindIntegrationTest extends RebindTestFixtureWithApp {
 
     private static final Logger LOG = LoggerFactory.getLogger(NginxRebindIntegrationTest.class);
 
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
     private List<WebAppMonitor> webAppMonitors = new CopyOnWriteArrayList<WebAppMonitor>();
     private ExecutorService executor;
@@ -81,11 +81,15 @@ public class NginxRebindIntegrationTest extends RebindTestFixtureWithApp {
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
         super.setUp();
-        warUrl = getClass().getClassLoader().getResource("hello-world.war");
         localhostProvisioningLocation = origManagementContext.getLocationManager().createLocation(LocationSpec.create(LocalhostMachineProvisioningLocation.class));
         executor = Executors.newCachedThreadPool();
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @AfterMethod(alwaysRun=true)
     public void tearDown() throws Exception {
         for (WebAppMonitor monitor : webAppMonitors) {
@@ -156,7 +160,7 @@ public class NginxRebindIntegrationTest extends RebindTestFixtureWithApp {
         
         // Set up nginx with a server pool
         DynamicCluster origServerPool = origApp.createAndManageChild(EntitySpec.create(DynamicCluster.class)
-                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString()))
+                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("war", getTestWar()))
                 .configure("initialSize", 1));
         
         NginxController origNginx = origApp.createAndManageChild(EntitySpec.create(NginxController.class)
@@ -229,7 +233,7 @@ public class NginxRebindIntegrationTest extends RebindTestFixtureWithApp {
                 .configure("childrenAsMembers", true));
         
         DynamicCluster origServerPool = origApp.createAndManageChild(EntitySpec.create(DynamicCluster.class)
-                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString()))
+                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("war", getTestWar()))
                 .configure("initialSize", 1)); 
 
         UrlMapping origMapping = origApp.getManagementContext().getEntityManager().createEntity(EntitySpec.create(UrlMapping.class)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 6575d0b..6a32428 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,6 +26,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -69,7 +70,6 @@ public class NginxRebindWithHaIntegrationTest extends RebindTestFixtureWithApp {
 
     private static final Logger LOG = LoggerFactory.getLogger(NginxRebindWithHaIntegrationTest.class);
 
-    private URL warUrl;
     private List<WebAppMonitor> webAppMonitors = new CopyOnWriteArrayList<WebAppMonitor>();
     private ExecutorService executor;
     private LocalhostMachineProvisioningLocation loc;
@@ -83,11 +83,15 @@ public class NginxRebindWithHaIntegrationTest extends RebindTestFixtureWithApp {
         // to set things like correct Java on path.
         return true;
     }
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
         super.setUp();
-        warUrl = getClass().getClassLoader().getResource("hello-world.war");
         loc = origManagementContext.getLocationManager().createLocation(LocationSpec.create(LocalhostMachineProvisioningLocation.class)
             .configure("address", Networking.getLocalHost())
             .configure(SshTool.PROP_TOOL_CLASS, RecordingSshjTool.class.getName()));
@@ -123,7 +127,7 @@ public class NginxRebindWithHaIntegrationTest extends RebindTestFixtureWithApp {
     @Test(groups = "Integration")
     public void testChangeModeFailureStopsTasksButHappyUponResumption() throws Exception {
         DynamicCluster origServerPool = origApp.createAndManageChild(EntitySpec.create(DynamicCluster.class)
-                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(TomcatServer.class).configure("war", warUrl.toString()))
+                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(TomcatServer.class).configure("war", getTestWar()))
                 .configure("initialSize", 1));
         
         NginxController origNginx = origApp.createAndManageChild(EntitySpec.create(NginxController.class)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 2ed881e..d1f2fcb 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
@@ -19,19 +19,18 @@
 package brooklyn.entity.proxy.nginx;
 
 import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 import java.net.Inet4Address;
 import java.net.InetAddress;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeMethod;
@@ -71,23 +70,16 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
     
     private static final Logger log = LoggerFactory.getLogger(NginxUrlMappingIntegrationTest.class);
 
-    private static final String WAR_URL = "classpath://hello-world.war";
-    
     private NginxController nginx;
-    private DynamicCluster cluster;
     private Group urlMappingsGroup;
     private EntityManager entityManager;
     private LocalhostMachineProvisioningLocation localLoc;
     
-    private URL war;
-
     @BeforeMethod(alwaysRun=true)
     @Override
     public void setUp() throws Exception {
         super.setUp();
-        war = getClass().getClassLoader().getResource("hello-world.war");
-        assertNotNull(war, "Unable to locate hello-world.war resource");
-        
+
         urlMappingsGroup = app.createAndManageChild(EntitySpec.create(BasicGroup.class)
                 .configure("childrenAsMembers", true));
         entityManager = app.getManagementContext().getEntityManager();
@@ -95,6 +87,11 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         localLoc = new LocalhostMachineProvisioningLocation();
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     protected void checkExtraLocalhosts() throws Exception {
         Set<String> failedHosts = Sets.newLinkedHashSet();
         List<String> allHosts = ImmutableList.of("localhost", "localhost1", "localhost2", "localhost3", "localhost4");
@@ -125,7 +122,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster c0 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.ROOT_WAR, WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         UrlMapping u0 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost1")
                 .configure("target", c0)
@@ -136,7 +133,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster c1 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.NAMED_WARS, ImmutableList.of(WAR_URL)));
+                .configure(JavaWebAppService.NAMED_WARS, ImmutableList.of(getTestWar())));
         UrlMapping u1 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost2")
                 .configure("path", "/hello-world($|/.*)")
@@ -160,7 +157,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         app.start(ImmutableList.of(localLoc));
         final int port = nginx.getAttribute(NginxController.PROXY_HTTP_PORT);
         for (Entity member : c2.getMembers()) {
-            ((JBoss7Server)member).deploy(war.toString(), "c2.war");
+            ((JBoss7Server)member).deploy(getTestWar(), "c2.war");
         }
     
         Entities.dumpInfo(app);
@@ -236,10 +233,10 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         final int port = nginx.getAttribute(NginxController.PROXY_HTTP_PORT);
         
         for (Entity child : c0.getMembers()) {
-            ((JBoss7Server)child).deploy(war.toString(), "atC0.war");
+            ((JBoss7Server)child).deploy(getTestWar(), "atC0.war");
         }
         for (Entity child : c1.getMembers()) {
-            ((JBoss7Server)child).deploy(war.toString(), "atC1.war");
+            ((JBoss7Server)child).deploy(getTestWar(), "atC1.war");
         }
 
         // Confirm routes requests to the correct cluster
@@ -262,7 +259,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster c0 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.ROOT_WAR, war.toString()));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         UrlMapping u0 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost2")
                 .configure("target", c0)
@@ -296,12 +293,12 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster coreCluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.ROOT_WAR, war.toString()));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         
         DynamicCluster c1 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.NAMED_WARS, ImmutableList.of(war.toString())));
+                .configure(JavaWebAppService.NAMED_WARS, ImmutableList.of(getTestWar())));
         UrlMapping u1 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost1")
                 .configure("target", c1)
@@ -338,7 +335,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster c0 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.ROOT_WAR, WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         UrlMapping u0 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost1")
                 .configure("target", c0)
@@ -391,7 +388,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         final DynamicCluster c1 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.ROOT_WAR, war.toString()));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         final UrlMapping u1 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost1")
                 .configure("target", c1)
@@ -474,7 +471,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         final int port = nginx.getAttribute(NginxController.PROXY_HTTP_PORT);
         
         for (Entity child : c0.getMembers()) {
-            ((JBoss7Server)child).deploy(war.toString(), "atC0.war");
+            ((JBoss7Server)child).deploy(getTestWar(), "atC0.war");
         }
 
         // Confirm routes requests to the correct cluster
@@ -497,7 +494,7 @@ public class NginxUrlMappingIntegrationTest extends BrooklynAppLiveTestSupport {
         DynamicCluster c0 = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure("initialSize", 1)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class).configure("httpPort", "8100+"))
-                .configure(JavaWebAppService.ROOT_WAR, WAR_URL));
+                .configure(JavaWebAppService.ROOT_WAR, getTestWar()));
         UrlMapping u0 = entityManager.createEntity(EntitySpec.create(UrlMapping.class)
                 .configure("domain", "localhost1")
                 .configure("target", c0)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 12df430..2e90749 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,6 +22,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -74,11 +75,12 @@ public class NginxWebClusterEc2LiveTest {
     public void shutdown() {
         if (app != null) Entities.destroyAll(app.getManagementContext());
     }
-    
+
     @Test(groups = "Live")
     public void testProvisionAwsCluster() {
-        String warName = "hello-world.war";
-        URL war = getClass().getClassLoader().getResource(warName);
+        String warName = "/hello-world.war";
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), warName);
+        URL war = getClass().getResource(warName);
         assertNotNull(war, "Unable to locate resource "+warName);
         
         cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 4569a59..8af8c9c 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/AbstractWebAppFixtureIntegrationTest.java
@@ -34,6 +34,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterClass;
@@ -405,6 +406,7 @@ public abstract class AbstractWebAppFixtureIntegrationTest {
      */
     @DataProvider(name = "entitiesWithWarAndURL")
     public Object[][] entitiesWithWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world-no-mapping.war");
         List<Object[]> result = Lists.newArrayList();
         
         for (Object[] entity : basicEntities()) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 4d97b40..ad19b6b 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterIntegrationTest.java
@@ -21,10 +21,10 @@ package brooklyn.entity.webapp;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 
-import java.net.URL;
 import java.util.List;
 import java.util.concurrent.Callable;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeMethod;
@@ -58,25 +58,27 @@ public class ControlledDynamicWebAppClusterIntegrationTest extends BrooklynAppLi
 
     private static final int TIMEOUT_MS = 10*1000;
     
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation loc;
     private List<LocalhostMachineProvisioningLocation> locs;
     
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
         super.setUp();
-        String warPath = "hello-world.war";
-        warUrl = getClass().getClassLoader().getResource(warPath);
-        
+
         loc = app.newLocalhostProvisioningLocation();
         locs = ImmutableList.of(loc);
     }
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Test(groups="Integration")
     public void testConfiguresController() {
         ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
                 .configure("initialSize", 1)
-                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString())));
+                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", getTestWar())));
         app.start(locs);
 
         String url = cluster.getController().getAttribute(NginxController.ROOT_URL);
@@ -88,7 +90,7 @@ public class ControlledDynamicWebAppClusterIntegrationTest extends BrooklynAppLi
     public void testSetsToplevelHostnameFromController() {
         ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
                 .configure("initialSize", 1)
-                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString())));
+                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", getTestWar())));
         app.start(locs);
 
         String expectedHostname = cluster.getController().getAttribute(LoadBalancer.HOSTNAME);
@@ -108,7 +110,7 @@ public class ControlledDynamicWebAppClusterIntegrationTest extends BrooklynAppLi
         ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
                 .configure("initialSize", 1)
                 .configure(ControlledDynamicWebAppCluster.MEMBER_SPEC, EntitySpec.create(JBoss7Server.class)
-                        .configure(JBoss7Server.ROOT_WAR, warUrl.toString()))
+                        .configure(JBoss7Server.ROOT_WAR, getTestWar()))
                 .configure(ControlledDynamicWebAppCluster.WEB_CLUSTER_SPEC, EntitySpec.create(DynamicWebAppCluster.class)
                         .displayName("mydisplayname")));
         app.start(locs);
@@ -147,7 +149,7 @@ public class ControlledDynamicWebAppClusterIntegrationTest extends BrooklynAppLi
     public void testTomcatAbsoluteRedirect() {
         final ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
             .configure(ControlledDynamicWebAppCluster.MEMBER_SPEC, EntitySpec.create(TomcatServer.class)
-                    .configure(TomcatServer.ROOT_WAR, "classpath://hello-world.war"))
+            .configure(TomcatServer.ROOT_WAR, getTestWar()))
             .configure("initialSize", 1)
             .configure(AbstractController.SERVICE_UP_URL_PATH, "hello/redirectAbsolute")
         );

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 54509b7..1fb0d84 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/ControlledDynamicWebAppClusterTest.java
@@ -23,6 +23,7 @@ import static org.testng.Assert.assertEquals;
 import java.net.URL;
 import java.util.List;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.BeforeMethod;
@@ -51,20 +52,22 @@ import com.google.common.collect.Lists;
 public class ControlledDynamicWebAppClusterTest extends BrooklynAppUnitTestSupport {
     private static final Logger log = LoggerFactory.getLogger(ControlledDynamicWebAppClusterTest.class);
 
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation loc;
     private List<LocalhostMachineProvisioningLocation> locs;
     
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
         super.setUp();
-        String warPath = "hello-world.war";
-        warUrl = getClass().getClassLoader().getResource(warPath);
-        
+
         loc = app.newLocalhostProvisioningLocation();
         locs = ImmutableList.of(loc);
     }
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Test
     public void testUsesCustomController() {
         AbstractController controller = app.createAndManageChild(EntitySpec.create(TrackingAbstractController.class).displayName("mycustom"));
@@ -72,7 +75,7 @@ public class ControlledDynamicWebAppClusterTest extends BrooklynAppUnitTestSuppo
         ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
                 .configure("initialSize", 0)
                 .configure(ControlledDynamicWebAppCluster.CONTROLLER, controller)
-                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString())));
+                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", getTestWar())));
         app.start(locs);
 
         EntityTestUtils.assertAttributeEqualsEventually(controller, AbstractController.SERVICE_UP, true);
@@ -89,7 +92,7 @@ public class ControlledDynamicWebAppClusterTest extends BrooklynAppUnitTestSuppo
         ControlledDynamicWebAppCluster cluster = app.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
                 .configure("initialSize", 0)
                 .configure(ControlledDynamicWebAppCluster.CONTROLLER_SPEC, controllerSpec)
-                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString())));
+                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", getTestWar())));
         app.start(locs);
         LoadBalancer controller = cluster.getController();
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 eb90157..de8c0d9 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/ElasticJavaWebAppServiceIntegrationTest.java
@@ -18,6 +18,7 @@
  */
 package brooklyn.entity.webapp;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
@@ -48,10 +49,15 @@ public class ElasticJavaWebAppServiceIntegrationTest {
         if (app != null) Entities.destroyAll(app.getManagementContext());
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Test(groups = "Integration")
     public void testFactory() {
         ElasticJavaWebAppService svc =
-            new ElasticJavaWebAppService.Factory().newEntity(MutableMap.of("war", "classpath://hello-world.war"), app);
+            new ElasticJavaWebAppService.Factory().newEntity(MutableMap.of("war", getTestWar()), app);
         Entities.manage(svc);
         app.start(ImmutableList.of(loc));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 777742e..ce45794 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
@@ -21,16 +21,15 @@ package brooklyn.entity.webapp.jboss;
 import static brooklyn.test.EntityTestUtils.assertAttributeEqualsEventually;
 import static brooklyn.test.HttpTestUtils.assertHttpStatusCodeEquals;
 import static brooklyn.test.HttpTestUtils.assertHttpStatusCodeEventuallyEquals;
-import static com.google.common.base.Preconditions.checkNotNull;
 import static org.testng.Assert.assertEquals;
 
 import java.io.File;
-import java.net.URL;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -61,7 +60,6 @@ public class ControlledDynamicWebAppClusterRebindIntegrationTest {
     
     static { TimeExtras.init(); }
 
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
     private TestApplication origApp;
     private TestApplication newApp;
@@ -74,8 +72,6 @@ public class ControlledDynamicWebAppClusterRebindIntegrationTest {
     
     @BeforeMethod(alwaysRun=true)
     public void setUp() {
-        String warPath = "hello-world.war";
-        warUrl = checkNotNull(getClass().getClassLoader().getResource(warPath), "warUrl");
         executor = Executors.newCachedThreadPool();
 
         mementoDir = Files.createTempDir();
@@ -97,6 +93,11 @@ public class ControlledDynamicWebAppClusterRebindIntegrationTest {
         if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir);
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     private TestApplication rebind() throws Exception {
         RebindTestUtils.waitForPersisted(origApp);
         
@@ -120,7 +121,7 @@ public class ControlledDynamicWebAppClusterRebindIntegrationTest {
         NginxController origNginx = origApp.createAndManageChild(EntitySpec.create(NginxController.class).configure("domain", "localhost"));
 
         origApp.createAndManageChild(EntitySpec.create(ControlledDynamicWebAppCluster.class)
-                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString()))
+                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", getTestWar()))
                 .configure("initialSize", 1)
                 .configure("controller", origNginx));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 0005f49..c1624d9 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,6 +30,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -56,7 +57,6 @@ import com.google.common.io.Files;
 public class DynamicWebAppClusterRebindIntegrationTest {
     private static final Logger LOG = LoggerFactory.getLogger(DynamicWebAppClusterRebindIntegrationTest.class);
     
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
     private TestApplication origApp;
     private TestApplication newApp;
@@ -69,9 +69,6 @@ public class DynamicWebAppClusterRebindIntegrationTest {
     
     @BeforeMethod(groups = "Integration")
     public void setUp() {
-        String warPath = "hello-world.war";
-        warUrl = getClass().getClassLoader().getResource(warPath);
-        
         executor = Executors.newCachedThreadPool();
 
         mementoDir = Files.createTempDir();
@@ -92,6 +89,11 @@ public class DynamicWebAppClusterRebindIntegrationTest {
         if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir);
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     private TestApplication rebind() throws Exception {
         RebindTestUtils.waitForPersisted(origApp);
         
@@ -113,7 +115,7 @@ public class DynamicWebAppClusterRebindIntegrationTest {
     @Test(groups = "Integration")
     public void testRebindsToRunningCluster() throws Exception {
         DynamicWebAppCluster origCluster = origApp.createAndManageChild(EntitySpec.create(DynamicWebAppCluster.class)
-                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", warUrl.toString()))
+                .configure("memberSpec", EntitySpec.create(JBoss7Server.class).configure("war", getTestWar()))
                 .configure("initialSize", 1));
         
         origApp.start(ImmutableList.of(localhostProvisioningLocation));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerEc2LiveTest.java
index 92d07c3..8dc7c70 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerEc2LiveTest.java
@@ -23,6 +23,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.annotations.Test;
 
 import brooklyn.entity.AbstractEc2LiveTest;
@@ -38,12 +39,15 @@ import com.google.common.collect.ImmutableList;
  */
 public class Jboss6ServerEc2LiveTest extends AbstractEc2LiveTest {
     
-    private URL warUrl = checkNotNull(getClass().getClassLoader().getResource("hello-world.war"));
-    
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world-no-mapping.war");
+        return "classpath://hello-world-no-mapping.war";
+    }
+
     @Override
     protected void doTest(Location loc) throws Exception {
         final JBoss6Server server = app.createAndManageChild(EntitySpec.create(JBoss6Server.class)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWar()));
         
         app.start(ImmutableList.of(loc));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerIntegrationTest.java
index e3fd800..922b9eb 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss6ServerIntegrationTest.java
@@ -23,6 +23,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
@@ -49,18 +50,20 @@ public class Jboss6ServerIntegrationTest extends BrooklynAppLiveTestSupport {
     // Port increment for JBoss 6.
     public static final int PORT_INCREMENT = 400;
 
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
     
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
         super.setUp();
-        String warPath = "hello-world-no-mapping.war";
-        warUrl = getClass().getClassLoader().getResource(warPath);
 
         localhostProvisioningLocation = app.newLocalhostProvisioningLocation();
     }
 
+    public String getTestWarWithNoMapping() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world-no-mapping.war");
+        return "classpath://hello-world-no-mapping.war";
+    }
+
     @Test(groups = "Integration")
     public void testJmxmp() throws Exception {
         runTest(UsesJmx.JmxAgentModes.JMXMP);
@@ -80,7 +83,7 @@ public class Jboss6ServerIntegrationTest extends BrooklynAppLiveTestSupport {
         final JBoss6Server server = app.createAndManageChild(EntitySpec.create(JBoss6Server.class)
                 .configure(JBoss6Server.PORT_INCREMENT, PORT_INCREMENT)
                 .configure(UsesJmx.JMX_AGENT_MODE, jmxAgentMode)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWarWithNoMapping()));
 
         app.start(ImmutableList.of(localhostProvisioningLocation));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7DockerLiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7DockerLiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7DockerLiveTest.java
index e29b9b7..decfced 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7DockerLiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7DockerLiveTest.java
@@ -23,6 +23,7 @@ import brooklyn.entity.software.AbstractDockerLiveTest;
 import brooklyn.location.Location;
 import brooklyn.test.Asserts;
 import brooklyn.test.HttpTestUtils;
+import brooklyn.test.TestResourceUnavailableException;
 import com.google.common.collect.ImmutableList;
 import org.testng.annotations.Test;
 
@@ -36,12 +37,15 @@ import static org.testng.Assert.assertNotNull;
  */
 public class Jboss7DockerLiveTest extends AbstractDockerLiveTest {
 
-   private URL warUrl = checkNotNull(getClass().getClassLoader().getResource("hello-world.war"));
+   public String getTestWar() {
+      TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+      return "classpath://hello-world.war";
+   }
 
    @Override
    protected void doTest(Location loc) throws Exception {
       final JBoss7Server server = app.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-              .configure("war", warUrl.toString()));
+              .configure("war", getTestWar()));
 
       app.start(ImmutableList.of(loc));
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerEc2LiveTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerEc2LiveTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerEc2LiveTest.java
index d041e18..904388c 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerEc2LiveTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerEc2LiveTest.java
@@ -23,6 +23,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.annotations.Test;
 
 import brooklyn.entity.AbstractEc2LiveTest;
@@ -37,13 +38,16 @@ import com.google.common.collect.ImmutableList;
  * A simple test of installing+running on AWS-EC2, using various OS distros and versions. 
  */
 public class Jboss7ServerEc2LiveTest extends AbstractEc2LiveTest {
-    
-    private URL warUrl = checkNotNull(getClass().getClassLoader().getResource("hello-world.war"));
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Override
     protected void doTest(Location loc) throws Exception {
         final JBoss7Server server = app.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWar()));
         
         app.start(ImmutableList.of(loc));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 3563aa9..e067c59 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,6 +23,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.annotations.Test;
 
 import brooklyn.entity.AbstractGoogleComputeLiveTest;
@@ -37,13 +38,16 @@ import com.google.common.collect.ImmutableList;
  * A simple test of installing+running on AWS-EC2, using various OS distros and versions. 
  */
 public class Jboss7ServerGoogleComputeLiveTest extends AbstractGoogleComputeLiveTest {
-    
-    private URL warUrl = checkNotNull(getClass().getClassLoader().getResource("hello-world.war"));
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Override
     protected void doTest(Location loc) throws Exception {
         final JBoss7Server server = app.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWar()));
         
         app.start(ImmutableList.of(loc));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerIntegrationTest.java
index a6cf0b8..de2fac3 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerIntegrationTest.java
@@ -23,10 +23,10 @@ import static org.testng.Assert.assertNotNull;
 
 import java.io.File;
 import java.io.FileOutputStream;
-import java.net.URL;
+
 import java.security.KeyStore;
 import java.security.cert.Certificate;
-
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -54,16 +54,12 @@ import com.google.common.collect.ImmutableSet;
 public class Jboss7ServerIntegrationTest {
     private static final Logger LOG = LoggerFactory.getLogger(Jboss7ServerIntegrationTest.class);
     
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
     private TestApplication app;
     private File keystoreFile;
     
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
-        String warPath = "hello-world.war";
-        warUrl = getClass().getClassLoader().getResource(warPath);
-
         localhostProvisioningLocation = new LocalhostMachineProvisioningLocation();
         app = ApplicationBuilder.newManagedApp(TestApplication.class);
         keystoreFile = createTemporaryKeyStore("myname", "mypass");
@@ -95,10 +91,15 @@ public class Jboss7ServerIntegrationTest {
         }
     }
     
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Test(groups = "Integration")
     public void testHttp() throws Exception {
         final JBoss7Server server = app.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWar()));
         
         app.start(ImmutableList.of(localhostProvisioningLocation));
         
@@ -126,7 +127,7 @@ public class Jboss7ServerIntegrationTest {
     @Test(groups = {"Integration"})
     public void testHttps() throws Exception {
         final JBoss7Server server = app.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-                .configure("war", warUrl.toString())
+                .configure("war", getTestWar())
                 .configure(JBoss7Server.ENABLED_PROTOCOLS, ImmutableSet.of("https"))
                 .configure(JBoss7Server.HTTPS_SSL_CONFIG, new HttpsSslConfig().keyAlias("myname").keystorePassword("mypass").keystoreUrl(keystoreFile.getAbsolutePath())));
         
@@ -163,7 +164,7 @@ public class Jboss7ServerIntegrationTest {
     @Test(groups = {"Integration"})
     public void testHttpAndHttps() throws Exception {
         final JBoss7Server server = app.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-                .configure("war", warUrl.toString())
+                .configure("war", getTestWar())
                 .configure(JBoss7Server.ENABLED_PROTOCOLS, ImmutableSet.of("http", "https"))
                 .configure(JBoss7Server.HTTPS_SSL_CONFIG, new HttpsSslConfig().keyAlias("myname").keystorePassword("mypass").keystoreUrl(keystoreFile.getAbsolutePath())));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerRebindIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerRebindIntegrationTest.java b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerRebindIntegrationTest.java
index 9a1bd5e..2705690 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerRebindIntegrationTest.java
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/jboss/Jboss7ServerRebindIntegrationTest.java
@@ -20,12 +20,12 @@ package brooklyn.entity.webapp.jboss;
 
 import static org.testng.Assert.assertEquals;
 
-import java.net.URL;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -52,7 +52,6 @@ import com.google.common.collect.Iterables;
 public class Jboss7ServerRebindIntegrationTest extends RebindTestFixtureWithApp {
     private static final Logger LOG = LoggerFactory.getLogger(Jboss7ServerRebindIntegrationTest.class);
     
-    private URL warUrl;
     private LocalhostMachineProvisioningLocation localhostProvisioningLocation;
     private TestApplication newApp;
     private List<WebAppMonitor> webAppMonitors = new CopyOnWriteArrayList<WebAppMonitor>();
@@ -62,8 +61,6 @@ public class Jboss7ServerRebindIntegrationTest extends RebindTestFixtureWithApp
     @Override
     public void setUp() throws Exception {
         super.setUp();
-        String warPath = "hello-world.war";
-        warUrl = getClass().getClassLoader().getResource(warPath);
         executor = Executors.newCachedThreadPool();
         localhostProvisioningLocation = (LocalhostMachineProvisioningLocation) origManagementContext.getLocationRegistry().resolve("localhost");
     }
@@ -78,6 +75,11 @@ public class Jboss7ServerRebindIntegrationTest extends RebindTestFixtureWithApp
         super.tearDown();
     }
 
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     private WebAppMonitor newWebAppMonitor(String url) {
         WebAppMonitor monitor = new WebAppMonitor(url)
 //                .delayMillis(0)
@@ -91,7 +93,7 @@ public class Jboss7ServerRebindIntegrationTest extends RebindTestFixtureWithApp
     public void testRebindsToRunningServer() throws Exception {
         // Start an app-server, and wait for it to be fully up
         JBoss7Server origServer = origApp.createAndManageChild(EntitySpec.create(JBoss7Server.class)
-                    .configure("war", warUrl.toString()));
+                    .configure("war", getTestWar()));
         
         origApp.start(ImmutableList.of(localhostProvisioningLocation));
         
@@ -111,7 +113,7 @@ public class Jboss7ServerRebindIntegrationTest extends RebindTestFixtureWithApp
         HttpTestUtils.assertHttpStatusCodeEventuallyEquals(newRootUrl, 200);
 
         // confirm that deploy() effector affects the correct jboss server 
-        newServer.deploy(warUrl.toString(), "myhello.war");
+        newServer.deploy(getTestWar(), "myhello.war");
         HttpTestUtils.assertHttpStatusCodeEventuallyEquals(newRootUrl+"myhello", 200);
         
         // check we see evidence of the enrichers and sensor-feeds having an effect.

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 db7e373..ec7f0a1 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,6 +23,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.annotations.Test;
 
 import brooklyn.entity.AbstractEc2LiveTest;
@@ -37,13 +38,16 @@ import com.google.common.collect.ImmutableList;
  * A simple test of installing+running on AWS-EC2, using various OS distros and versions. 
  */
 public class TomcatServerEc2LiveTest extends AbstractEc2LiveTest {
-    
-    private URL warUrl = checkNotNull(getClass().getClassLoader().getResource("hello-world.war"));
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Override
     protected void doTest(Location loc) throws Exception {
         final TomcatServer server = app.createAndManageChild(EntitySpec.create(TomcatServer.class)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWar()));
         
         app.start(ImmutableList.of(loc));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 9409cf5..7772a39 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,6 +23,7 @@ import static org.testng.Assert.assertNotNull;
 
 import java.net.URL;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.testng.annotations.Test;
 
 import brooklyn.entity.AbstractSoftlayerLiveTest;
@@ -37,13 +38,16 @@ import com.google.common.collect.ImmutableList;
  * A simple test of installing+running on Softlayer, using various OS distros and versions. 
  */
 public class TomcatServerSoftlayerLiveTest extends AbstractSoftlayerLiveTest {
-    
-    private URL warUrl = checkNotNull(getClass().getClassLoader().getResource("hello-world.war"));
-    
+
+    public String getTestWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+        return "classpath://hello-world.war";
+    }
+
     @Override
     protected void doTest(Location loc) throws Exception {
         final TomcatServer server = app.createAndManageChild(EntitySpec.create(TomcatServer.class)
-                .configure("war", warUrl.toString()));
+                .configure("war", getTestWar()));
         
         app.start(ImmutableList.of(loc));
         

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 9942dd3..d171332 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
@@ -26,6 +26,7 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -68,6 +69,7 @@ public class TomcatServerWebAppFixtureIntegrationTest extends AbstractWebAppFixt
     // as parent, but with spring travel
     @DataProvider(name = "entitiesWithWarAndURL")
     public Object[][] entitiesWithWar() {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
         List<Object[]> result = Lists.newArrayList();
         
         for (Object[] entity : basicEntities()) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a184a0f8/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 2fbd131..23018c3 100644
--- a/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java
+++ b/usage/launcher/src/test/java/brooklyn/launcher/WebAppRunnerTest.java
@@ -24,6 +24,7 @@ import static org.testng.Assert.fail;
 import java.util.List;
 import java.util.Map;
 
+import brooklyn.test.TestResourceUnavailableException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.annotations.AfterMethod;
@@ -94,9 +95,11 @@ public class WebAppRunnerTest {
     public static void assertBrooklynEventuallyAt(String url) {
         HttpTestUtils.assertContentEventuallyContainsText(url, "Brooklyn Web Console");
     }
-    
+
     @Test
     public void testStartSecondaryWar() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+
         if (!Networking.isPortAvailable(8090))
             fail("Another process is using port 8090 which is required for this test.");
         BrooklynWebServer server = createWebServer(
@@ -117,6 +120,8 @@ public class WebAppRunnerTest {
 
     @Test
     public void testStartSecondaryWarAfter() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+
         if (!Networking.isPortAvailable(8090))
             fail("Another process is using port 8090 which is required for this test.");
         BrooklynWebServer server = createWebServer(MutableMap.of("port", 8090, "war", "brooklyn.war"));
@@ -137,6 +142,8 @@ public class WebAppRunnerTest {
 
     @Test
     public void testStartWithLauncher() throws Exception {
+        TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), "/hello-world.war");
+
         BrooklynLauncher launcher = BrooklynLauncher.newInstance()
                 .brooklynProperties("brooklyn.webconsole.security.provider","brooklyn.rest.security.provider.AnyoneSecurityProvider")
                 .webapp("/hello", "hello-world.war")