You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2015/08/20 22:29:00 UTC

[10/11] incubator-brooklyn git commit: update the standalone brooklyn-AppInCatalog.jar to refer to new packages, and re-enable disabled test

update the standalone brooklyn-AppInCatalog.jar to refer to new packages, and re-enable disabled test


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

Branch: refs/heads/master
Commit: 1c50b342375527531aeeef416a54e53e382c2e68
Parents: 1927ad4
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Thu Aug 20 14:49:17 2015 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Thu Aug 20 15:36:13 2015 +0100

----------------------------------------------------------------------
 .../mgmt/rebind/RebindCatalogEntityTest.java    |  11 +++---
 .../entity/rebind/brooklyn-AppInCatalog.jar     | Bin 2387 -> 0 bytes
 .../entity/rebind/brooklyn-AppInCatalog.txt     |  28 --------------
 .../brooklyn-AppInCatalog.jar                   | Bin 0 -> 2891 bytes
 .../brooklyn-AppInCatalog.txt                   |  38 +++++++++++++++++++
 5 files changed, 43 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1c50b342/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogEntityTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogEntityTest.java b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogEntityTest.java
index 4d03e05..a109f13 100644
--- a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogEntityTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindCatalogEntityTest.java
@@ -63,8 +63,8 @@ public class RebindCatalogEntityTest extends RebindTestFixture<StartableApplicat
      * }
      */
 
-    private static final String JAR_PATH = "/brooklyn/entity/rebind/brooklyn-AppInCatalog.jar";
-    private static final String APP_CLASSNAME = "brooklyn.entity.rebind.AppInCatalog";
+    private static final String JAR_PATH = "/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.jar";
+    private static final String APP_CLASSNAME = "org.apache.brooklyn.core.test.rebind.sample_app_in_catalog.AppInCatalog";
 
     private URL url;
 
@@ -94,7 +94,7 @@ public class RebindCatalogEntityTest extends RebindTestFixture<StartableApplicat
     //       AbstractMemento.injectTypeClass(Class)
     //
     // NB: this behaviour is generally deprecated in favour of OSGi now.
-    // @Test FIXME [BROOKLYN-162] 
+    @Test 
     public void testRestoresAppFromCatalogClassloader() throws Exception {
         @SuppressWarnings("unchecked")
         Class<? extends AbstractApplication> appClazz = (Class<? extends AbstractApplication>) new UrlClassLoader(url).loadClass(APP_CLASSNAME);
@@ -117,10 +117,9 @@ public class RebindCatalogEntityTest extends RebindTestFixture<StartableApplicat
     
     @Test(invocationCount=100, groups="Integration")
     public void testRestoresAppFromCatalogClassloaderManyTimes() throws Exception {
-        // FIXME [BROOKLYN-162]
-    	// Need to fix package name and rebuild brooklyn-AppInCatalog.jar
+	    // Need to fix package name and rebuild brooklyn-AppInCatalog.jar
     	//  or better add it as a new test-bundles subproject
-    	// testRestoresAppFromCatalogClassloader();
+    	testRestoresAppFromCatalogClassloader();
     }
     
     // TODO Not using RebindTestUtils.rebind(mementoDir, getClass().getClassLoader());

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1c50b342/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.jar
----------------------------------------------------------------------
diff --git a/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.jar b/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.jar
deleted file mode 100644
index 65cf29d..0000000
Binary files a/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1c50b342/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
deleted file mode 100644
index b4f6a9f..0000000
--- a/core/src/test/resources/brooklyn/entity/rebind/brooklyn-AppInCatalog.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-The file brooklyn-AppInCatalog.txt is used in RebindCatalogEntityTest, 
-to test catalog.addItem where that item is in a jar not originally
-on the classpath.
-
-The jar contains its source code. 
-
-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/1c50b342/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.jar
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.jar b/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.jar
new file mode 100644
index 0000000..eac5abd
Binary files /dev/null and b/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.jar differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1c50b342/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.txt b/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.txt
new file mode 100644
index 0000000..3bbd4a5
--- /dev/null
+++ b/core/src/test/resources/org/apache/brooklyn/core/test/rebind/sample-app-in-catalog/brooklyn-AppInCatalog.txt
@@ -0,0 +1,38 @@
+# 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.
+
+The file brooklyn-AppInCatalog.txt is used in RebindCatalogEntityTest, 
+to test catalog.addItem where that item is in a jar not originally
+on the classpath.
+
+The jar contains its source code. 
+
+Assuming the `dist` is built, you can expand and rebuild it 
+(optionally making edits halfway through) with:
+
+    mkdir tmp ; cd tmp ; jar xvf ../brooklyn-AppInCatalog.jar
+    javac -cp "../../../../../../../../../../../../usage/dist/target/brooklyn-dist/brooklyn/lib/brooklyn/*" org/apache/brooklyn/core/test/rebind/sample_app_in_catalog/AppInCatalog.java 
+    jar cvf ../brooklyn-AppInCatalog.jar.new .
+    cd ..
+    mv brooklyn-AppInCatalog.jar.new brooklyn-AppInCatalog.jar
+    rm -rf tmp
+
+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
+~