[brooklyn-dist] branch master updated: Disables paxexam tests as they are fail in certain environments

2020-01-27 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-dist.git


The following commit(s) were added to refs/heads/master by this push:
 new c73507a  Disables paxexam tests as they are fail in certain 
environments
 new 0bc17e1  This closes #153
c73507a is described below

commit c73507a727b7cf5b83ac7185ecee7d1a6374f784
Author: Martin Harris 
AuthorDate: Mon Jan 27 10:16:35 2020 +

Disables paxexam tests as they are fail in certain environments
---
 karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java | 2 ++
 .../core/dsl/external/ExternalConfigBrooklynPropertiesOsgiTest.java | 6 ++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java 
b/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
index 14ec1d2..b54459e 100644
--- a/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
+++ b/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java
@@ -26,6 +26,7 @@ import javax.inject.Inject;
 
 import org.apache.karaf.features.BootFinished;
 import org.apache.karaf.features.FeaturesService;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
@@ -41,6 +42,7 @@ import org.osgi.framework.BundleContext;
  * 
  * Keeping it a non-integration test so we have at least a basic OSGi sanity 
check. (takes 14 sec)
  */
+@Ignore // See Thread at 
https://lists.apache.org/thread.html/rc4c563e1d320164b75a52581e65ff9c5888917153d3241865ec94a38%40%3Cdev.brooklyn.apache.org%3E
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
 public class AssemblyTest {
diff --git 
a/karaf/itest/src/test/java/org/apache/brooklyn/core/dsl/external/ExternalConfigBrooklynPropertiesOsgiTest.java
 
b/karaf/itest/src/test/java/org/apache/brooklyn/core/dsl/external/ExternalConfigBrooklynPropertiesOsgiTest.java
index 7776d96..c815fcc 100644
--- 
a/karaf/itest/src/test/java/org/apache/brooklyn/core/dsl/external/ExternalConfigBrooklynPropertiesOsgiTest.java
+++ 
b/karaf/itest/src/test/java/org/apache/brooklyn/core/dsl/external/ExternalConfigBrooklynPropertiesOsgiTest.java
@@ -38,10 +38,7 @@ import org.apache.brooklyn.util.guava.Maybe;
 import org.apache.brooklyn.util.osgi.OsgiTestResources;
 import org.apache.karaf.features.BootFinished;
 import org.apache.karaf.features.FeaturesService;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.*;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
@@ -52,6 +49,7 @@ import org.ops4j.pax.exam.util.Filter;
 import org.osgi.framework.Bundle;
 import org.osgi.service.cm.ConfigurationAdmin;
 
+@Ignore // See Thread at 
https://lists.apache.org/thread.html/rc4c563e1d320164b75a52581e65ff9c5888917153d3241865ec94a38%40%3Cdev.brooklyn.apache.org%3E
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
 public class ExternalConfigBrooklynPropertiesOsgiTest {



[brooklyn-server] 01/01: Change version to 1.0.0

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 02d41583f070df8f1d4a04c939136c8ef9a80ff0
Author: Aled Sage 
AuthorDate: Fri Jan 17 15:46:13 2020 +

Change version to 1.0.0
---
 api/pom.xml|  2 +-
 camp/camp-base/pom.xml |  2 +-
 camp/camp-brooklyn/pom.xml |  2 +-
 camp/camp-server/pom.xml   |  2 +-
 camp/pom.xml   |  2 +-
 core/pom.xml   |  2 +-
 .../main/java/org/apache/brooklyn/core/BrooklynVersion.java|  2 +-
 core/src/main/resources/catalog.bom|  4 ++--
 .../org/apache/brooklyn/core/mgmt/osgi/OsgiStandaloneTest.java |  4 ++--
 core/src/test/resources/catalog.bom|  2 +-
 karaf/commands/pom.xml |  2 +-
 karaf/features/pom.xml |  2 +-
 karaf/httpcomponent-extension/pom.xml  |  2 +-
 karaf/init/pom.xml |  2 +-
 karaf/init/src/main/resources/catalog.bom  | 10 +-
 karaf/jetty-config/pom.xml |  2 +-
 karaf/pom.xml  |  2 +-
 karaf/start/pom.xml|  2 +-
 launcher-common/pom.xml|  2 +-
 launcher/pom.xml   |  2 +-
 locations/container/pom.xml|  2 +-
 .../container/src/test/resources/generic-application.tests.bom |  2 +-
 locations/container/src/test/resources/generic.tests.bom   |  4 ++--
 locations/jclouds/pom.xml  |  2 +-
 logging/logback-includes/pom.xml   |  2 +-
 logging/logback-xml/pom.xml|  2 +-
 parent/pom.xml |  2 +-
 policy/pom.xml |  2 +-
 policy/src/main/resources/catalog.bom  |  2 +-
 pom.xml|  4 ++--
 rest/rest-api/pom.xml  |  2 +-
 rest/rest-resources/pom.xml|  2 +-
 rest/rest-server/pom.xml   |  2 +-
 server-cli/pom.xml |  2 +-
 software/base/pom.xml  |  2 +-
 .../org/apache/brooklyn/entity/brooklynnode/BrooklynNode.java  |  2 +-
 .../brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java|  2 +-
 .../java/org/apache/brooklyn/entity/java/JmxmpSslSupport.java  |  2 +-
 software/base/src/main/resources/catalog.bom   |  2 +-
 software/winrm/pom.xml |  2 +-
 test-framework/pom.xml |  2 +-
 test-framework/src/main/resources/catalog.bom  |  2 +-
 test-support/pom.xml   |  2 +-
 utils/common/dependencies/osgi/com-example-entities/pom.xml|  2 +-
 utils/common/dependencies/osgi/entities/pom.xml|  2 +-
 utils/common/dependencies/osgi/more-entities-v1/pom.xml|  2 +-
 .../dependencies/osgi/more-entities-v2-evil-twin/pom.xml   |  2 +-
 utils/common/dependencies/osgi/more-entities-v2/pom.xml|  2 +-
 utils/common/pom.xml   |  2 +-
 .../java/org/apache/brooklyn/util/maven/MavenArtifactTest.java |  4 ++--
 utils/groovy/pom.xml   |  2 +-
 utils/jmx/jmxmp-ssl-agent/pom.xml  |  2 +-
 utils/jmx/jmxrmi-agent/pom.xml |  2 +-
 utils/rest-swagger/pom.xml |  2 +-
 utils/rt-felix/pom.xml |  2 +-
 utils/test-support/pom.xml |  2 +-
 56 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/api/pom.xml b/api/pom.xml
index 63bd7ec..e7935c2 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -31,7 +31,7 @@
 
 org.apache.brooklyn
 brooklyn-parent
-1.0.0-SNAPSHOT  
+1.0.0  
 ../parent/pom.xml
 
 
diff --git a/camp/camp-base/pom.xml b/camp/camp-base/pom.xml
index 4a2aa59..82eff19 100644
--- a/camp/camp-base/pom.xml
+++ b/camp/camp-base/pom.xml
@@ -31,7 +31,7 @@
 
 org.apache.brooklyn.camp
 camp-parent
-1.0.0-SNAPSHOT  
+1.0.0  
 ../pom.xml
 
 
diff --git

[brooklyn-client] branch 1.0.0 created (now 52b5546)

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-client.git.


  at 52b5546  Change version to 1.0.0

This branch includes the following new commits:

 new 52b5546  Change version to 1.0.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[brooklyn] 02/02: Change version to 1.0.0

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn.git

commit acefd7adadc84fe4ca0a9151dacbd2f202830f31
Author: Aled Sage 
AuthorDate: Fri Jan 17 15:46:30 2020 +

Change version to 1.0.0
---
 README.md | 4 ++--
 pom.xml   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index e345bf6..2913650 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@ of the containing project, and the `scmBranch` is set to the 
git branch.
 ### Resources
 
 
-The **[Developers](https://brooklyn.apache.org/developers/)** section of the 
main website contains more detail on working with the codebase. There is also a 
more **Developer Guide** specific to each version, including [this branch 
(1.0.0-SNAPSHOT)](https://brooklyn.apache.org/v/1.0.0-SNAPSHOT/dev/), [latest 
stable](https://brooklyn.apache.org/v/latest/dev/), and [older 
releases](https://brooklyn.apache.org/meta/versions.html).
+The **[Developers](https://brooklyn.apache.org/developers/)** section of the 
main website contains more detail on working with the codebase. There is also a 
more **Developer Guide** specific to each version, including [this branch 
(1.0.0)](https://brooklyn.apache.org/v/1.0.0/dev/), [latest 
stable](https://brooklyn.apache.org/v/latest/dev/), and [older 
releases](https://brooklyn.apache.org/meta/versions.html).
 
 Useful topics include:
 
@@ -83,7 +83,7 @@ Useful topics include:
 * the **[maven 
build](https://brooklyn.apache.org/v/latest/dev/env/maven-build.html)** and 
what to do on build errors
 
 
-* **[project 
structure](https://brooklyn.apache.org/v/1.0.0-SNAPSHOT/dev/code/structure.html)**
 of the codebase and submodules
+* **[project 
structure](https://brooklyn.apache.org/v/1.0.0/dev/code/structure.html)** of 
the codebase and submodules
 
 * the **[people](https://brooklyn.apache.org/community/)** behind Apache 
Brooklyn
 
diff --git a/pom.xml b/pom.xml
index 3c05478..d60c494 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
 
 org.apache.brooklyn
 brooklyn
-1.0.0-SNAPSHOT  
+1.0.0  
 pom
 
 Brooklyn Root



[brooklyn-library] 01/01: Change version to 1.0.0

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-library.git

commit 6d133b2dac7371616dd5c4c0188df5821ff45807
Author: Aled Sage 
AuthorDate: Fri Jan 17 15:46:13 2020 +

Change version to 1.0.0
---
 catalog-aliases/pom.xml|  2 +-
 catalog-aliases/src/main/resources/catalog.bom |  2 +-
 examples/pom.xml   |  2 +-
 examples/simple-web-cluster/pom.xml|  2 +-
 .../src/main/resources/catalog.bom |  2 +-
 examples/webapps/hello-world-sql/pom.xml   |  2 +-
 examples/webapps/hello-world-webapp/pom.xml|  2 +-
 examples/webapps/pom.xml   |  2 +-
 karaf/catalog/pom.xml  |  2 +-
 karaf/catalog/src/main/resources/catalog.bom   | 24 +++---
 karaf/features/pom.xml |  2 +-
 karaf/pom.xml  |  2 +-
 pom.xml|  2 +-
 qa/pom.xml |  2 +-
 .../test/projects/downstream-parent-test/pom.xml   |  6 +++---
 .../src/main/resources/catalog.bom |  2 +-
 .../resources/java-web-app-and-db-with-policy.bom  |  2 +-
 qa/start-monitor.sh|  2 +-
 qa/start-webcluster.sh |  2 +-
 sandbox/cassandra-multicloud-snitch/pom.xml|  2 +-
 sandbox/database/pom.xml   |  2 +-
 sandbox/extra/pom.xml  |  2 +-
 sandbox/mobile-app/pom.xml |  2 +-
 sandbox/monitoring/pom.xml |  2 +-
 sandbox/monitoring/src/main/resources/catalog.bom  |  2 +-
 sandbox/nosql/pom.xml  |  2 +-
 software/cm/ansible/pom.xml|  2 +-
 software/cm/ansible/src/main/resources/catalog.bom |  2 +-
 software/cm/chef/pom.xml   |  2 +-
 software/cm/chef/src/main/resources/catalog.bom|  2 +-
 software/cm/pom.xml|  4 ++--
 software/cm/salt/pom.xml   |  2 +-
 software/cm/salt/src/main/resources/catalog.bom|  2 +-
 software/database/pom.xml  |  2 +-
 software/database/src/main/resources/catalog.bom   |  2 +-
 software/messaging/pom.xml |  2 +-
 software/messaging/src/main/resources/catalog.bom  |  4 ++--
 software/monitoring/pom.xml|  2 +-
 software/monitoring/src/main/resources/catalog.bom |  2 +-
 software/network/pom.xml   |  2 +-
 software/network/src/main/resources/catalog.bom|  2 +-
 software/nosql/pom.xml |  2 +-
 software/nosql/src/main/resources/catalog.bom  |  2 +-
 software/osgi/pom.xml  |  2 +-
 software/osgi/src/main/resources/catalog.bom   |  2 +-
 software/webapp/pom.xml|  4 ++--
 software/webapp/src/main/resources/catalog.bom |  2 +-
 47 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/catalog-aliases/pom.xml b/catalog-aliases/pom.xml
index 31f82be..a7b0769 100644
--- a/catalog-aliases/pom.xml
+++ b/catalog-aliases/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.brooklyn
 brooklyn-library
-1.0.0-SNAPSHOT  
+1.0.0  
 ../pom.xml
 
 
diff --git a/catalog-aliases/src/main/resources/catalog.bom 
b/catalog-aliases/src/main/resources/catalog.bom
index cd9eba1..2fc19d7 100644
--- a/catalog-aliases/src/main/resources/catalog.bom
+++ b/catalog-aliases/src/main/resources/catalog.bom
@@ -17,7 +17,7 @@
 
 # this catalog bom contains some convenient aliases for simple usage.
 brooklyn.catalog:
-  version: "1.0.0-SNAPSHOT"  # BROOKLYN_VERSION
+  version: "1.0.0"  # BROOKLYN_VERSION
   itemType: entity
 
   items:
diff --git a/examples/pom.xml b/examples/pom.xml
index dff4c90..6535872 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -32,7 +32,7 @@
 
 org.apache.brooklyn
 brooklyn-library
-1.0.0-SNAPSHOT   
+1.0.0   
 ../pom.xml
 
 
diff --git a/examples/simple-web-cluster/pom.xml 
b/examples/simple-web-cluster/pom.xml
index 4b94e22..553b6fd 100644
--- a/examples/simple-web-cluster/pom.xml
+++ b/examples/simple-web-cluster/pom.xml
@@ -28,7 +28,7 @@
 
 org.apache.brooklyn.example
 brooklyn-examples-parent
-1.0.0-SNAPSHOT   
+1.0.0   
 ../pom.xml
 
 
diff --git a/examples/simple-web-cluster/src/main/resources/catalog.bom 
b/examples/simple-web-cluster/src/main/resources/catalog.bom
index 18e2f66..44a3d3d 100644
--- a/examples/simple-web-cluster/src/main/resources/catalog.bom
+++ b/examples/simple-web-cluster/src/main/resources/catalog.bom
@@ -16,7 +16,7 @@

[brooklyn-dist] branch 1.0.0 created (now b6811a2)

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-dist.git.


  at b6811a2  Change version to 1.0.0

This branch includes the following new commits:

 new b6811a2  Change version to 1.0.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[brooklyn-server] branch 1.0.0 created (now 02d4158)

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.


  at 02d4158  Change version to 1.0.0

This branch includes the following new commits:

 new 02d4158  Change version to 1.0.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[brooklyn-library] branch 1.0.0 created (now 6d133b2)

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-library.git.


  at 6d133b2  Change version to 1.0.0

This branch includes the following new commits:

 new 6d133b2  Change version to 1.0.0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[brooklyn-dist] 01/01: Change version to 1.0.0

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn-dist.git

commit b6811a215d1b4c4e05709b876c25c56b29ba267d
Author: Aled Sage 
AuthorDate: Fri Jan 17 15:46:13 2020 +

Change version to 1.0.0
---
 all/pom.xml|  2 +-
 archetypes/quickstart/NOTES.txt|  2 +-
 archetypes/quickstart/pom.xml  |  2 +-
 archetypes/quickstart/src/brooklyn-sample/pom.xml  |  2 +-
 deb-packaging/pom.xml  |  2 +-
 dist/pom.xml   |  2 +-
 dist/src/main/dist/conf/brooklyn/default.catalog.bom   |  2 +-
 docker-image/pom.xml   |  2 +-
 docker/Makefile|  2 +-
 docker/brooklyn-docker-start   |  2 +-
 downstream-parent/pom.xml  |  2 +-
 karaf/apache-brooklyn/pom.xml  |  2 +-
 .../apache-brooklyn/src/main/resources/etc/default.catalog.bom |  2 +-
 karaf/config/pom.xml   |  2 +-
 karaf/config/src/main/resources/catalog/catalog-core.bom   |  6 +++---
 karaf/config/src/main/resources/catalog/catalog-templates.bom  |  2 +-
 karaf/config/src/main/resources/catalog/catalog.bom|  2 +-
 karaf/features/pom.xml |  2 +-
 karaf/itest/pom.xml|  2 +-
 karaf/pom.xml  |  2 +-
 pom.xml|  2 +-
 rpm-packaging/pom.xml  |  2 +-
 shared-packaging/pom.xml   |  2 +-
 shared-packaging/src/test/yaml/package-apps.yaml   |  8 
 shared-packaging/src/test/yaml/package.bom |  2 +-
 vagrant/pom.xml|  2 +-
 vagrant/src/main/vagrant/README.md |  4 ++--
 vagrant/src/main/vagrant/files/install_brooklyn.sh |  2 +-
 vagrant/src/main/vagrant/files/vagrant-catalog.bom | 10 +-
 vagrant/src/main/vagrant/servers.yaml  |  2 +-
 30 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/all/pom.xml b/all/pom.xml
index 7c7c790..1c7a8e9 100644
--- a/all/pom.xml
+++ b/all/pom.xml
@@ -31,7 +31,7 @@
 
 org.apache.brooklyn
 brooklyn-dist-root
-1.0.0-SNAPSHOT  
+1.0.0  
 ../pom.xml
 
 
diff --git a/archetypes/quickstart/NOTES.txt b/archetypes/quickstart/NOTES.txt
index 9b609d1..a2448bd 100644
--- a/archetypes/quickstart/NOTES.txt
+++ b/archetypes/quickstart/NOTES.txt
@@ -32,7 +32,7 @@ To test a build:
 
 pushd /tmp
 rm -rf brooklyn-sample
-export BV=1.0.0-SNAPSHOT# BROOKLYN_VERSION
+export BV=1.0.0# BROOKLYN_VERSION
 
 mvn archetype:generate  \
 \
diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml
index 221d9c6..cc044e9 100644
--- a/archetypes/quickstart/pom.xml
+++ b/archetypes/quickstart/pom.xml
@@ -31,7 +31,7 @@
   
 org.apache.brooklyn
 brooklyn-parent
-1.0.0-SNAPSHOT  
+1.0.0  
 ../../../brooklyn-server/parent/pom.xml
   
 
diff --git a/archetypes/quickstart/src/brooklyn-sample/pom.xml 
b/archetypes/quickstart/src/brooklyn-sample/pom.xml
index 5b48002..4eb3ca1 100644
--- a/archetypes/quickstart/src/brooklyn-sample/pom.xml
+++ b/archetypes/quickstart/src/brooklyn-sample/pom.xml
@@ -7,7 +7,7 @@
   
 org.apache.brooklyn
 brooklyn-downstream-parent
-1.0.0-SNAPSHOT  
+1.0.0  
   
 
   com.acme.sample
diff --git a/deb-packaging/pom.xml b/deb-packaging/pom.xml
index 8e3ed4d..1ee406a 100644
--- a/deb-packaging/pom.xml
+++ b/deb-packaging/pom.xml
@@ -37,7 +37,7 @@
 
 org.apache.brooklyn
 brooklyn-dist-root
-1.0.0-SNAPSHOT  
+1.0.0  
 ../pom.xml
 
 
diff --git a/dist/pom.xml b/dist/pom.xml
index 3d0fc5e..a189311 100644
--- a/dist/pom.xml
+++ b/dist/pom.xml
@@ -32,7 +32,7 @@
 
 org.apache.brooklyn
 brooklyn-dist-root
-1.0.0-SNAPSHOT  
+1.0.0  
 ../pom.xml
 
 
diff --git a/dist/src/main/dist/conf/brooklyn/default.catalog.bom 
b/dist/src/main/dist/conf/brooklyn/default.catalog.bom
index 282ad39..d20d1ae 100644
--- a/dist/src/main/dist/conf/brooklyn/default.catalog.bom
+++ b/dist/src/main/dist/conf/brooklyn/default.catalog.bom
@@ -3,7 +3,7 @@
 
 brooklyn.catalog:
   bundle: brooklyn-default-catalog
-  version: "1.0.0-SNAPSHOT"  # BROOKLYN_VERSION

[brooklyn] branch 1.0.0 created (now acefd7a)

2020-01-17 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch 1.0.0
in repository https://gitbox.apache.org/repos/asf/brooklyn.git.


  at acefd7a  Change version to 1.0.0

This branch includes the following new commits:

 new d7fe11a  Update submodules to 1.0.0
 new acefd7a  Change version to 1.0.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[brooklyn-server] branch master updated (ab2e156 -> 1dd4d49)

2019-12-11 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.


from ab2e156  This closes #1067
 add 11a926c  BROOKLYN-613: failing rebind test for AutoScalerPolicy config 
using DSL
 new 1dd4d49  This closes #1060

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camp/brooklyn/AutoScalerPolicyYamlTest.java| 103 +
 1 file changed, 103 insertions(+)
 create mode 100644 
camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/AutoScalerPolicyYamlTest.java



[brooklyn-server] 02/03: Merge branch 'master' into pom-jackson-bump

2019-12-11 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 8610d81f1cc537f3703b92f92527ecb575380593
Merge: 53e99f4 0a01c97
Author: Alex Heneveld 
AuthorDate: Fri Dec 6 11:02:59 2019 +

Merge branch 'master' into pom-jackson-bump

 Dockerfile |  3 +
 Jenkinsfile| 86 ++
 api/pom.xml|  1 +
 .../test/policy/failover/ElectPrimaryTest.java |  3 +-
 .../core/mgmt/rebind/RebindFeedWithHaTest.java |  3 +-
 parent/pom.xml | 13 +---
 pom.xml|  8 +-
 rest/rest-resources/pom.xml| 12 +++
 .../base/SoftwareProcessStopsDuringStartTest.java  |  3 +-
 utils/common/pom.xml   |  1 +
 10 files changed, 117 insertions(+), 16 deletions(-)




[brooklyn-server] 03/03: This closes #1067

2019-12-11 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit ab2e156d460e148edfcce39b585d27a179b6245a
Merge: 0a01c97 8610d81
Author: Aled Sage 
AuthorDate: Wed Dec 11 08:36:38 2019 +

This closes #1067

 .../catalog/internal/BasicBrooklynCatalog.java |  25 -
 .../core/catalog/internal/CatalogTemplateTest.java | 119 +
 pom.xml|   4 +-
 utils/rest-swagger/pom.xml |  18 
 4 files changed, 161 insertions(+), 5 deletions(-)



[brooklyn-server] branch master updated (0a01c97 -> ab2e156)

2019-12-11 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.


from 0a01c97  Merge pull request #1072 from tbouron/feature/jenkins
 add c841259  bump yaml software version
 add 636eb86  explicitly specify exclusions
 add e35fca5  support strings for templates
 new 53e99f4  use new jackson, not the pre-release artifact
 new 8610d81  Merge branch 'master' into pom-jackson-bump
 new ab2e156  This closes #1067

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../catalog/internal/BasicBrooklynCatalog.java |  25 -
 .../core/catalog/internal/CatalogTemplateTest.java | 119 +
 pom.xml|   4 +-
 utils/rest-swagger/pom.xml |  18 
 4 files changed, 161 insertions(+), 5 deletions(-)
 create mode 100644 
core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogTemplateTest.java



[brooklyn-server] branch master updated (d45718d -> 9308bf1)

2019-04-12 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.


from d45718d  Merge pull request #1061 from 
jcabrerizo/fixReadOnlyEntitlement
 add c910271  [SECURITY] change Executors.newCachedThreadPool() to 
newFixedThreadPool(int)
 new 9308bf1  This closes #1062

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/brooklyn/util/net/ReachableSocketFinder.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[brooklyn-server] 01/01: This closes #1062

2019-04-12 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 9308bf1fdda128329a6ccc7c49ee5edf94f71167
Merge: d45718d c910271
Author: Aled Sage 
AuthorDate: Fri Apr 12 12:37:06 2019 +0100

This closes #1062

 .../main/java/org/apache/brooklyn/util/net/ReachableSocketFinder.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[brooklyn-library] branch master updated: change MariaDB mirror site and bump patch version

2019-02-01 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-library.git


The following commit(s) were added to refs/heads/master by this push:
 new 1354252  change MariaDB mirror site and bump patch version
 new 89795c5  This closes #170
1354252 is described below

commit 13542527e1945bafa8b226fa81e1107838da8334
Author: Alex Heneveld 
AuthorDate: Fri Feb 1 13:27:36 2019 +

change MariaDB mirror site and bump patch version

the old mirror seems to blacklist AWS, but this mirror works fine
---
 .../java/org/apache/brooklyn/entity/database/mariadb/MariaDbNode.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/software/database/src/main/java/org/apache/brooklyn/entity/database/mariadb/MariaDbNode.java
 
b/software/database/src/main/java/org/apache/brooklyn/entity/database/mariadb/MariaDbNode.java
index 2d1aaf1..5113960 100644
--- 
a/software/database/src/main/java/org/apache/brooklyn/entity/database/mariadb/MariaDbNode.java
+++ 
b/software/database/src/main/java/org/apache/brooklyn/entity/database/mariadb/MariaDbNode.java
@@ -42,7 +42,7 @@ public interface MariaDbNode extends SoftwareProcess, 
DatastoreCommon, HasShortN
 
 @SetFromFlag("version")
 public static final ConfigKey SUGGESTED_VERSION =
-ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, 
"10.2.6");
+ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, 
"10.2.21");
 
 // 
https://downloads.mariadb.org/interstitial/mariadb-5.5.33a/kvm-bintar-hardy-amd64/mariadb-5.5.33a-linux-x86_64.tar.gz/from/http://mirrors.coreix.net/mariadb
 // above redirects to download the artifactd from the URLs below.
@@ -57,7 +57,7 @@ public interface MariaDbNode extends SoftwareProcess, 
DatastoreCommon, HasShortN
 /** download mirror, if desired */
 @SetFromFlag("mirrorUrl")
 public static final ConfigKey MIRROR_URL = 
ConfigKeys.newStringConfigKey("mariadb.install.mirror.url", "URL of mirror",
-"http://ftp.hosteurope.de/mirror/archive.mariadb.org;
+"http://mirrors.coreix.net/mariadb/;
  );
 
 @SetFromFlag("port")



[brooklyn-server] branch master updated: winrm4j 0.5.0 -> 0.6.1

2019-01-24 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


The following commit(s) were added to refs/heads/master by this push:
 new 6072d53  winrm4j 0.5.0 -> 0.6.1
 new 70404e6  This closes #1029
6072d53 is described below

commit 6072d5365ea904f80998a0ff44af88c423483e5e
Author: Martin Harris 
AuthorDate: Thu Jan 24 11:48:59 2019 +

winrm4j 0.5.0 -> 0.6.1
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1b776da..b2c22ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -157,7 +157,7 @@
 2.1.1
 2.8.0-rc1
 1.2.1
-0.5.0
+0.6.1
 1.4.0
 1.4.27
 



[brooklyn-server] 26/31: Add unit tests for CatalogUpgradeSCanner

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 9fe502a2d67835d60a23a0bbf5aa27f9c7a3caef
Author: Paul Campbell 
AuthorDate: Wed Oct 24 17:06:24 2018 +0100

Add unit tests for CatalogUpgradeSCanner
---
 .../internal/CatalogUpgradeScannerTest.java| 304 +
 1 file changed, 304 insertions(+)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
new file mode 100644
index 000..a03a54e
--- /dev/null
+++ 
b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
@@ -0,0 +1,304 @@
+package org.apache.brooklyn.core.catalog.internal;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.Multimap;
+import org.apache.brooklyn.api.typereg.ManagedBundle;
+import org.apache.brooklyn.api.typereg.OsgiBundleWithUrl;
+import org.apache.brooklyn.api.typereg.RegisteredType;
+import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
+import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
+import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
+import org.apache.brooklyn.core.typereg.BasicManagedBundle;
+import org.apache.brooklyn.core.typereg.BundleUpgradeParser.CatalogUpgrades;
+import org.apache.brooklyn.core.typereg.BundleUpgradeParser.VersionRangedName;
+import org.apache.brooklyn.util.guava.Maybe;
+import org.apache.brooklyn.util.osgi.VersionedName;
+import org.assertj.core.api.WithAssertions;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+
+import static 
org.apache.brooklyn.core.catalog.internal.CatalogUpgradeScannerTest.Givens.*;
+import static 
org.apache.brooklyn.core.catalog.internal.CatalogUpgradeScannerTest.Utils.*;
+import static org.apache.brooklyn.core.typereg.BundleTestUtil.newMockBundle;
+import static org.assertj.core.api.SoftAssertions.assertSoftly;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
+public class CatalogUpgradeScannerTest implements WithAssertions {
+
+// collaborators
+private final ManagementContextInternal managementContext = new 
LocalManagementContext();
+@Mock
+private BiFunction 
bundleUpgradeParser;
+@Mock
+private Function> 
managedBundlePredicateSupplier;
+@Mock
+private Function> 
unmanagedBundlePredicateSupplier;
+
+// subject under test
+private CatalogUpgradeScanner scanner;
+
+// parameters
+private final OsgiManager osgiManager = mock(OsgiManager.class);
+private final CatalogInitialization.RebindLogger rebindLogger = 
mock(CatalogInitialization.RebindLogger.class);
+private final BundleContext bundleContext = mock(BundleContext.class);
+
+@BeforeClass
+public void setUp() {
+MockitoAnnotations.initMocks(this);
+scanner = new CatalogUpgradeScanner(managementContext, 
bundleUpgradeParser, managedBundlePredicateSupplier,
+unmanagedBundlePredicateSupplier);
+}
+
+private CatalogUpgrades invoke() {
+return scanner.scan(osgiManager, bundleContext, rebindLogger);
+}
+
+@Test
+public void whenNoUnmanagedOrManagedBundlesThenNoUpgrades() {
+//given
+givenNoManagedBundles(osgiManager);
+givenNoUnmanagedBundles(bundleContext);
+//when
+final CatalogUpgrades result = invoke();
+//then
+assertThatThereAreNoUpgrades(result);
+}
+
+@Test
+public void whenUnmanagedAndManagedBundlesWithNoUpgradesThenNoUpgrades() {
+//given
+givenManagedBundlesWithNoUpgrades(osgiManager, bundleUpgradeParser);
+givenUnmanagedBundlesWithNoUpgrades(bundleContext, 
bundleUpgradeParser);
+//when
+final CatalogUpgrades result = invoke();
+//then
+assertThatThereAreNoUpgrades(result);
+}
+
+@Test
+public void whenOnlyManagedBundleHasUpgradesThenUpgradesForManagedBundle() 
{
+//given
+final String upgradeFrom = bundleName("managed", "1.0.0");
+final String upgradeTo = bundleName("managed", "2.0.0");
+final CatalogUpgrades catalogUpgrades = CatalogUpgrades.builder()
+.upgrad

[brooklyn-server] 23/31: Extract static methods as a constructor parameters

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit ab67707f3b3728f3e2a12728e77fd8f5541c6c2f
Author: Paul Campbell 
AuthorDate: Wed Oct 24 11:05:46 2018 +0100

Extract static methods as a constructor parameters

Providing the static method call as a function to the constructor makes unit
testing for this class much simpler as it allows the static method to be
mocked, improving the clarity of the unit tests.
---
 .../catalog/internal/CatalogInitialization.java|  6 +++--
 .../catalog/internal/CatalogUpgradeScanner.java| 28 +++---
 2 files changed, 23 insertions(+), 11 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index e284479..fe57f41 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -68,7 +68,6 @@ import org.apache.brooklyn.util.os.Os;
 import org.apache.brooklyn.util.osgi.VersionedName;
 import org.apache.brooklyn.util.text.Strings;
 import org.apache.brooklyn.util.time.Duration;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -135,7 +134,10 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 if (this.managementContext!=null && 
managementContext!=this.managementContext)
 throw new IllegalStateException("Cannot switch management context, 
from "+this.managementContext+" to "+managementContext);
 this.managementContext = (ManagementContextInternal) managementContext;
-catalogUpgradeScanner = new 
CatalogUpgradeScanner(this.managementContext);
+catalogUpgradeScanner = new 
CatalogUpgradeScanner(this.managementContext,
+BundleUpgradeParser::parseBundleManifestForCatalogUpgrades,
+RegisteredTypePredicates::containingBundle,
+RegisteredTypePredicates::containingBundle);
 }
 
 /** Called by the framework to set true while starting up, and false 
afterwards,
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
index 446c083..b48bbf8 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
@@ -18,16 +18,20 @@
  */
 package org.apache.brooklyn.core.catalog.internal;
 
+import com.google.common.base.Predicate;
 import org.apache.brooklyn.api.typereg.ManagedBundle;
+import org.apache.brooklyn.api.typereg.OsgiBundleWithUrl;
+import org.apache.brooklyn.api.typereg.RegisteredType;
 import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
-import org.apache.brooklyn.core.typereg.BundleUpgradeParser;
 import org.apache.brooklyn.core.typereg.BundleUpgradeParser.CatalogUpgrades;
 import org.apache.brooklyn.core.typereg.RegisteredTypePredicates;
 import org.apache.brooklyn.util.guava.Maybe;
 import org.osgi.framework.Bundle;
 
 import java.util.Collection;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 
 /**
  * Scans managed bundles and other jar bundles to find upgrades for installed 
bundles.
@@ -35,11 +39,20 @@ import java.util.Collection;
 class CatalogUpgradeScanner {
 
 private final ManagementContextInternal managementContext;
+private final BiFunction 
bundleUpgradeParser;
+private final Function> managedBundlePredicateSupplier;
+private final Function> 
unmanagedBundlePredicateSupplier;
 
 CatalogUpgradeScanner(
-final ManagementContextInternal managementContext
+final ManagementContextInternal managementContext,
+final BiFunction 
bundleUpgradeParser,
+final Function> managedBundlePredicateSupplier,
+final Function> 
unmanagedBundlePredicateSupplier
 ) {
 this.managementContext = managementContext;
+this.bundleUpgradeParser = bundleUpgradeParser;
+this.managedBundlePredicateSupplier = managedBundlePredicateSupplier;
+this.unmanagedBundlePredicateSupplier = 
unmanagedBundlePredicateSupplier;
 }
 
 public CatalogUpgrades scan(
@@ -61,8 +74,7 @@ class CatalogUpgradeScanner {
 for (ManagedBundle managedBundle : managedBundles) {
 Maybe bundle = osgiManager.findBundle(managedBundle);
 if (bundle.isPresent()) {
-   

[brooklyn-server] 05/31: [common] add assertj as test dependency

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 442a1944ee752944e42916fb3d22ef2a1628b861
Author: Paul Campbell 
AuthorDate: Tue Oct 9 16:38:27 2018 +0100

[common] add assertj as test dependency
---
 utils/common/pom.xml | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/utils/common/pom.xml b/utils/common/pom.xml
index e547842..d2a3b3a 100644
--- a/utils/common/pom.xml
+++ b/utils/common/pom.xml
@@ -117,6 +117,12 @@
 ${org.osgi.core.version}
 jar
 
+
+org.assertj
+assertj-core
+test
+
+
 
 
 



[brooklyn-server] branch master updated (061057c -> da8bf93)

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git.


from 061057c  This closes #1024
 new 890ef56  Bump assertj from 2.2.0 to 3.11.1
 new f08ed2c  [core] add assertj as test dependency
 new 2c0f0c2  [core] Refactor rebind test for clarity
 new 5d5a2dd  [core] rename excessively long private constant
 new 442a194  [common] add assertj as test dependency
 new 8f11da5  [common] Add unit tests for 
Reflections#findMappedName{AndLog,Maybe}()
 new 75f41da  [common] Add test for mapping classes from one bundle to 
another
 new c4234de  [common] fix typo in test
 new 2be6cd4  Extract nested tests for findMappedName into top level class
 new 170b351  fix typo
 new a0d2d84  Add assertj as test dependency
 new 8e91fbe  Coverage tests for existing 
CatalogUpgrades.getBundleUpgradedIfNecessary()
 new 0ec0418  Extract newMockBundle() utility methods to BundleTestUtil
 new 441213c  whenUpgradingAWrappedBundleThenUpdatedName()
 new 8419337  Add missing apache license headers
 new 748bfa0  Load all jars to find upgrades for wrapped bundles
 new 6127e03  Remove stopwatches
 new ef42313  Extract scanManagedBundles() and scanAllBundles()
 new 7328d9f  Extract RegisteredTypesSupplier to outer class
 new 64c869c  Extract CatalogUpgradeScanner
 new 0fc25b2  Extract overloaded typeSupplier() helpers
 new b6500ed  The presence of an OsgiManager is not the concern of 
CatalogUpgradeScanner
 new ab67707  Extract static methods as a constructor parameters
 new cdb298f  Limit violation of the law of demeter
 new 943f3b8  Make BundleUtilTest public
 new 9fe502a  Add unit tests for CatalogUpgradeSCanner
 new 09e65df  Remove previous attempt at failing test
 new aabab44  Add missing header
 new 2e025d1  Remove duplicated version for assertj
 new 5c22839  Changes requested on PR
 new da8bf93  This closes #1010

The 31 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 core/pom.xml   |   5 +
 .../catalog/internal/CatalogInitialization.java|  62 ++--
 .../catalog/internal/CatalogUpgradeScanner.java| 110 +++
 .../catalog/internal/RegisteredTypesSupplier.java  |  25 +-
 .../persist/DeserializingClassRenamesProvider.java |   5 +-
 .../brooklyn/core/typereg/BundleUpgradeParser.java |   2 +-
 .../internal/CatalogUpgradeScannerTest.java| 322 +
 .../RebindWithDeserializingClassRenamesTest.java   | 152 +++---
 .../brooklyn/core/typereg/BundleTestUtil.java  |  57 
 .../core/typereg/BundleUpgradeParserTest.java  |  27 +-
 ...ogUpgradesGetBundleUpgradedIfNecessaryTest.java | 246 
 parent/pom.xml |  41 +--
 pom.xml|   6 +-
 utils/common/pom.xml   |   6 +
 .../javalang/ReflectionsFindMappedNameTest.java| 141 +
 15 files changed, 1053 insertions(+), 154 deletions(-)
 create mode 100644 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
 copy 
utils/common/dependencies/osgi/com-example-entities/src/main/java/com/example/brooklyn/test/osgi/PrefixedDummyExternalConfigSupplier.java
 => 
core/src/main/java/org/apache/brooklyn/core/catalog/internal/RegisteredTypesSupplier.java
 (58%)
 create mode 100644 
core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
 create mode 100644 
core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java
 create mode 100644 
core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
 create mode 100644 
utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java



[brooklyn-server] 10/31: fix typo

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 170b3510b422970e10dbedea018b7f979ffb3af8
Author: Paul Campbell 
AuthorDate: Mon Oct 15 15:34:41 2018 +0100

fix typo
---
 .../main/java/org/apache/brooklyn/core/typereg/BundleUpgradeParser.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/typereg/BundleUpgradeParser.java 
b/core/src/main/java/org/apache/brooklyn/core/typereg/BundleUpgradeParser.java
index 8b16d69..007c5da 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/typereg/BundleUpgradeParser.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/typereg/BundleUpgradeParser.java
@@ -137,7 +137,7 @@ public class BundleUpgradeParser {
  * 
  * The format is a comma separate list of {@code key=value} pairs, where 
each key is a name with a version range
  * (as per {@link #MANIFEST_HEADER_FORCE_REMOVE_BUNDLES}) specifying what 
should be upgraded, and {@code value} is a name and
- * version specifying what it should be ugpraded to. The {@code =value} 
can be omitted, and usually is,
+ * version specifying what it should be upgraded to. The {@code =value} 
can be omitted, and usually is,
  * to mean this bundle at this version. (The {@code =value} is available 
if one bundle is defining upgrades for other bundles.)  
  * 
  * A wildcard can be given as the key, without a version ({@code *}) or 
with ({@code *:[0,1)}) to refer to 



[brooklyn-server] 02/31: [core] add assertj as test dependency

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit f08ed2c94908f8592cfdc20a73276706e613ae6d
Author: Paul Campbell 
AuthorDate: Tue Oct 9 09:48:26 2018 +0100

[core] add assertj as test dependency
---
 core/pom.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/core/pom.xml b/core/pom.xml
index 28de44e..69f8772 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -237,6 +237,11 @@
 tests
 test
 
+
+org.assertj
+assertj-core
+test
+
 
 
 



[brooklyn-server] 22/31: The presence of an OsgiManager is not the concern of CatalogUpgradeScanner

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit b6500edf082ccc207a892d0cd2889d3c8935bc6e
Author: Paul Campbell 
AuthorDate: Wed Oct 24 10:54:46 2018 +0100

The presence of an OsgiManager is not the concern of CatalogUpgradeScanner

CatalogUgradeScanner requires an OsgiManager. Branching for special case is
pushed out to the (single) caller, where it is clear that the 
ManagementContext
is being set to an empty set of CatalogUpgrades.
---
 .../core/catalog/internal/CatalogInitialization.java   | 10 --
 .../core/catalog/internal/CatalogUpgradeScanner.java   | 14 ++
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index 9dcaa4b..e284479 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -254,8 +254,14 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 
 populateInitialCatalogImpl(true);
 
-final CatalogUpgrades catalogUpgrades = 
catalogUpgradeScanner.scan(rebindLogger);
-CatalogUpgrades.storeInManagementContext(catalogUpgrades, 
managementContext);
+final Maybe osgiManager = 
managementContext.getOsgiManager();
+if (osgiManager.isAbsent()) {
+// Can't find any bundles to tell if there are upgrades. Could 
be running tests; do no filtering.
+
CatalogUpgrades.storeInManagementContext(CatalogUpgrades.EMPTY, 
managementContext);
+} else {
+final CatalogUpgrades catalogUpgrades = 
catalogUpgradeScanner.scan(osgiManager.get(), rebindLogger);
+CatalogUpgrades.storeInManagementContext(catalogUpgrades, 
managementContext);
+}
 PersistedCatalogState filteredPersistedState = 
filterBundlesAndCatalogInPersistedState(persistedState, rebindLogger);
 addPersistedCatalogImpl(filteredPersistedState, exceptionHandler, 
rebindLogger);
 
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
index 342e3af..446c083 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
@@ -42,15 +42,13 @@ class CatalogUpgradeScanner {
 this.managementContext = managementContext;
 }
 
-public CatalogUpgrades scan(final CatalogInitialization.RebindLogger 
rebindLogger) {
-Maybe osgiManager = managementContext.getOsgiManager();
-if (osgiManager.isAbsent()) {
-// Can't find any bundles to tell if there are upgrades. Could be 
running tests; do no filtering.
-return CatalogUpgrades.EMPTY;
-}
+public CatalogUpgrades scan(
+final OsgiManager osgiManager,
+final CatalogInitialization.RebindLogger rebindLogger
+) {
 final CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
-scanManagedBundles(osgiManager.get(), catalogUpgradesBuilder, 
rebindLogger);
-scanAllBundles(osgiManager.get(), catalogUpgradesBuilder);
+scanManagedBundles(osgiManager, catalogUpgradesBuilder, rebindLogger);
+scanAllBundles(osgiManager, catalogUpgradesBuilder);
 return catalogUpgradesBuilder.build();
 }
 



[brooklyn-server] 29/31: Remove duplicated version for assertj

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 2e025d10328609148ceae766a4f7e4f6cc2c62af
Author: Paul Campbell 
AuthorDate: Wed Oct 24 23:10:14 2018 +0100

Remove duplicated version for assertj
---
 pom.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 4016730..ed1ad6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -190,7 +190,6 @@
 2.19.1
 6.10
 2.7.12
-3.11.1
 1.1
 2012
 



[brooklyn-server] 28/31: Add missing header

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit aabab44f869669abea6911e82bbf00a04d1bb4e4
Author: Paul Campbell 
AuthorDate: Wed Oct 24 19:52:34 2018 +0100

Add missing header
---
 .../catalog/internal/CatalogUpgradeScannerTest.java| 18 ++
 1 file changed, 18 insertions(+)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
index a03a54e..5eba4f1 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.brooklyn.core.catalog.internal;
 
 import com.google.common.base.Predicate;



[brooklyn-server] 07/31: [common] Add test for mapping classes from one bundle to another

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 75f41da62d737ea6ca0b315efece9fbe2d8e59c7
Author: Paul Campbell 
AuthorDate: Tue Oct 9 17:07:58 2018 +0100

[common] Add test for mapping classes from one bundle to another
---
 .../apache/brooklyn/util/javalang/ReflectionsTest.java | 18 ++
 1 file changed, 18 insertions(+)

diff --git 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
index 554ad96..c95d439 100644
--- 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
+++ 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
@@ -342,6 +342,24 @@ public class ReflectionsTest implements WithAssertions {
 assertThat(result).isEqualTo(updatedName);
 }
 
+//wrap_blah_aws-java-sdk-bundle-1.11.245.jar\:*  : 
wrap_blah_aws-java-sdk-bundle-1.11.411.jar\:*
+@Test
+public void allClassesInOneBundleAreNowInOtherBundle() {
+//given
+final Map rename = new HashMap<>();
+final String wildcard = "*";
+final String originalBundle = 
"wrap_blah_aws-java-sdk-bundle-1.11.245.jar:";
+final String updatedBundle = 
"wrap_blah_aws-java-sdk-bundle-1.11.411.jar:";
+rename.put(originalBundle + wildcard, updatedBundle + wildcard);
+final String className = createAName();
+final String originalName = originalBundle + className;
+final String updatedName = updatedBundle + className;
+//when
+final String result = Reflections.findMappedNameAndLog(rename, 
originalName);
+//then
+assertThat(result).isSameAs(updatedName);
+}
+
 private String createAName() {
 return UUID.randomUUID().toString();
 }



[brooklyn-server] 30/31: Changes requested on PR

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 5c22839eeb63f6e9c1de16d6b1c6c7defa3a12b1
Author: Paul Campbell 
AuthorDate: Wed Jan 16 14:55:53 2019 +

Changes requested on PR
---
 .../catalog/internal/CatalogUpgradeScanner.java| 16 +
 .../internal/CatalogUpgradeScannerTest.java| 24 ++---
 .../RebindWithDeserializingClassRenamesTest.java   |  6 ++--
 ...ogUpgradesGetBundleUpgradedIfNecessaryTest.java |  2 +-
 parent/pom.xml | 40 +++---
 pom.xml|  2 --
 .../javalang/ReflectionsFindMappedNameTest.java|  4 ---
 .../brooklyn/util/javalang/ReflectionsTest.java|  4 +--
 8 files changed, 48 insertions(+), 50 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
index efe902d..a51c594 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
@@ -33,6 +33,8 @@ import java.util.Collection;
 import java.util.function.BiFunction;
 import java.util.function.Function;
 
+import static java.util.Objects.requireNonNull;
+
 /**
  * Scans managed bundles and other jar bundles to find upgrades for installed 
bundles.
  */
@@ -49,10 +51,12 @@ class CatalogUpgradeScanner {
 final Function> managedBundlePredicateSupplier,
 final Function> 
unmanagedBundlePredicateSupplier
 ) {
-this.managementContext = managementContext;
-this.bundleUpgradeParser = bundleUpgradeParser;
-this.managedBundlePredicateSupplier = managedBundlePredicateSupplier;
-this.unmanagedBundlePredicateSupplier = 
unmanagedBundlePredicateSupplier;
+this.managementContext = requireNonNull(managementContext, 
"managementContext");
+this.bundleUpgradeParser = requireNonNull(bundleUpgradeParser, 
"bundleUpgradeParser");
+this.managedBundlePredicateSupplier =
+requireNonNull(managedBundlePredicateSupplier, 
"managedBundlePredicateSupplier");
+this.unmanagedBundlePredicateSupplier =
+requireNonNull(unmanagedBundlePredicateSupplier, 
"unmanagedBundlePredicateSupplier");
 }
 
 public CatalogUpgrades scan(
@@ -62,7 +66,7 @@ class CatalogUpgradeScanner {
 ) {
 final CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
 scanManagedBundles(osgiManager, catalogUpgradesBuilder, rebindLogger);
-scanUnmanagedBundles(catalogUpgradesBuilder, bundleContext);
+scanAllBundles(catalogUpgradesBuilder, bundleContext);
 return catalogUpgradesBuilder.build();
 }
 
@@ -84,7 +88,7 @@ class CatalogUpgradeScanner {
 }
 }
 
-private void scanUnmanagedBundles(
+private void scanAllBundles(
 final CatalogUpgrades.Builder catalogUpgradesBuilder,
 final BundleContext bundleContext
 ) {
diff --git 
a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
index 5eba4f1..a91dca6 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScannerTest.java
@@ -190,12 +190,12 @@ public class CatalogUpgradeScannerTest implements 
WithAssertions {
 final OsgiManager osgiManager,
 final BiFunction bundleUpgradeParser
 ) {
-final Map managedBundlesWithNoUpgrades =
+final Map bundles =
 ImmutableMap.of(
 "managed1", findableManagedBundle(osgiManager, 
CatalogUpgrades.EMPTY, bundleUpgradeParser),
 "managed2", findableManagedBundle(osgiManager, 
CatalogUpgrades.EMPTY, bundleUpgradeParser)
 );
-
doReturn(managedBundlesWithNoUpgrades).when(osgiManager).getManagedBundles();
+doReturn(bundles).when(osgiManager).getManagedBundles();
 }
 
 static void givenManagedBundlesWithUpgrades(
@@ -203,9 +203,9 @@ public class CatalogUpgradeScannerTest implements 
WithAssertions {
 final OsgiManager osgiManager,
 final BiFunction bundleUpgradeParser
 ) {
-final Map managedBundlesWithNoUpgrades =
+final Map bundles =
 ImmutableMap.of("managed", 
findableManagedBundle(osgiManager, upgrades, bundleUpgradePar

[brooklyn-server] 09/31: Extract nested tests for findMappedName into top level class

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 2be6cd47f906d0806486d2e00216a2d064ca65d0
Author: Paul Campbell 
AuthorDate: Thu Oct 11 16:53:32 2018 +0100

Extract nested tests for findMappedName into top level class

TestNG isn't good at running a subset of tests without a log of ceremony
attached (e.g. config files and annotations).
---
 .../javalang/ReflectionsFindMappedNameTest.java| 145 +
 .../brooklyn/util/javalang/ReflectionsTest.java| 139 +---
 2 files changed, 146 insertions(+), 138 deletions(-)

diff --git 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
new file mode 100644
index 000..d4bb0f6
--- /dev/null
+++ 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
@@ -0,0 +1,145 @@
+package org.apache.brooklyn.util.javalang;
+
+import org.assertj.core.api.WithAssertions;
+import org.testng.annotations.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * Tests for {@link Reflections#findMappedNameAndLog(Map, String)} and
+ * {@link Reflections#findMappedNameMaybe(Map, String)} methods.
+ */
+public class ReflectionsFindMappedNameTest  implements WithAssertions {
+
+@Test
+public void givenRenamesIsNullThenReturnOriginalName() {
+//given
+final Map renames = null;
+final String originalName = createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenRenamesIsEmptyThenReturnOriginalName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenRenamesHasNoMatchThenReturnOriginalName() {
+//given
+final Map renames = new HashMap<>();
+renames.put(createAName(), createAName());
+final String originalName = createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenRenamesHasMatchThenReturnUpdatedName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName();
+final String updatedName = createAName();
+renames.put(originalName, updatedName);
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(updatedName);
+}
+
+@Test
+public void givenInnerClassHasNoMatchThenReturnOriginalName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName() + "$" + createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenInnerClassHasMatchThenReturnUpdatedName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName() + "$" + createAName();
+final String updatedName = createAName();
+renames.put(originalName, updatedName);
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(updatedName);
+}
+
+@Test
+public void 
givenInnerClassWhenOnlyOuterClassHasMatchThenReturnUpdatedName() {
+//given
+final Map renames = new HashMap<>();
+final String originalOuterClass = createAName();
+final String originalInnerClass = createAName();
+final String originalName = originalOuterClass + "$" + 
originalInnerClass;
+final String updatedOuterClass = createAName();
+final String updatedName = updatedOuterClass + "$" + 
originalInnerClass;
+renames.put(originalOuterClass, updatedOuterClass);
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(updatedName);
+}
+
+@Test
+public void 
givenInnerClassWhenOuterAndInnerClassHasMatchThenReturnInnerClassUpdatedName() {
+   

[brooklyn-server] 21/31: Extract overloaded typeSupplier() helpers

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 0fc25b22589e9af0e5f825f07fb477c7d6bd96e2
Author: Paul Campbell 
AuthorDate: Wed Oct 24 10:48:39 2018 +0100

Extract overloaded typeSupplier() helpers
---
 .../core/catalog/internal/CatalogUpgradeScanner.java   | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
index afb181f..342e3af 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
@@ -64,8 +64,7 @@ class CatalogUpgradeScanner {
 Maybe bundle = osgiManager.findBundle(managedBundle);
 if (bundle.isPresent()) {
 CatalogUpgrades catalogUpgrades = 
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(
-bundle.get(),
-new RegisteredTypesSupplier(managementContext, 
RegisteredTypePredicates.containingBundle(managedBundle)));
+bundle.get(), typeSupplier(managedBundle));
 catalogUpgradesBuilder.addAll(catalogUpgrades);
 } else {
 rebindLogger.info("Managed bundle "+managedBundle.getId()+" 
not found by OSGi Manager; "
@@ -79,13 +78,20 @@ class CatalogUpgradeScanner {
 final CatalogUpgrades.Builder catalogUpgradesBuilder
 ) {
 for (Bundle bundle : 
osgiManager.getFramework().getBundleContext().getBundles()) {
-final RegisteredTypesSupplier typeSupplier =
-new RegisteredTypesSupplier(managementContext,
-
RegisteredTypePredicates.containingBundle(bundle.getSymbolicName()));
 final CatalogUpgrades catalogUpgrades =
-
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(bundle, typeSupplier);
+
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(bundle, 
typeSupplier(bundle));
 catalogUpgradesBuilder.addAll(catalogUpgrades);
 }
 }
 
+private RegisteredTypesSupplier typeSupplier(final ManagedBundle 
managedBundle) {
+return new RegisteredTypesSupplier(managementContext,
+RegisteredTypePredicates.containingBundle(managedBundle));
+}
+
+private RegisteredTypesSupplier typeSupplier(final Bundle bundle) {
+return new RegisteredTypesSupplier(managementContext,
+
RegisteredTypePredicates.containingBundle(bundle.getSymbolicName()));
+}
+
 }



[brooklyn-server] 17/31: Remove stopwatches

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 6127e032294180f324de961c272c3abad0cbe767
Author: Paul Campbell 
AuthorDate: Tue Oct 23 17:06:41 2018 +0100

Remove stopwatches
---
 .../brooklyn/core/catalog/internal/CatalogInitialization.java  | 7 ---
 1 file changed, 7 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index 18e1f27..b355b97 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -29,7 +29,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.TimeUnit;
 
 import org.apache.brooklyn.api.catalog.BrooklynCatalog;
 import org.apache.brooklyn.api.catalog.CatalogItem;
@@ -618,7 +617,6 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 
 CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
 Collection managedBundles = 
osgiManager.get().getManagedBundles().values();
-final Stopwatch started = Stopwatch.createStarted();
 for (ManagedBundle managedBundle : managedBundles) {
 Maybe bundle = osgiManager.get().findBundle(managedBundle);
 if (bundle.isPresent()) {
@@ -631,10 +629,7 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 + "ignoring when calculating persisted state catalog 
upgrades");
 }
 }
-started.stop();
-log.info("Loaded managed bundles in " + 
started.elapsed(TimeUnit.MILLISECONDS) + "ms");
 
-final Stopwatch allbundleStopWatch = Stopwatch.createStarted();
 for (Bundle bundle : 
osgiManager.get().getFramework().getBundleContext().getBundles()) {
 final RegisteredTypesSupplier typeSupplier =
 new RegisteredTypesSupplier(managementContext,
@@ -643,8 +638,6 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(bundle, typeSupplier);
 catalogUpgradesBuilder.addAll(catalogUpgrades);
 }
-allbundleStopWatch.stop();
-log.info("Loaded all bundles in " + 
allbundleStopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms");
 
 return catalogUpgradesBuilder.build();
 }



[brooklyn-server] 31/31: This closes #1010

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit da8bf93b73f4f5bf91197d5b5290d9abe763419f
Merge: 061057c 5c22839
Author: Aled Sage 
AuthorDate: Wed Jan 16 16:38:57 2019 +

This closes #1010

 core/pom.xml   |   5 +
 .../catalog/internal/CatalogInitialization.java|  62 ++--
 .../catalog/internal/CatalogUpgradeScanner.java| 110 +++
 .../catalog/internal/RegisteredTypesSupplier.java  |  38 +++
 .../persist/DeserializingClassRenamesProvider.java |   5 +-
 .../brooklyn/core/typereg/BundleUpgradeParser.java |   2 +-
 .../internal/CatalogUpgradeScannerTest.java| 322 +
 .../RebindWithDeserializingClassRenamesTest.java   | 152 +++---
 .../brooklyn/core/typereg/BundleTestUtil.java  |  57 
 .../core/typereg/BundleUpgradeParserTest.java  |  27 +-
 ...ogUpgradesGetBundleUpgradedIfNecessaryTest.java | 246 
 parent/pom.xml |  41 +--
 pom.xml|   6 +-
 utils/common/pom.xml   |   6 +
 .../javalang/ReflectionsFindMappedNameTest.java| 141 +
 15 files changed, 1079 insertions(+), 141 deletions(-)



[brooklyn-server] 12/31: Coverage tests for existing CatalogUpgrades.getBundleUpgradedIfNecessary()

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 8e91fbee540b1fec025606bacc4540ae8c2ea180
Author: Paul Campbell 
AuthorDate: Thu Oct 18 11:16:58 2018 +0100

Coverage tests for existing CatalogUpgrades.getBundleUpgradedIfNecessary()
---
 ...ogUpgradesGetBundleUpgradedIfNecessaryTest.java | 219 +
 1 file changed, 219 insertions(+)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
new file mode 100644
index 000..70cd926
--- /dev/null
+++ 
b/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
@@ -0,0 +1,219 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.typereg;
+
+import com.google.common.collect.ImmutableListMultimap;
+import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.api.typereg.BrooklynTypeRegistry;
+import org.apache.brooklyn.api.typereg.ManagedBundle;
+import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
+import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
+import org.apache.brooklyn.util.guava.Maybe;
+import org.apache.brooklyn.util.osgi.VersionedName;
+import org.assertj.core.api.WithAssertions;
+import org.mockito.Mockito;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.UUID;
+
+import static org.apache.brooklyn.core.typereg.BundleUpgradeParser.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
+
+public class CatalogUpgradesGetBundleUpgradedIfNecessaryTest implements 
WithAssertions {
+
+private final ManagementContextInternal managementContext = 
mock(ManagementContextInternal.class);
+private final OsgiManager osgiManager = mock(OsgiManager.class);
+private final ManagedBundle managedBundle = mock(ManagedBundle.class);
+private final BasicBrooklynTypeRegistry typeRegistry = 
mock(BasicBrooklynTypeRegistry.class);
+
+private final String originalName = createAName("original", "1.0.0");
+private final String updatedName = createAName("updated", "2.0.0");
+private final VersionedName originalVersionedName = 
VersionedName.fromString(originalName);
+private final VersionedName updatedVersionedName = 
VersionedName.fromString(updatedName);
+private final VersionRangedName originalVersionRangedName =
+VersionRangedName.fromString(originalName, true);
+
+private CatalogUpgrades.Builder catalogUpgradesBuilder;
+
+@BeforeMethod
+public void setUp() {
+Mockito.reset(managementContext, osgiManager, managedBundle, 
typeRegistry);
+catalogUpgradesBuilder = CatalogUpgrades.builder();
+}
+
+@Test
+public void whenContextIsNullThenNull() {
+//given
+final ManagementContext managementContext = null;
+//when
+final String result = 
CatalogUpgrades.getBundleUpgradedIfNecessary(managementContext, originalName);
+//then
+assertThat(result).isNull();
+}
+
+@Test
+public void whenNameIsNullThenNull() {
+//given
+final String originalName = null;
+//when
+final String result = 
CatalogUpgrades.getBundleUpgradedIfNecessary(managementContext, originalName);
+//then
+assertThat(result).isNull();
+}
+
+@Test
+public void whenNonOSGIEnvironmentThenOriginalName() {
+//given
+givenANonOsgiEnvironment(managementContext);
+//when
+final String result = 
CatalogUpgrades.getBundleUpgradedIfNecessary(managementContext, originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void whenAlreadyInstalledThenOriginalName() {
+//given
+givenAnOsgiEnvironment(managementContext, osgiManager);
+givenBundleIsAlready

[brooklyn-server] 06/31: [common] Add unit tests for Reflections#findMappedName{AndLog, Maybe}()

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 8f11da59c266f885a1223e509230d89fb7ab96e3
Author: Paul Campbell 
AuthorDate: Tue Oct 9 16:38:52 2018 +0100

[common] Add unit tests for Reflections#findMappedName{AndLog,Maybe}()

Full coverage unit tests for these two methods.
---
 .../brooklyn/util/javalang/ReflectionsTest.java| 125 -
 1 file changed, 122 insertions(+), 3 deletions(-)

diff --git 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
index 3c628a9..554ad96 100644
--- 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
+++ 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
@@ -24,12 +24,12 @@ import static org.testng.Assert.assertTrue;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
 
 import org.apache.brooklyn.util.javalang.coerce.CommonAdaptorTypeCoercions;
 import org.apache.brooklyn.util.javalang.coerce.TypeCoercer;
 import org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible;
+import org.assertj.core.api.WithAssertions;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -38,7 +38,7 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
-public class ReflectionsTest {
+public class ReflectionsTest implements WithAssertions {
 
 @Test
 public void testFindPublicMethodsOrderedBySuper() throws Exception {
@@ -229,6 +229,125 @@ public class ReflectionsTest {
 Assert.assertEquals(Reflections.getAllInterfaces(C.class), 
ImmutableList.of(M.class, K.class, I.class, J.class, L.class));
 }
 
+/**
+ * Tests for {@link Reflections#findMappedNameAndLog(Map, String)} and
+ * {@link Reflections#findMappedNameMaybe(Map, String)} methods.
+ */
+public class FindMappedName {
+
+@Test
+public void givenRenamesIsNullThenReturnOriginalName() {
+//given
+final Map renames = null;
+final String originalName = createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenRenamesIsEmptyThenReturnOriginalName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenRenamesHasNoMatchThenReturnOriginalName() {
+//given
+final Map renames = new HashMap<>();
+renames.put(createAName(), createAName());
+final String originalName = createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenRenamesHasMatchThenReturnUpdatedName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName();
+final String updatedName = createAName();
+renames.put(originalName, updatedName);
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(updatedName);
+}
+
+@Test
+public void givenInnerClassHasNoMatchThenReturnOriginalName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName() + "$" + createAName();
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+assertThat(result).isEqualTo(originalName);
+}
+
+@Test
+public void givenInnerClassHasMatchThenReturnUpdatedName() {
+//given
+final Map renames = new HashMap<>();
+final String originalName = createAName() + "$" + createAName();
+final String updatedName = createAName();
+renames.put(originalName, updatedName);
+//when
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
+//then
+  

[brooklyn-server] 08/31: [common] fix typo in test

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit c4234deb76d718fa2a39725cefd76e7e6764d5ad
Author: Paul Campbell 
AuthorDate: Tue Oct 9 17:13:20 2018 +0100

[common] fix typo in test
---
 .../java/org/apache/brooklyn/util/javalang/ReflectionsTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
index c95d439..06c5f47 100644
--- 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
+++ 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsTest.java
@@ -346,16 +346,16 @@ public class ReflectionsTest implements WithAssertions {
 @Test
 public void allClassesInOneBundleAreNowInOtherBundle() {
 //given
-final Map rename = new HashMap<>();
+final Map renames = new HashMap<>();
 final String wildcard = "*";
 final String originalBundle = 
"wrap_blah_aws-java-sdk-bundle-1.11.245.jar:";
 final String updatedBundle = 
"wrap_blah_aws-java-sdk-bundle-1.11.411.jar:";
-rename.put(originalBundle + wildcard, updatedBundle + wildcard);
+renames.put(originalBundle + wildcard, updatedBundle + wildcard);
 final String className = createAName();
 final String originalName = originalBundle + className;
 final String updatedName = updatedBundle + className;
 //when
-final String result = Reflections.findMappedNameAndLog(rename, 
originalName);
+final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
 //then
 assertThat(result).isSameAs(updatedName);
 }



[brooklyn-server] 13/31: Extract newMockBundle() utility methods to BundleTestUtil

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 0ec04184d60ea00ecd0f4cea2d8faac2529dae93
Author: Paul Campbell 
AuthorDate: Mon Oct 22 14:20:45 2018 +0100

Extract newMockBundle() utility methods to BundleTestUtil
---
 .../brooklyn/core/typereg/BundleTestUtil.java  | 39 ++
 .../core/typereg/BundleUpgradeParserTest.java  | 27 +--
 2 files changed, 40 insertions(+), 26 deletions(-)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java 
b/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java
new file mode 100644
index 000..2a5c3d7
--- /dev/null
+++ b/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java
@@ -0,0 +1,39 @@
+package org.apache.brooklyn.core.typereg;
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.brooklyn.util.osgi.VersionedName;
+import org.mockito.Mockito;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Map;
+
+class BundleTestUtil {
+
+static Bundle newMockBundle(Map rawHeaders) {
+return newMockBundle(VersionedName.fromString("do.no.care:1.2.3"), 
rawHeaders);
+}
+
+static Bundle newMockBundle(VersionedName name) {
+return newMockBundle(name, ImmutableMap.of());
+}
+
+static Bundle newMockBundle(VersionedName name, Map 
rawHeaders) {
+Dictionary headers = new Hashtable<>(rawHeaders);
+Bundle result;
+try {
+result = Mockito.mock(Bundle.class);
+} catch (Exception e) {
+throw new IllegalStateException("Java too old.  There is a bug in 
really early java 1.8.0 "
++ "that causes mocks to fail, and has probably caused 
this.", e);
+}
+Mockito.when(result.getHeaders()).thenReturn(headers);
+
Mockito.when(result.getSymbolicName()).thenReturn(name.getSymbolicName());
+
Mockito.when(result.getVersion()).thenReturn(Version.valueOf(name.getOsgiVersionString()));
+return result;
+}
+
+
+}
diff --git 
a/core/src/test/java/org/apache/brooklyn/core/typereg/BundleUpgradeParserTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/typereg/BundleUpgradeParserTest.java
index 8803294..1b437b3 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/typereg/BundleUpgradeParserTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/typereg/BundleUpgradeParserTest.java
@@ -18,14 +18,12 @@
  */
 package org.apache.brooklyn.core.typereg;
 
+import static org.apache.brooklyn.core.typereg.BundleTestUtil.newMockBundle;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
-import java.util.Dictionary;
-import java.util.Hashtable;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import org.apache.brooklyn.api.catalog.CatalogItem;
@@ -401,29 +399,6 @@ public class BundleUpgradeParserTest {
 assertEquals(BundleUpgradeParser.stripQuotes("''"), "");
 }
 
-private Bundle newMockBundle(Map rawHeaders) {
-return newMockBundle(VersionedName.fromString("do.no.care:1.2.3"), 
rawHeaders);
-}
-
-private Bundle newMockBundle(VersionedName name) {
-return newMockBundle(name, ImmutableMap.of());
-}
-
-private Bundle newMockBundle(VersionedName name, Map 
rawHeaders) {
-Dictionary headers = new Hashtable<>(rawHeaders);
-Bundle result;
-try {
-result = Mockito.mock(Bundle.class);
-} catch (Exception e) {
-throw new IllegalStateException("Java too old.  There is a bug in 
really early java 1.8.0 "
-+ "that causes mocks to fail, and has probably caused this.", 
e);
-}
-Mockito.when(result.getHeaders()).thenReturn(headers);
-
Mockito.when(result.getSymbolicName()).thenReturn(name.getSymbolicName());
-
Mockito.when(result.getVersion()).thenReturn(Version.valueOf(name.getOsgiVersionString()));
-return result;
-}
-
 private RegisteredType newMockRegisteredType(String symbolicName, String 
version) {
 RegisteredType result = Mockito.mock(RegisteredType.class);
 Mockito.when(result.getSymbolicName()).thenReturn(symbolicName);



[brooklyn-server] 11/31: Add assertj as test dependency

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit a0d2d8451b7d92fbdf77d7e27a2a254d20a18f4b
Author: Paul Campbell 
AuthorDate: Wed Oct 17 17:20:45 2018 +0100

Add assertj as test dependency
---
 pom.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pom.xml b/pom.xml
index 8b5f56b..4016730 100644
--- a/pom.xml
+++ b/pom.xml
@@ -183,6 +183,9 @@
 6121
 
 
+6.10
+2.7.12
+3.11.1
 2.7
 2.19.1
 6.10



[brooklyn-server] 20/31: Extract CatalogUpgradeScanner

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 64c869c8ee7f5a25f4f0b7cd02f9a2c1e53db5bb
Author: Paul Campbell 
AuthorDate: Wed Oct 24 10:41:39 2018 +0100

Extract CatalogUpgradeScanner
---
 .../catalog/internal/CatalogInitialization.java| 45 +--
 .../catalog/internal/CatalogUpgradeScanner.java| 91 ++
 2 files changed, 95 insertions(+), 41 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index 4588119..9dcaa4b 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -112,6 +112,7 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 private boolean hasRunFinalInitialization = false;
 
 private ManagementContextInternal managementContext;
+private CatalogUpgradeScanner catalogUpgradeScanner;
 private boolean isStartingUp = false;
 private boolean failOnStartupErrors = false;
 
@@ -134,6 +135,7 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 if (this.managementContext!=null && 
managementContext!=this.managementContext)
 throw new IllegalStateException("Cannot switch management context, 
from "+this.managementContext+" to "+managementContext);
 this.managementContext = (ManagementContextInternal) managementContext;
+catalogUpgradeScanner = new 
CatalogUpgradeScanner(this.managementContext);
 }
 
 /** Called by the framework to set true while starting up, and false 
afterwards,
@@ -251,8 +253,8 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 }
 
 populateInitialCatalogImpl(true);
-
-CatalogUpgrades catalogUpgrades = 
gatherCatalogUpgradesInstructions(rebindLogger);
+
+final CatalogUpgrades catalogUpgrades = 
catalogUpgradeScanner.scan(rebindLogger);
 CatalogUpgrades.storeInManagementContext(catalogUpgrades, 
managementContext);
 PersistedCatalogState filteredPersistedState = 
filterBundlesAndCatalogInPersistedState(persistedState, rebindLogger);
 addPersistedCatalogImpl(filteredPersistedState, exceptionHandler, 
rebindLogger);
@@ -606,45 +608,6 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 return new PersistedCatalogState(bundles, legacyCatalogItems);
 }
 
-private CatalogUpgrades gatherCatalogUpgradesInstructions(RebindLogger 
rebindLogger) {
-Maybe osgiManager = 
((ManagementContextInternal)managementContext).getOsgiManager();
-if (osgiManager.isAbsent()) {
-// Can't find any bundles to tell if there are upgrades. Could be 
running tests; do no filtering.
-return CatalogUpgrades.EMPTY;
-}
-final CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
-scanManagedBundles(osgiManager.get(), catalogUpgradesBuilder, 
rebindLogger);
-scanAllBundles(osgiManager.get(), catalogUpgradesBuilder);
-return catalogUpgradesBuilder.build();
-}
-
-private void scanManagedBundles(OsgiManager osgiManager, 
CatalogUpgrades.Builder catalogUpgradesBuilder, RebindLogger rebindLogger) {
-Collection managedBundles = 
osgiManager.getManagedBundles().values();
-for (ManagedBundle managedBundle : managedBundles) {
-Maybe bundle = osgiManager.findBundle(managedBundle);
-if (bundle.isPresent()) {
-CatalogUpgrades catalogUpgrades = 
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(
-bundle.get(),
-new RegisteredTypesSupplier(managementContext, 
RegisteredTypePredicates.containingBundle(managedBundle)));
-catalogUpgradesBuilder.addAll(catalogUpgrades);
-} else {
-rebindLogger.info("Managed bundle "+managedBundle.getId()+" 
not found by OSGi Manager; "
-+ "ignoring when calculating persisted state catalog 
upgrades");
-}
-}
-}
-
-private void scanAllBundles(OsgiManager osgiManager, 
CatalogUpgrades.Builder catalogUpgradesBuilder) {
-for (Bundle bundle : 
osgiManager.getFramework().getBundleContext().getBundles()) {
-final RegisteredTypesSupplier typeSupplier =
-new RegisteredTypesSupplier(managementContext,
-
RegisteredTypePredicates.containingBundle(bundle.getSymbolicNa

[brooklyn-server] 03/31: [core] Refactor rebind test for clarity

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 2c0f0c25fcbdc52272fb25e6c0e689bbfec91a6f
Author: Paul Campbell 
AuthorDate: Tue Oct 9 13:04:16 2018 +0100

[core] Refactor rebind test for clarity

* Uses assertj for better error messages and soft assertions (lists all
  failures, not just the first found)
* Replace use of com.google.common with pure JDK
---
 .../RebindWithDeserializingClassRenamesTest.java   | 152 ++---
 1 file changed, 105 insertions(+), 47 deletions(-)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindWithDeserializingClassRenamesTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindWithDeserializingClassRenamesTest.java
index a66c7d9..40b4a3f 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindWithDeserializingClassRenamesTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindWithDeserializingClassRenamesTest.java
@@ -18,10 +18,14 @@
  */
 package org.apache.brooklyn.core.mgmt.rebind;
 
-import static org.testng.Assert.assertEquals;
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.assertj.core.api.SoftAssertions.assertSoftly;
 
 import java.io.File;
-import java.util.Map;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import org.apache.brooklyn.config.ConfigInheritance;
 import org.apache.brooklyn.config.ConfigKey;
@@ -29,65 +33,119 @@ import 
org.apache.brooklyn.core.config.BasicConfigInheritance;
 import org.apache.brooklyn.core.config.ConfigKeys.InheritanceContext;
 import org.apache.brooklyn.core.config.ConfigPredicates;
 import org.apache.brooklyn.core.entity.EntityInternal;
-import org.apache.brooklyn.test.Asserts;
 import org.apache.brooklyn.util.core.ResourceUtils;
 import org.apache.brooklyn.util.os.Os;
+import org.assertj.core.api.WithAssertions;
 import org.testng.annotations.Test;
 
-import com.google.common.base.Charsets;
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-import com.google.common.io.Files;
+public class RebindWithDeserializingClassRenamesTest extends 
RebindTestFixtureWithApp implements WithAssertions {
 
-public class RebindWithDeserializingClassRenamesTest extends 
RebindTestFixtureWithApp {
+private static final String LEGACY_INHERITANCE_NONE = 
"org.apache.brooklyn.config.ConfigInheritance$None";
+private static final String LEGACY_INHERITANCE_ALWAYS = 
"org.apache.brooklyn.config.ConfigInheritance$Always";
+private static final String LEGACY_INHERITANCE_MERGED = 
"org.apache.brooklyn.config.ConfigInheritance$Merged";
+private static final String RESOURCE_PATH = 
"org/apache/brooklyn/core/test/rebind/deserializing-class-names/";
+private static final String ENTITY_ID = "toruf2wxg4";
 
 /** also see {@link RebindConfigInheritanceTest} */
 @Test
 public void testRebindWillRenameLegacyConfigInheritance() throws Exception 
{
-Map expectedTransforms = ImmutableMap.builder()
-.put("org.apache.brooklyn.config.ConfigInheritance$None", 
BasicConfigInheritance.NOT_REINHERITED.getClass().getName())
-.put("org.apache.brooklyn.config.ConfigInheritance$Always", 
BasicConfigInheritance.OVERWRITE.getClass().getName())
-.put("org.apache.brooklyn.config.ConfigInheritance$Merged", 
BasicConfigInheritance.DEEP_MERGE.getClass().getName())
-.build();
-
-String entityId = "toruf2wxg4";
-String entityResource = 
"org/apache/brooklyn/core/test/rebind/deserializing-class-names/"+entityId;
-String persistedEntity = 
ResourceUtils.create(RebindWithDeserializingClassRenamesTest.class).getResourceAsString(entityResource);
-
-// Orig state contains the old names (and not the new names)
-for (Map.Entry entry : expectedTransforms.entrySet()) {
-Asserts.assertStringContains(persistedEntity, entry.getKey());
-Asserts.assertStringDoesNotContain(persistedEntity, 
entry.getValue());
-}
-
-File persistedEntityFile = new File(mementoDir, 
Os.mergePaths("entities", entityId));
-Files.write(persistedEntity.getBytes(), persistedEntityFile);
-
+//given
+final List expectedTransforms = 
Collections.unmodifiableList(Arrays.asList(
+Transform.of(LEGACY_INHERITANCE_NONE, 
BasicConfigInheritance.NOT_REINHERITED, "my.config.inheritanceNone"),
+Transform.of(LEGACY_INHERITANCE_ALWAYS, 
BasicConfigInheritance.OVERWRITE, "my.config.inheritanceAlways

[brooklyn-server] 25/31: Make BundleUtilTest public

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 943f3b8ab7ce4a17235d10072c0d5ec00e6e2e86
Author: Paul Campbell 
AuthorDate: Wed Oct 24 13:05:59 2018 +0100

Make BundleUtilTest public
---
 .../java/org/apache/brooklyn/core/typereg/BundleTestUtil.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java 
b/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java
index a869514..04a2376 100644
--- a/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java
+++ b/core/src/test/java/org/apache/brooklyn/core/typereg/BundleTestUtil.java
@@ -28,17 +28,17 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Map;
 
-class BundleTestUtil {
+public class BundleTestUtil {
 
-static Bundle newMockBundle(Map rawHeaders) {
+public static Bundle newMockBundle(Map rawHeaders) {
 return newMockBundle(VersionedName.fromString("do.no.care:1.2.3"), 
rawHeaders);
 }
 
-static Bundle newMockBundle(VersionedName name) {
+public static Bundle newMockBundle(VersionedName name) {
 return newMockBundle(name, ImmutableMap.of());
 }
 
-static Bundle newMockBundle(VersionedName name, Map 
rawHeaders) {
+public static Bundle newMockBundle(VersionedName name, Map 
rawHeaders) {
 Dictionary headers = new Hashtable<>(rawHeaders);
 Bundle result;
 try {



[brooklyn-server] 14/31: whenUpgradingAWrappedBundleThenUpdatedName()

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 441213c8980ae7181760fffedb177042346cfcb1
Author: Paul Campbell 
AuthorDate: Mon Oct 22 14:28:44 2018 +0100

whenUpgradingAWrappedBundleThenUpdatedName()
---
 ...ogUpgradesGetBundleUpgradedIfNecessaryTest.java | 29 +-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git 
a/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
index 70cd926..126a1ef 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
@@ -18,21 +18,26 @@
  */
 package org.apache.brooklyn.core.typereg;
 
+import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableListMultimap;
+import com.google.common.collect.ImmutableMap;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.api.typereg.BrooklynTypeRegistry;
 import org.apache.brooklyn.api.typereg.ManagedBundle;
+import org.apache.brooklyn.api.typereg.RegisteredType;
 import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.util.guava.Maybe;
 import org.apache.brooklyn.util.osgi.VersionedName;
 import org.assertj.core.api.WithAssertions;
 import org.mockito.Mockito;
+import org.osgi.framework.Bundle;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.UUID;
+import java.util.*;
 
+import static org.apache.brooklyn.core.typereg.BundleTestUtil.newMockBundle;
 import static org.apache.brooklyn.core.typereg.BundleUpgradeParser.*;
 import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.mock;
@@ -137,6 +142,28 @@ public class 
CatalogUpgradesGetBundleUpgradedIfNecessaryTest implements WithAsse
 assertThat(result).isEqualTo(updatedName);
 }
 
+@Test
+public void whenUpgradingAWrappedBundleThenUpdatedName() {
+//given
+givenAnOsgiEnvironment(managementContext, osgiManager);
+givenBundleIsNotAlreadyInstalled(osgiManager, originalVersionedName);
+givenManagementContextHasTypeRegistry(managementContext, typeRegistry);
+givenRenameIsFound(managementContext, typeRegistry, 
catalogUpgradesBuilder, updatedVersionedName, originalVersionRangedName);
+
+final Bundle bundle = newMockBundle(updatedVersionedName, 
ImmutableMap.of(
+BundleUpgradeParser.MANIFEST_HEADER_UPGRADE_FOR_BUNDLES, 
"original:[1.0.0,2.0.0)" + "=" + updatedName));
+
+final CatalogUpgrades catalogUpgrades = 
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(
+bundle, (Supplier>) ArrayList::new
+);
+System.out.println("catalogUpgrades = " + catalogUpgrades);
+
+//when
+final String result = 
CatalogUpgrades.getBundleUpgradedIfNecessary(managementContext, originalName);
+//then
+assertThat(result).isEqualTo(updatedName);
+}
+
 private static void givenANonOsgiEnvironment(
 final ManagementContextInternal managementContext
 ) {



[brooklyn-server] 27/31: Remove previous attempt at failing test

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 09e65df7d46b5177b14c1e4565d4c5249697aee0
Author: Paul Campbell 
AuthorDate: Wed Oct 24 17:48:41 2018 +0100

Remove previous attempt at failing test

Solution wasn't found from this test, so removing it again.
---
 .../util/javalang/ReflectionsFindMappedNameTest.java   | 18 --
 1 file changed, 18 deletions(-)

diff --git 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
index 173d0a9..76642df 100644
--- 
a/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
+++ 
b/utils/common/src/test/java/org/apache/brooklyn/util/javalang/ReflectionsFindMappedNameTest.java
@@ -138,24 +138,6 @@ public class ReflectionsFindMappedNameTest  implements 
WithAssertions {
 assertThat(result).isEqualTo(updatedName);
 }
 
-//wrap_blah_aws-java-sdk-bundle-1.11.245.jar\:*  : 
wrap_blah_aws-java-sdk-bundle-1.11.411.jar\:*
-@Test
-public void allClassesInOneBundleAreNowInOtherBundle() {
-//given
-final Map renames = new HashMap<>();
-final String wildcard = "*";
-final String originalBundle = 
"wrap_blah_aws-java-sdk-bundle-1.11.245.jar:";
-final String updatedBundle = 
"wrap_blah_aws-java-sdk-bundle-1.11.411.jar:";
-renames.put(originalBundle + wildcard, updatedBundle + wildcard);
-final String className = createAName();
-final String originalName = originalBundle + className;
-final String updatedName = updatedBundle + className;
-//when
-final String result = Reflections.findMappedNameAndLog(renames, 
originalName);
-//then
-assertThat(result).isSameAs(updatedName);
-}
-
 private String createAName() {
 return UUID.randomUUID().toString();
 }



[brooklyn-server] 18/31: Extract scanManagedBundles() and scanAllBundles()

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit ef42313efc3b4d88beb540bacef82f9f7e3fc71e
Author: Paul Campbell 
AuthorDate: Tue Oct 23 17:16:39 2018 +0100

Extract scanManagedBundles() and scanAllBundles()
---
 .../core/catalog/internal/CatalogInitialization.java  | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index b355b97..da7f1f6 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -614,11 +614,16 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 // Can't find any bundles to tell if there are upgrades. Could be 
running tests; do no filtering.
 return CatalogUpgrades.EMPTY;
 }
-
-CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
-Collection managedBundles = 
osgiManager.get().getManagedBundles().values();
+final CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
+scanManagedBundles(osgiManager.get(), catalogUpgradesBuilder, 
rebindLogger);
+scanAllBundles(osgiManager.get(), catalogUpgradesBuilder);
+return catalogUpgradesBuilder.build();
+}
+
+private void scanManagedBundles(OsgiManager osgiManager, 
CatalogUpgrades.Builder catalogUpgradesBuilder, RebindLogger rebindLogger) {
+Collection managedBundles = 
osgiManager.getManagedBundles().values();
 for (ManagedBundle managedBundle : managedBundles) {
-Maybe bundle = osgiManager.get().findBundle(managedBundle);
+Maybe bundle = osgiManager.findBundle(managedBundle);
 if (bundle.isPresent()) {
 CatalogUpgrades catalogUpgrades = 
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(
 bundle.get(),
@@ -629,8 +634,10 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 + "ignoring when calculating persisted state catalog 
upgrades");
 }
 }
+}
 
-for (Bundle bundle : 
osgiManager.get().getFramework().getBundleContext().getBundles()) {
+private void scanAllBundles(OsgiManager osgiManager, 
CatalogUpgrades.Builder catalogUpgradesBuilder) {
+for (Bundle bundle : 
osgiManager.getFramework().getBundleContext().getBundles()) {
 final RegisteredTypesSupplier typeSupplier =
 new RegisteredTypesSupplier(managementContext,
 
RegisteredTypePredicates.containingBundle(bundle.getSymbolicName()));
@@ -638,8 +645,6 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(bundle, typeSupplier);
 catalogUpgradesBuilder.addAll(catalogUpgrades);
 }
-
-return catalogUpgradesBuilder.build();
 }
 
 private static class RegisteredTypesSupplier implements 
Supplier> {



[brooklyn-server] 01/31: Bump assertj from 2.2.0 to 3.11.1

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 890ef568a1a710d62f0cbd160a8d0123b4655536
Author: Paul Campbell 
AuthorDate: Mon Oct 8 17:06:58 2018 +0100

Bump assertj from 2.2.0 to 3.11.1

As brooklyn is now built with Java 8 (brooklyn-server/pom.xml java.version =
1.8) there is no reason not to take advantage of the improved fluent 
assertions
in assertj 3.x.
---
 parent/pom.xml | 5 +
 pom.xml| 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 971c76e..e0e2633 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -581,6 +581,11 @@
 org.ops4j.pax.web
 pax-web-spi
 ${pax-web.version}
+   
+   
+org.assertj
+assertj-core
+${assertj.version}
 


diff --git a/pom.xml b/pom.xml
index 20c0bc8..8b5f56b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -187,7 +187,7 @@
 2.19.1
 6.10
 2.7.12
-2.2.0 
+3.11.1
 1.1
 2012
 



[brooklyn-server] 19/31: Extract RegisteredTypesSupplier to outer class

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 7328d9f7005be178170721d566e6073858939972
Author: Paul Campbell 
AuthorDate: Wed Oct 24 10:38:03 2018 +0100

Extract RegisteredTypesSupplier to outer class

Will be required in the CatalogUpgradeScanner that is about to be extracted.
---
 .../catalog/internal/CatalogInitialization.java| 16 -
 .../catalog/internal/RegisteredTypesSupplier.java  | 38 ++
 2 files changed, 38 insertions(+), 16 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index da7f1f6..4588119 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -75,9 +75,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.Beta;
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Predicate;
 import com.google.common.base.Stopwatch;
-import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
@@ -647,20 +645,6 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 }
 }
 
-private static class RegisteredTypesSupplier implements 
Supplier> {
-private final ManagementContext mgmt;
-private final Predicate filter;
-
-RegisteredTypesSupplier(ManagementContext mgmt, Predicate predicate) {
-this.mgmt = mgmt;
-this.filter = predicate;
-}
-@Override
-public Iterable get() {
-return mgmt.getTypeRegistry().getMatching(filter);
-}
-}
-
 public interface RebindLogger {
 void debug(String message, Object... args);
 void info(String message, Object... args);
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/RegisteredTypesSupplier.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/RegisteredTypesSupplier.java
new file mode 100644
index 000..5c32164
--- /dev/null
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/RegisteredTypesSupplier.java
@@ -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.
+ */
+package org.apache.brooklyn.core.catalog.internal;
+
+import com.google.common.base.Predicate;
+import com.google.common.base.Supplier;
+import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.api.typereg.RegisteredType;
+
+class RegisteredTypesSupplier implements Supplier> {
+private final ManagementContext mgmt;
+private final Predicate filter;
+
+RegisteredTypesSupplier(ManagementContext mgmt, Predicate predicate) {
+this.mgmt = mgmt;
+this.filter = predicate;
+}
+@Override
+public Iterable get() {
+return mgmt.getTypeRegistry().getMatching(filter);
+}
+}



[brooklyn-server] 04/31: [core] rename excessively long private constant

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 5d5a2dd0e5392a05f1b155371d30d45f4e7d74cb
Author: Paul Campbell 
AuthorDate: Tue Oct 9 15:43:13 2018 +0100

[core] rename excessively long private constant

The constant is private to the class, there are not other constants. There 
is no
need to repeat most of the classname in the constants name.
---
 .../core/mgmt/persist/DeserializingClassRenamesProvider.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/DeserializingClassRenamesProvider.java
 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/DeserializingClassRenamesProvider.java
index 49f4bce..78cff25 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/DeserializingClassRenamesProvider.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/DeserializingClassRenamesProvider.java
@@ -38,12 +38,13 @@ import org.apache.brooklyn.util.javalang.Reflections;
 @Beta
 public class DeserializingClassRenamesProvider extends DeserializingProvider{
 
-private static final String DESERIALIZING_CLASS_RENAMES_PROPERTIES_PATH = 
"classpath://org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties";
+private static final String RENAMES_PROPERTIES =
+
"classpath://org/apache/brooklyn/core/mgmt/persist/deserializingClassRenames.properties";
 
 public static final DeserializingClassRenamesProvider INSTANCE = new 
DeserializingClassRenamesProvider();
 
 private DeserializingClassRenamesProvider(){
-super(ImmutableList.of(new 
PropertiesConfigLoader(DESERIALIZING_CLASS_RENAMES_PROPERTIES_PATH)));
+super(ImmutableList.of(new 
PropertiesConfigLoader(RENAMES_PROPERTIES)));
 }
 
 /**



[brooklyn-server] 16/31: Load all jars to find upgrades for wrapped bundles

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit 748bfa0d8a22895749f8c7cfe3203f43a8dc7abe
Author: Paul Campbell 
AuthorDate: Tue Oct 23 16:34:03 2018 +0100

Load all jars to find upgrades for wrapped bundles
---
 .../core/catalog/internal/CatalogInitialization.java| 17 +
 1 file changed, 17 insertions(+)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index f35e8a9..18e1f27 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -29,6 +29,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.brooklyn.api.catalog.BrooklynCatalog;
 import org.apache.brooklyn.api.catalog.CatalogItem;
@@ -617,6 +618,7 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 
 CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
 Collection managedBundles = 
osgiManager.get().getManagedBundles().values();
+final Stopwatch started = Stopwatch.createStarted();
 for (ManagedBundle managedBundle : managedBundles) {
 Maybe bundle = osgiManager.get().findBundle(managedBundle);
 if (bundle.isPresent()) {
@@ -629,6 +631,21 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 + "ignoring when calculating persisted state catalog 
upgrades");
 }
 }
+started.stop();
+log.info("Loaded managed bundles in " + 
started.elapsed(TimeUnit.MILLISECONDS) + "ms");
+
+final Stopwatch allbundleStopWatch = Stopwatch.createStarted();
+for (Bundle bundle : 
osgiManager.get().getFramework().getBundleContext().getBundles()) {
+final RegisteredTypesSupplier typeSupplier =
+new RegisteredTypesSupplier(managementContext,
+
RegisteredTypePredicates.containingBundle(bundle.getSymbolicName()));
+final CatalogUpgrades catalogUpgrades =
+
BundleUpgradeParser.parseBundleManifestForCatalogUpgrades(bundle, typeSupplier);
+catalogUpgradesBuilder.addAll(catalogUpgrades);
+}
+allbundleStopWatch.stop();
+log.info("Loaded all bundles in " + 
allbundleStopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms");
+
 return catalogUpgradesBuilder.build();
 }
 



[brooklyn-server] 24/31: Limit violation of the law of demeter

2019-01-16 Thread aledsage
This is an automated email from the ASF dual-hosted git repository.

aledsage pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git

commit cdb298faafada153bcd1e81f1a65b983d0752611
Author: Paul Campbell 
AuthorDate: Wed Oct 24 11:48:39 2018 +0100

Limit violation of the law of demeter

Push out drilling into the orgimanager,framework.bundlecontext.bundles to
callers.
---
 .../core/catalog/internal/CatalogInitialization.java| 10 +++---
 .../core/catalog/internal/CatalogUpgradeScanner.java| 13 +++--
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
index fe57f41..29a9601 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogInitialization.java
@@ -68,6 +68,7 @@ import org.apache.brooklyn.util.os.Os;
 import org.apache.brooklyn.util.osgi.VersionedName;
 import org.apache.brooklyn.util.text.Strings;
 import org.apache.brooklyn.util.time.Duration;
+import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -256,12 +257,15 @@ public class CatalogInitialization implements 
ManagementContextInjectable {
 
 populateInitialCatalogImpl(true);
 
-final Maybe osgiManager = 
managementContext.getOsgiManager();
-if (osgiManager.isAbsent()) {
+final Maybe maybesOsgiManager = 
managementContext.getOsgiManager();
+if (maybesOsgiManager.isAbsent()) {
 // Can't find any bundles to tell if there are upgrades. Could 
be running tests; do no filtering.
 
CatalogUpgrades.storeInManagementContext(CatalogUpgrades.EMPTY, 
managementContext);
 } else {
-final CatalogUpgrades catalogUpgrades = 
catalogUpgradeScanner.scan(osgiManager.get(), rebindLogger);
+final OsgiManager osgiManager = maybesOsgiManager.get();
+final BundleContext bundleContext = 
osgiManager.getFramework().getBundleContext();
+final CatalogUpgrades catalogUpgrades =
+catalogUpgradeScanner.scan(osgiManager, bundleContext, 
rebindLogger);
 CatalogUpgrades.storeInManagementContext(catalogUpgrades, 
managementContext);
 }
 PersistedCatalogState filteredPersistedState = 
filterBundlesAndCatalogInPersistedState(persistedState, rebindLogger);
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
index b48bbf8..efe902d 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUpgradeScanner.java
@@ -25,9 +25,9 @@ import org.apache.brooklyn.api.typereg.RegisteredType;
 import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
 import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.core.typereg.BundleUpgradeParser.CatalogUpgrades;
-import org.apache.brooklyn.core.typereg.RegisteredTypePredicates;
 import org.apache.brooklyn.util.guava.Maybe;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 
 import java.util.Collection;
 import java.util.function.BiFunction;
@@ -57,11 +57,12 @@ class CatalogUpgradeScanner {
 
 public CatalogUpgrades scan(
 final OsgiManager osgiManager,
+final BundleContext bundleContext,
 final CatalogInitialization.RebindLogger rebindLogger
 ) {
 final CatalogUpgrades.Builder catalogUpgradesBuilder = 
CatalogUpgrades.builder();
 scanManagedBundles(osgiManager, catalogUpgradesBuilder, rebindLogger);
-scanAllBundles(osgiManager, catalogUpgradesBuilder);
+scanUnmanagedBundles(catalogUpgradesBuilder, bundleContext);
 return catalogUpgradesBuilder.build();
 }
 
@@ -83,11 +84,11 @@ class CatalogUpgradeScanner {
 }
 }
 
-private void scanAllBundles(
-final OsgiManager osgiManager,
-final CatalogUpgrades.Builder catalogUpgradesBuilder
+private void scanUnmanagedBundles(
+final CatalogUpgrades.Builder catalogUpgradesBuilder,
+final BundleContext bundleContext
 ) {
-for (Bundle bundle : 
osgiManager.getFramework().getBundleContext().getBundles()) {
+for (Bundle bundle : bundleContext.getBundles()) {
 final CatalogUpgrades catalogUpgrades = 
bundleUpgradeParser.apply(bundle, typeSupplier(bundle

[2/2] brooklyn-ui git commit: This closes #111

2018-11-20 Thread aledsage
This closes #111


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

Branch: refs/heads/master
Commit: 13c56f078e599734ba50312e55ff452e083bb259
Parents: a9fcd52 8a82585
Author: Aled Sage 
Authored: Tue Nov 20 21:45:43 2018 +
Committer: Aled Sage 
Committed: Tue Nov 20 21:45:43 2018 +

--
 .../spec-editor/spec-editor.directive.js| 23 +---
 1 file changed, 20 insertions(+), 3 deletions(-)
--




[1/2] brooklyn-ui git commit: fix json editor state

2018-11-20 Thread aledsage
Repository: brooklyn-ui
Updated Branches:
  refs/heads/master a9fcd5276 -> 13c56f078


fix json editor state


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

Branch: refs/heads/master
Commit: 8a82585bcf4a402f6b935aca351880dd65819ead
Parents: 4093d1f
Author: Alex Heneveld 
Authored: Tue Nov 20 13:35:07 2018 +
Committer: Alex Heneveld 
Committed: Tue Nov 20 13:35:07 2018 +

--
 .../spec-editor/spec-editor.directive.js| 23 +---
 1 file changed, 20 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/8a82585b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
--
diff --git 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
index 9c18129..ecfa249 100644
--- 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
+++ 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
@@ -699,7 +699,24 @@ export function specEditorDirective($rootScope, 
$templateCache, $injector, $sani
 // errors don't get stringified because model value was 
not parsed
 return value;
 }
-return JSON.stringify(value);
+// if current local value gives same result then don't change 
it
+// (don't interrupt user's flow, and respect their spacing, at 
least until
+// they click away; ultimately we would like access to the 
parse tree,
+// so we could take the text as entered exactly (maybe 
stripping initial whitespace),
+// also supporting yaml and comments, but that is a bigger 
task!)
+if (scope.config && typeof scope.config[key] === 'string') {
+try {
+if 
(JSON.stringify(JSON.parse(scope.config[key]))===JSON.stringify(value)) {
+return scope.config[key];
+}
+} catch (ignoredError) {
+console.log("Couldn't handle entered JSON", 
scope.config[key], ignoredError);
+}
+}
+// otherwise pretty print it, so they get decent multiline on 
first load and
+// if they click off the entity then back on to the entity and 
this field
+// (we'd like to respect what they actually typed but that 
needs the parse tree, as above)
+return JSON.stringify(value, null, "  ");
 }
 
 // else treat as value, with array/map special
@@ -737,8 +754,8 @@ export function specEditorDirective($rootScope, 
$templateCache, $injector, $sani
 scope.state.config.codeModeActive[key] = true;
 // and the widget mode updated to be 'manual'
 scope.getConfigWidgetMode(definition, value);
-
-return JSON.stringify(value);
+// and rerun this method so we get it prettified if appropriate
+return getLocalConfigValueFromModelValue(key, value);
 }
 
 // if boolean, return as primitive type



[3/5] brooklyn-ui git commit: address PR comments

2018-11-20 Thread aledsage
address PR comments


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

Branch: refs/heads/master
Commit: 176ab914c1c2da475f8ca8ebfd87756a6d1e13a1
Parents: abd5b43
Author: Alex Heneveld 
Authored: Tue Nov 20 10:04:08 2018 +
Committer: Alex Heneveld 
Committed: Tue Nov 20 10:04:08 2018 +

--
 .../app/components/catalog-saver/catalog-saver.directive.js | 9 +
 .../catalog-saver/catalog-saver.modal.template.html | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/176ab914/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
--
diff --git 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
index adc3f42..435d758 100644
--- 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
+++ 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
@@ -44,7 +44,7 @@ const TYPES = [
 angular.module(MODULE_NAME, [angularAnimate, uibModal, brUtils])
 .directive('catalogSaver', ['$rootScope', '$uibModal', '$injector', 
'$filter', 'composerOverrides', 'blueprintService', 
saveToCatalogModalDirective])
 .directive('catalogVersion', ['$parse', catalogVersionDirective])
-.directive('blueprintNameOrSymbolicNameAndBundleIdRequired', 
blueprintNameOrSymbolicNameAndBundleIdRequiredDirective)
+.directive('composerBlueprintNameValidator', 
composerBlueprintNameValidatorDirective)
 .filter('bundlize', bundlizeProvider)
 .run(['$templateCache', templateCache]);
 
@@ -210,7 +210,7 @@ export function CatalogItemModalController($scope, $filter, 
blueprintService, pa
 $scope.defaultSymbolicName = ($scope.config.itemType==='template' && 
$scope.config.original.symbolicName) || bundlize(newName) || null;
 $scope.defaultBundle = ($scope.config.itemType==='template' && 
$scope.config.original.bundle) || bundlize(newName) || null;
 };
-$scope.$watchGroup(['config.name', 'config.itemType'], (newVals) => {
+$scope.$watchGroup(['config.name', 'config.itemType', 'config.bundle', 
'config.symbolicName'], (newVals) => {
 $scope.updateDefaults(newVals[0]);
 $scope.form.name.$validate();
 $scope.buttonText = $scope.buttonTextFn();
@@ -218,13 +218,14 @@ export function CatalogItemModalController($scope, 
$filter, blueprintService, pa
 });
 }
 
-function blueprintNameOrSymbolicNameAndBundleIdRequiredDirective() {
+function composerBlueprintNameValidatorDirective() {
 return {
 restrict: 'A',
 require: 'ngModel',
 link: function(scope, element, attr, ngModel) {
-ngModel.$validators.blueprintNameOrSymbolicNameAndBundleIdRequired 
= function(modelValue, viewValue) {
+ngModel.$validators.composerBlueprintNameValidator = 
function(modelValue, viewValue) {
 scope.updateDefaults(modelValue);
+console.log("valildating", scope.config.bundle, 
scope.config.symbolicName);
 if (!ngModel.$isEmpty(modelValue)) {
 // anything set is valid
 return true;

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/176ab914/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
--
diff --git 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
index 4b5f626..a0c9c2f 100644
--- 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
+++ 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
@@ -26,7 +26,7 @@
 
 
 Blueprint display name
-
+
 
 You must specify a name for 
this item or supply explicit bundle ID and blueprint symbolic name
 
@@ -82,7 +82,7 @@
 
 Application entity
 
+   uib-popover="Save as an application entity which 
can be deployed on its own, or configured and used in blueprints but only 
config and sensors declared at the root are accessible in the Composer 
('application' item type)">
 

[4/5] brooklyn-ui git commit: more PR comments addressed

2018-11-20 Thread aledsage
more PR comments addressed


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

Branch: refs/heads/master
Commit: 959ea3ac0e9e0a386b7dc427e21a7fe648d124b2
Parents: 176ab91
Author: Alex Heneveld 
Authored: Tue Nov 20 10:17:18 2018 +
Committer: Alex Heneveld 
Committed: Tue Nov 20 10:17:18 2018 +

--
 .../app/components/catalog-saver/catalog-saver.modal.template.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/959ea3ac/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
--
diff --git 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
index a0c9c2f..1fc7de9 100644
--- 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
+++ 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.modal.template.html
@@ -90,7 +90,7 @@
 
 Application template
 
+   uib-popover="Save as a blueprint template which can 
be used as an editable starting point for blueprints or used as an application 
entity, and in some contexts this prioritizes the blueprint for inclusion in 
quick-selection views ('template' item type)">
 
 
 



[2/5] brooklyn-ui git commit: use new icon url source

2018-11-20 Thread aledsage
use new icon url source


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

Branch: refs/heads/master
Commit: abd5b435cd65b509fca801edf01142b6e6b9b97e
Parents: a552f04
Author: Alex Heneveld 
Authored: Fri Nov 16 14:37:57 2018 +
Committer: Alex Heneveld 
Committed: Fri Nov 16 14:37:57 2018 +

--
 ui-modules/blueprint-composer/app/views/main/main.controller.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/abd5b435/ui-modules/blueprint-composer/app/views/main/main.controller.js
--
diff --git a/ui-modules/blueprint-composer/app/views/main/main.controller.js 
b/ui-modules/blueprint-composer/app/views/main/main.controller.js
index bd0180f..87bf803 100644
--- a/ui-modules/blueprint-composer/app/views/main/main.controller.js
+++ b/ui-modules/blueprint-composer/app/views/main/main.controller.js
@@ -113,7 +113,7 @@ export function MainController($scope, $element, $log, 
$state, $stateParams, brB
 ? 'application'
 : 'entity',
 description: edit.type.description,
-iconUrl: edit.type.iconUrl,
+iconUrl: edit.type.iconUrlSource || edit.type.iconUrl,
 original: {
 bundle: edit.bundle.symbolicName.replace(/^catalog-bom-/, ''),
 symbolicName: edit.type.symbolicName,



[1/5] brooklyn-ui git commit: catalog saver to support 'application', 'template', and 'entity'

2018-11-20 Thread aledsage
Repository: brooklyn-ui
Updated Branches:
  refs/heads/master 60ddc6213 -> a9fcd5276


catalog saver to support 'application', 'template', and 'entity'

in line with https://github.com/apache/brooklyn-server/pull/1015
also when using a template the metadata is not populated as the intention is 
probably not to overwrite,
unless the user selects to save it as a template


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

Branch: refs/heads/master
Commit: a552f04640459669cabdd5882b9e8964998b746e
Parents: 4093d1f
Author: Alex Heneveld 
Authored: Fri Nov 16 13:42:17 2018 +
Committer: Alex Heneveld 
Committed: Fri Nov 16 13:43:29 2018 +

--
 .../catalog-saver/catalog-saver.directive.js| 121 +--
 .../catalog-saver.modal.template.html   |  26 ++--
 .../app/views/main/main.controller.js   |  25 +++-
 3 files changed, 124 insertions(+), 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/a552f046/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
--
diff --git 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
index 252f6da..adc3f42 100644
--- 
a/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
+++ 
b/ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
@@ -42,14 +42,15 @@ const TYPES = [
 ];
 
 angular.module(MODULE_NAME, [angularAnimate, uibModal, brUtils])
-.directive('catalogSaver', ['$rootScope', '$uibModal', '$injector', 
'composerOverrides', 'blueprintService', saveToCatalogModalDirective])
+.directive('catalogSaver', ['$rootScope', '$uibModal', '$injector', 
'$filter', 'composerOverrides', 'blueprintService', 
saveToCatalogModalDirective])
 .directive('catalogVersion', ['$parse', catalogVersionDirective])
+.directive('blueprintNameOrSymbolicNameAndBundleIdRequired', 
blueprintNameOrSymbolicNameAndBundleIdRequiredDirective)
 .filter('bundlize', bundlizeProvider)
 .run(['$templateCache', templateCache]);
 
 export default MODULE_NAME;
 
-export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, 
composerOverrides, blueprintService) {
+export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, 
$filter, composerOverrides, blueprintService) {
 return {
 restrict: 'E',
 templateUrl: function (tElement, tAttrs) {
@@ -62,38 +63,50 @@ export function saveToCatalogModalDirective($rootScope, 
$uibModal, $injector, co
 };
 
 function link($scope, $element) {
-$scope.buttonText = $scope.config.label || ($scope.config.itemType ? 
`Update ${$scope.config.name || $scope.config.symbolicName}` : 'Add to 
catalog');
-
+if (!$scope.config.original) {
+// original if provided contains the original metadata, e.g. for 
use if coming from a template and switching between template and non-template
+$scope.config.original = {}
+}
+$scope.isNewFromTemplate = () => ($scope.config.itemType !== 
'template' && $scope.config.original.itemType === 'template');
+$scope.isUpdate = () => !$scope.isNewFromTemplate() && 
Object.keys($scope.config.original).length>0;
+$scope.buttonTextFn = () => $scope.config.label || ($scope.isUpdate() 
&& ($scope.config.name || $scope.config.original.name || 
$scope.config.symbolicName || $scope.config.original.symbolicName)) || 'Add to 
catalog';
+$scope.buttonText = $scope.buttonTextFn(); 
+
 $scope.activateModal = () => {
 let entity = blueprintService.get();
 let metadata = blueprintService.entityHasMetadata(entity) ? 
blueprintService.getEntityMetadata(entity) : new Map();
-
-// Reset the config values if this is not an update
-$scope.isUpdate = Object.keys($scope.config).length > 
($scope.config.label ? 1 : 0);
-if (!$scope.isUpdate) {
-$scope.config.itemType = 'template';
-}
-
-// Set various properties from the blueprint entity data
-if (!$scope.config.version && (entity.hasVersion() || 
metadata.has('version'))) {
-$scope.config.version = entity.version || 
metadata.get('version');
+  
+if (!$scope.config.itemType) {
+// This is the default item type
+$scope.config.itemType = 'application';
 }
+ 

[2/2] brooklyn-server git commit: This closes #1016

2018-11-20 Thread aledsage
This closes #1016


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

Branch: refs/heads/master
Commit: 57e7b1ac31fba27ad3650b61702d1e8262af9a33
Parents: d0897b2 44b6e54
Author: Aled Sage 
Authored: Tue Nov 20 10:14:54 2018 +
Committer: Aled Sage 
Committed: Tue Nov 20 10:14:54 2018 +

--
 .../org/apache/brooklyn/rest/transform/TypeTransformer.java   | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--




[1/2] brooklyn-server git commit: when editting it is useful to know the source URL

2018-11-20 Thread aledsage
Repository: brooklyn-server
Updated Branches:
  refs/heads/master d0897b2db -> 57e7b1ac3


when editting it is useful to know the source URL

this includes that in the payload if different


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

Branch: refs/heads/master
Commit: 44b6e540986a4ee26b47c075b7ebfe66585208fc
Parents: d0897b2
Author: Alex Heneveld 
Authored: Fri Nov 16 14:34:39 2018 +
Committer: Alex Heneveld 
Committed: Fri Nov 16 14:37:01 2018 +

--
 .../org/apache/brooklyn/rest/transform/TypeTransformer.java   | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/44b6e540/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
--
diff --git 
a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
 
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
index e8bfb50..2796acd 100644
--- 
a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
+++ 
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
@@ -23,6 +23,7 @@ import static 
org.apache.brooklyn.rest.util.WebResourceUtils.serviceUriBuilder;
 import java.net.URI;
 import java.util.Collections;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -87,7 +88,11 @@ public class TypeTransformer {
 result.setExtraField("template", true);
 }
 if (item.getIconUrl()!=null) {
-result.setIconUrl(tidyIconLink(b, item, item.getIconUrl(), ub));
+String tidiedUrl = tidyIconLink(b, item, item.getIconUrl(), ub);
+result.setIconUrl(tidiedUrl);
+if (!Objects.equals(item.getIconUrl(), tidiedUrl)) {
+result.setExtraField("iconUrlSource", item.getIconUrl());
+}
 }
 
 if (detail) {



[2/2] brooklyn-ui git commit: This closes #79

2018-10-10 Thread aledsage
This closes #79


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

Branch: refs/heads/master
Commit: 2afc3acf81b6a4e1f836a8bdc9cd73cbe35cd878
Parents: edf16c3 b41123f
Author: Aled Sage 
Authored: Wed Oct 10 01:08:43 2018 -0700
Committer: Aled Sage 
Committed: Wed Oct 10 01:08:43 2018 -0700

--
 .../app/components/providers/palette-api.js  | 7 ++-
 .../app/components/providers/palette-api.provider.js | 8 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)
--




[1/2] brooklyn-ui git commit: Implement missing endpoint for palette API

2018-10-10 Thread aledsage
Repository: brooklyn-ui
Updated Branches:
  refs/heads/master edf16c3c3 -> 2afc3acf8


Implement missing endpoint for palette API


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

Branch: refs/heads/master
Commit: b41123ff8b70489dc112c529203fa4cd45081e61
Parents: c4eb263
Author: Thomas Bouron 
Authored: Tue Oct 9 08:05:23 2018 +0100
Committer: Thomas Bouron 
Committed: Tue Oct 9 08:05:23 2018 +0100

--
 .../app/components/providers/palette-api.js  | 7 ++-
 .../app/components/providers/palette-api.provider.js | 8 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/b41123ff/ui-modules/blueprint-composer/app/components/providers/palette-api.js
--
diff --git 
a/ui-modules/blueprint-composer/app/components/providers/palette-api.js 
b/ui-modules/blueprint-composer/app/components/providers/palette-api.js
index 28ada7b..a0d5748 100644
--- a/ui-modules/blueprint-composer/app/components/providers/palette-api.js
+++ b/ui-modules/blueprint-composer/app/components/providers/palette-api.js
@@ -33,7 +33,12 @@ export class PaletteApi {
 return Promise.resolve();
 }
 
-getTypeVersion(typeSymbolicName) {
+getTypeVersions(typeSymbolicName) {
+// no-op
+return Promise.resolve();
+}
+
+getBundle(bundleSymbolicName, bundleVersion) {
 // no-op
 return Promise.resolve();
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/b41123ff/ui-modules/blueprint-composer/app/components/providers/palette-api.provider.js
--
diff --git 
a/ui-modules/blueprint-composer/app/components/providers/palette-api.provider.js
 
b/ui-modules/blueprint-composer/app/components/providers/palette-api.provider.js
index a2e9639..bb3960b 100644
--- 
a/ui-modules/blueprint-composer/app/components/providers/palette-api.provider.js
+++ 
b/ui-modules/blueprint-composer/app/components/providers/palette-api.provider.js
@@ -58,8 +58,12 @@ class PaletteApiProvider extends PaletteApi {
 return this.catalogApi.getType(typeSymbolicName, typeVersion);
 }
 
-getTypeVersion(typeSymbolicName) {
-return this.catalogApi.getTypeVersion(typeSymbolicName);
+getTypeVersions(typeSymbolicName) {
+return this.catalogApi.getTypeVersions(typeSymbolicName);
+}
+
+getBundle(bundleSymbolicName, bundleVersion) {
+return this.catalogApi.getBundle(bundleSymbolicName, bundleVersion);
 }
 
 getBundleType(bundleSymbolicName, bundleVersion, typeSymbolicName, 
typeVersion) {



[14/14] brooklyn-server git commit: This closes #1002

2018-10-09 Thread aledsage
This closes #1002


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

Branch: refs/heads/master
Commit: c7ce1d280be31735697b15bca747fcca456b5b69
Parents: 187a9a0 5f13273
Author: Aled Sage 
Authored: Tue Oct 9 11:34:10 2018 -0700
Committer: Aled Sage 
Committed: Tue Oct 9 11:34:10 2018 -0700

--
 api/pom.xml |  4 +++
 camp/camp-server/pom.xml|  8 +
 .../core/sensor/http/HttpRequestSensor.java |  2 --
 .../util/core/flags/MethodCoercions.java|  1 -
 karaf/features/src/main/feature/feature.xml |  8 +
 parent/pom.xml  | 31 
 pom.xml |  8 +++--
 7 files changed, 57 insertions(+), 5 deletions(-)
--




[04/14] brooklyn-server git commit: Remove unused import

2018-10-09 Thread aledsage
Remove unused import


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

Branch: refs/heads/master
Commit: 65116a48f26c3b24ef870fe4e6e17a8ed35ab9bd
Parents: 92ef305
Author: Paul Campbell 
Authored: Tue Sep 25 14:51:43 2018 +0100
Committer: Paul Campbell 
Committed: Tue Sep 25 14:51:43 2018 +0100

--
 .../org/apache/brooklyn/core/sensor/http/HttpRequestSensor.java| 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/65116a48/core/src/main/java/org/apache/brooklyn/core/sensor/http/HttpRequestSensor.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/sensor/http/HttpRequestSensor.java
 
b/core/src/main/java/org/apache/brooklyn/core/sensor/http/HttpRequestSensor.java
index a6c73e4..532d6a4 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/sensor/http/HttpRequestSensor.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/sensor/http/HttpRequestSensor.java
@@ -43,8 +43,6 @@ import com.google.common.base.Function;
 import com.google.common.base.Functions;
 import com.google.common.base.Supplier;
 
-import net.minidev.json.JSONObject;
-
 /**
  * Configurable {@link org.apache.brooklyn.api.entity.EntityInitializer} which 
adds an HTTP sensor feed to retrieve the
  * {@link JSONObject} from a JSON response in order to populate the sensor 
with the data at the {@code jsonPath}.



[02/14] brooklyn-server git commit: Remove unused import

2018-10-09 Thread aledsage
Remove unused import


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

Branch: refs/heads/master
Commit: 1c0bf3b6c5467346fb0cc2a82e9c8675b9755cf8
Parents: 72fb6d7
Author: Paul Campbell 
Authored: Wed Sep 19 10:35:33 2018 +0100
Committer: Paul Campbell 
Committed: Thu Sep 20 17:08:50 2018 +0100

--
 .../java/org/apache/brooklyn/util/core/flags/MethodCoercions.java   | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1c0bf3b6/core/src/main/java/org/apache/brooklyn/util/core/flags/MethodCoercions.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/util/core/flags/MethodCoercions.java 
b/core/src/main/java/org/apache/brooklyn/util/core/flags/MethodCoercions.java
index a11ef69..e5053e6 100644
--- 
a/core/src/main/java/org/apache/brooklyn/util/core/flags/MethodCoercions.java
+++ 
b/core/src/main/java/org/apache/brooklyn/util/core/flags/MethodCoercions.java
@@ -32,7 +32,6 @@ import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.guava.Maybe;
 import org.apache.brooklyn.util.javalang.Boxing;
 import org.apache.brooklyn.util.javalang.Reflections;
-import org.omg.CORBA.portable.BoxedValueHelper;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Predicate;



[12/14] brooklyn-server git commit: Revert "Bump jetty from 9.3.24 to 9.4.11 to match karaf 4.2.1"

2018-10-09 Thread aledsage
Revert "Bump jetty from 9.3.24 to 9.4.11 to match karaf 4.2.1"

This reverts commit 84df4c582f95e37115280ed90fd0191107f5480c.


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

Branch: refs/heads/master
Commit: 278f286cdda4aaa9f6eb7f6d12124260fc023beb
Parents: dbe3a50
Author: Paul Campbell 
Authored: Mon Oct 8 13:35:25 2018 +0100
Committer: Paul Campbell 
Committed: Mon Oct 8 13:35:25 2018 +0100

--
 .../apache/brooklyn/core/test/HttpService.java  | 31 +++-
 .../launcher/WebAppContextProvider.java |  5 ++--
 pom.xml |  2 +-
 3 files changed, 14 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/278f286c/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
--
diff --git a/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java 
b/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
index 2cb53e8..b2ff422 100644
--- a/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
+++ b/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
@@ -28,7 +28,10 @@ import java.io.InputStream;
 import java.net.InetAddress;
 import java.security.KeyStore;
 
-import org.eclipse.jetty.security.*;
+import org.eclipse.jetty.security.ConstraintMapping;
+import org.eclipse.jetty.security.ConstraintSecurityHandler;
+import org.eclipse.jetty.security.HashLoginService;
+import org.eclipse.jetty.security.SecurityHandler;
 import org.eclipse.jetty.security.authentication.BasicAuthenticator;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
@@ -89,8 +92,11 @@ public class HttpService {
  * Enables basic HTTP authentication on the server.
  */
 public HttpService basicAuthentication(String username, String password) {
-final String userRole = "user";
-Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, 
userRole);
+HashLoginService l = new HashLoginService();
+l.putUser(username, Credential.getCredential(password), new 
String[]{"user"});
+l.setName("test-realm");
+
+Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, 
"user");
 constraint.setAuthenticate(true);
 
 ConstraintMapping constraintMapping = new ConstraintMapping();
@@ -99,30 +105,15 @@ public class HttpService {
 
 ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
 csh.setAuthenticator(new BasicAuthenticator());
-final String realmName = "test-realm";
-csh.setRealmName(realmName);
+csh.setRealmName("test-realm");
 csh.addConstraintMapping(constraintMapping);
-csh.setLoginService(createLoginService(realmName, username, password, 
new String[]{userRole}));
+csh.setLoginService(l);
 
 this.securityHandler = Optional.of(csh);
 
 return this;
 }
 
-private LoginService createLoginService(
-final String serviceName, final String username, final String 
password, final String[] roles) {
-final HashLoginService loginService = new HashLoginService();
-loginService.setName(serviceName);
-loginService.setUserStore(createUserStore(username, password, roles));
-return loginService;
-}
-
-private UserStore createUserStore(final String username, final String 
password, final String[] roles) {
-final UserStore userStore = new UserStore();
-userStore.addUser(username, Credential.getCredential(password), roles);
-return userStore;
-}
-
 public HttpService start() throws Exception {
 
TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), 
ROOT_WAR_PATH);
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/278f286c/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
--
diff --git 
a/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
 
b/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
index 236bf75..840e541 100644
--- 
a/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
+++ 
b/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
@@ -31,6 +31,7 @@ import org.apache.brooklyn.util.core.ResourceUtils;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.os.Os;
 import 

[08/14] brooklyn-server git commit: Bump jetty from 9.3.24 to 9.4.11 to match karaf 4.2.1

2018-10-09 Thread aledsage
Bump jetty from 9.3.24 to 9.4.11 to match karaf 4.2.1


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

Branch: refs/heads/master
Commit: 84df4c582f95e37115280ed90fd0191107f5480c
Parents: e009248
Author: Paul Campbell 
Authored: Thu Sep 27 13:18:22 2018 +0100
Committer: Paul Campbell 
Committed: Thu Sep 27 13:18:22 2018 +0100

--
 .../apache/brooklyn/core/test/HttpService.java  | 31 +---
 .../launcher/WebAppContextProvider.java |  5 ++--
 pom.xml |  2 +-
 3 files changed, 24 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/84df4c58/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
--
diff --git a/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java 
b/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
index b2ff422..2cb53e8 100644
--- a/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
+++ b/core/src/test/java/org/apache/brooklyn/core/test/HttpService.java
@@ -28,10 +28,7 @@ import java.io.InputStream;
 import java.net.InetAddress;
 import java.security.KeyStore;
 
-import org.eclipse.jetty.security.ConstraintMapping;
-import org.eclipse.jetty.security.ConstraintSecurityHandler;
-import org.eclipse.jetty.security.HashLoginService;
-import org.eclipse.jetty.security.SecurityHandler;
+import org.eclipse.jetty.security.*;
 import org.eclipse.jetty.security.authentication.BasicAuthenticator;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
@@ -92,11 +89,8 @@ public class HttpService {
  * Enables basic HTTP authentication on the server.
  */
 public HttpService basicAuthentication(String username, String password) {
-HashLoginService l = new HashLoginService();
-l.putUser(username, Credential.getCredential(password), new 
String[]{"user"});
-l.setName("test-realm");
-
-Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, 
"user");
+final String userRole = "user";
+Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, 
userRole);
 constraint.setAuthenticate(true);
 
 ConstraintMapping constraintMapping = new ConstraintMapping();
@@ -105,15 +99,30 @@ public class HttpService {
 
 ConstraintSecurityHandler csh = new ConstraintSecurityHandler();
 csh.setAuthenticator(new BasicAuthenticator());
-csh.setRealmName("test-realm");
+final String realmName = "test-realm";
+csh.setRealmName(realmName);
 csh.addConstraintMapping(constraintMapping);
-csh.setLoginService(l);
+csh.setLoginService(createLoginService(realmName, username, password, 
new String[]{userRole}));
 
 this.securityHandler = Optional.of(csh);
 
 return this;
 }
 
+private LoginService createLoginService(
+final String serviceName, final String username, final String 
password, final String[] roles) {
+final HashLoginService loginService = new HashLoginService();
+loginService.setName(serviceName);
+loginService.setUserStore(createUserStore(username, password, roles));
+return loginService;
+}
+
+private UserStore createUserStore(final String username, final String 
password, final String[] roles) {
+final UserStore userStore = new UserStore();
+userStore.addUser(username, Credential.getCredential(password), roles);
+return userStore;
+}
+
 public HttpService start() throws Exception {
 
TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), 
ROOT_WAR_PATH);
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/84df4c58/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
--
diff --git 
a/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
 
b/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
index 840e541..236bf75 100644
--- 
a/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
+++ 
b/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java
@@ -31,7 +31,6 @@ import org.apache.brooklyn.util.core.ResourceUtils;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.os.Os;
 import org.apache.brooklyn.util.text.Identifiers;
-import org.eclipse.jetty.server.SessionManager;
 import 

[10/14] brooklyn-server git commit: Bump fasterxml, cxf and snakeyaml to work with karaf 4.2.1

2018-10-09 Thread aledsage
Bump fasterxml, cxf and snakeyaml to work with karaf 4.2.1

* fasterxml.jackson from 2.9.6 to 2.9.7
* cxf from 3.1.10 to 3.2.6
* snakeyaml from 1.22.23

Updating cxf required adding exclusions to winrm4j as it has a dependency upon
cxf 3.1.10.


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

Branch: refs/heads/master
Commit: 4ddffae358cdbd7282778ac0ae95f63f9de94579
Parents: f5cb5d9
Author: Paul Campbell 
Authored: Mon Oct 1 15:43:44 2018 +0100
Committer: Paul Campbell 
Committed: Mon Oct 1 15:43:44 2018 +0100

--
 parent/pom.xml  | 10 ++
 pom.xml |  6 +++---
 .../brooklyn/rest/testing/BrooklynRestResourceTest.java |  2 +-
 software/base/pom.xml   |  5 +
 software/winrm/pom.xml  | 12 
 5 files changed, 31 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ddffae3/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index ac90a4a..f9a026b 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -235,6 +235,16 @@
 com.fasterxml.jackson.dataformat
 jackson-dataformat-xml
 ${fasterxml.jackson.version}
+
+
+com.fasterxml.woodstox
+woodstox-core
+
+
+org.codehaus.woodstox
+stax2-api
+
+
 
 
 com.fasterxml.jackson.dataformat

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ddffae3/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 0aa847f..26dfbb9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,8 +116,8 @@
 1.1.4c_7
 2.3.0_3
 
-2.9.6
-3.1.10
+2.9.7
+3.2.6
 
4.5.2
 
4.4.4
 
@@ -125,7 +125,7 @@
 3.3.2
 2.4.15 
 2.0.1
-1.22
+1.23
 
 1.5.6
 2.5

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ddffae3/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
--
diff --git 
a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
 
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
index 183f3de..49e35c4 100644
--- 
a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
+++ 
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
@@ -89,7 +89,7 @@ public abstract class BrooklynRestResourceTest extends 
BrooklynRestApiTest {
 protected synchronized void startServer() throws Exception {
 if (server == null) {
 setUpResources();
-JAXRSServerFactoryBean sf = 
ResourceUtils.createApplication(createRestApp(), true);
+JAXRSServerFactoryBean sf = 
ResourceUtils.createApplication(createRestApp(), true, false, false, null);
 if (clientProviders == null) {
 clientProviders = sf.getProviders();
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ddffae3/software/base/pom.xml
--
diff --git a/software/base/pom.xml b/software/base/pom.xml
index 4260120..6e51e22 100644
--- a/software/base/pom.xml
+++ b/software/base/pom.xml
@@ -104,6 +104,11 @@
 org.apache.httpcomponents
 httpclient
 
+
+org.apache.cxf
+cxf-core
+${cxf.version}
+
 
 
 org.testng

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ddffae3/software/winrm/pom.xml
--
diff --git a/software/winrm/pom.xml b/software/winrm/pom.xml
index b4a3f7e..a77a9a6 100644
--- a/software/winrm/pom.xml
+++ b/software/winrm/pom.xml
@@ -52,6 +52,18 @@
 org.slf4j
 slf4j-api
 
+
+org.apache.cxf
+cxf-rt-transports-http
+
+
+

[06/14] brooklyn-server git commit: Add dependency on Apache geronimo-ws-metadata_2.0_spec in API

2018-10-09 Thread aledsage
Add dependency on Apache geronimo-ws-metadata_2.0_spec in API

Required for the brooklyn-core feature


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

Branch: refs/heads/master
Commit: 79d0c37d9e50f95da28235d7e862334326504caa
Parents: c643a50
Author: Paul Campbell 
Authored: Thu Sep 27 10:45:49 2018 +0100
Committer: Paul Campbell 
Committed: Thu Sep 27 10:48:03 2018 +0100

--
 api/pom.xml | 4 
 karaf/features/src/main/feature/feature.xml | 2 +-
 parent/pom.xml  | 5 +
 pom.xml | 1 +
 4 files changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/79d0c37d/api/pom.xml
--
diff --git a/api/pom.xml b/api/pom.xml
index c2ad2d6..380176e 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -59,6 +59,10 @@
 test
 ${project.version}
 
+
+org.apache.geronimo.specs
+geronimo-ws-metadata_2.0_spec
+
 
 
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/79d0c37d/karaf/features/src/main/feature/feature.xml
--
diff --git a/karaf/features/src/main/feature/feature.xml 
b/karaf/features/src/main/feature/feature.xml
index 3a65c29..996965d 100644
--- a/karaf/features/src/main/feature/feature.xml
+++ b/karaf/features/src/main/feature/feature.xml
@@ -150,7 +150,7 @@
 mvn:org.eclipse.jetty/jetty-io/${jetty.version}
 mvn:org.eclipse.jetty/jetty-server/${jetty.version}
 mvn:org.ops4j.pax.web/pax-web-spi/${pax-web.version}
-mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3
+mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/${geronimo-ws-metadata_2.0_spec.version}
 mvn:com.thoughtworks.xstream/xstream/${xstream.version}
 mvn:org.freemarker/freemarker/${freemarker.version}
 mvn:com.hierynomus/sshj/${sshj.version}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/79d0c37d/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 226a822..ac90a4a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -75,6 +75,11 @@
 ${javax.activation.version}
 
 
+org.apache.geronimo.specs
+geronimo-ws-metadata_2.0_spec
+${geronimo-ws-metadata_2.0_spec.version}
+
+
 ch.qos.logback
 logback-classic
 ${logback.version}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/79d0c37d/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 5d829fa..443b22d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -220,6 +220,7 @@
 2.2.11
 1.1.1
 6.0.6
+
1.1.3
 
 
 



[07/14] brooklyn-server git commit: Bump pax-web from 6.0.6 to 7.2.3 to match karaf 4.2.1

2018-10-09 Thread aledsage
Bump pax-web from 6.0.6 to 7.2.3 to match karaf 4.2.1


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

Branch: refs/heads/master
Commit: e009248f1231b34d06720f749699df4e83607b92
Parents: 79d0c37
Author: Paul Campbell 
Authored: Thu Sep 27 12:06:58 2018 +0100
Committer: Paul Campbell 
Committed: Thu Sep 27 12:06:58 2018 +0100

--
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e009248f/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 443b22d..706030d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,7 +219,7 @@
 
 2.2.11
 1.1.1
-6.0.6
+7.2.3
 
1.1.3
 
 



[13/14] brooklyn-server git commit: Revert "Bump fasterxml, cxf and snakeyaml to work with karaf 4.2.1"

2018-10-09 Thread aledsage
Revert "Bump fasterxml, cxf and snakeyaml to work with karaf 4.2.1"

This reverts commit 4ddffae358cdbd7282778ac0ae95f63f9de94579.


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

Branch: refs/heads/master
Commit: 5f132735950675cca8a00112c84fe69041ba53bc
Parents: 278f286
Author: Paul Campbell 
Authored: Mon Oct 8 13:35:39 2018 +0100
Committer: Paul Campbell 
Committed: Mon Oct 8 13:35:39 2018 +0100

--
 parent/pom.xml  | 10 --
 pom.xml |  6 +++---
 .../brooklyn/rest/testing/BrooklynRestResourceTest.java |  2 +-
 software/base/pom.xml   |  5 -
 software/winrm/pom.xml  | 12 
 5 files changed, 4 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5f132735/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 9f6f1f8..e1b3737 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -235,16 +235,6 @@
 com.fasterxml.jackson.dataformat
 jackson-dataformat-xml
 ${fasterxml.jackson.version}
-
-
-com.fasterxml.woodstox
-woodstox-core
-
-
-org.codehaus.woodstox
-stax2-api
-
-
 
 
 com.fasterxml.jackson.dataformat

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5f132735/pom.xml
--
diff --git a/pom.xml b/pom.xml
index df69f6f..eb92edb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,8 +116,8 @@
 1.1.4c_7
 2.3.0_3
 
-2.9.7
-3.2.6
+2.9.6
+3.1.10
 
4.5.2
 
4.4.4
 
@@ -125,7 +125,7 @@
 3.3.2
 2.4.15 
 2.0.1
-1.23
+1.22
 
 1.5.6
 2.5

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5f132735/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
--
diff --git 
a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
 
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
index 49e35c4..183f3de 100644
--- 
a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
+++ 
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
@@ -89,7 +89,7 @@ public abstract class BrooklynRestResourceTest extends 
BrooklynRestApiTest {
 protected synchronized void startServer() throws Exception {
 if (server == null) {
 setUpResources();
-JAXRSServerFactoryBean sf = 
ResourceUtils.createApplication(createRestApp(), true, false, false, null);
+JAXRSServerFactoryBean sf = 
ResourceUtils.createApplication(createRestApp(), true);
 if (clientProviders == null) {
 clientProviders = sf.getProviders();
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5f132735/software/base/pom.xml
--
diff --git a/software/base/pom.xml b/software/base/pom.xml
index 6e51e22..4260120 100644
--- a/software/base/pom.xml
+++ b/software/base/pom.xml
@@ -104,11 +104,6 @@
 org.apache.httpcomponents
 httpclient
 
-
-org.apache.cxf
-cxf-core
-${cxf.version}
-
 
 
 org.testng

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5f132735/software/winrm/pom.xml
--
diff --git a/software/winrm/pom.xml b/software/winrm/pom.xml
index a77a9a6..b4a3f7e 100644
--- a/software/winrm/pom.xml
+++ b/software/winrm/pom.xml
@@ -52,18 +52,6 @@
 org.slf4j
 slf4j-api
 
-
-org.apache.cxf
-cxf-rt-transports-http
-
-
-org.apache.cxf
-cxf-rt-transports-http-hc
-
-
- 

[09/14] brooklyn-server git commit: Keep karaf-maven-plugin on 4.1.4

2018-10-09 Thread aledsage
Keep karaf-maven-plugin on 4.1.4

https://issues.apache.org/jira/browse/KARAF-5932

Bug introduced in 4.1.5 and not fixed until 4.2.2.


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

Branch: refs/heads/master
Commit: f5cb5d999068799cce0eba6bc8a9a6fac0eb1090
Parents: 84df4c5
Author: Paul Campbell 
Authored: Mon Oct 1 09:41:12 2018 +0100
Committer: Paul Campbell 
Committed: Mon Oct 1 09:44:01 2018 +0100

--
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f5cb5d99/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 4496e0d..0aa847f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -163,7 +163,7 @@
 
 
 4.2.1
-${karaf.version}
+4.1.4
 5.6.10
 9.4.11.v20180605
 



[11/14] brooklyn-server git commit: Allow apache-rat-pluin to work when building single modules

2018-10-09 Thread aledsage
Allow apache-rat-pluin to work when building single modules

The configuration for apache-rat-plugin excludes the '**/target/**' path.
However, when building a single module, the basedir that the plugin uses by
default is the modules' target directory. The exclude signature for target
doesn't match, as it would be attempting to match a target directory under the
target directory itself. This works when building from a multi-module directory,
e.g. brooklyn or brooklyn-server, as the basedir in this case is not the target
directory.


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

Branch: refs/heads/master
Commit: dbe3a50dda1868fd92ea84b70cecde65e2b23dd8
Parents: 4ddffae
Author: Paul Campbell 
Authored: Wed Oct 3 14:21:56 2018 +0100
Committer: Paul Campbell 
Committed: Wed Oct 3 14:21:56 2018 +0100

--
 parent/pom.xml | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/dbe3a50d/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index f9a026b..9f6f1f8 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1090,6 +1090,7 @@
  
  so that the child pom entries replace the parent entries
  -->
+${project.basedir}
 
   
   sandbox/**



[05/14] brooklyn-server git commit: Add required dependencies to karaf feature.xml

2018-10-09 Thread aledsage
Add required dependencies to karaf feature.xml

With Karaf 4.2.x, these dependencies are not included automatically for some
reason, so need to be explicitly defined.


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

Branch: refs/heads/master
Commit: c643a5010885db59aeca7dca82eedc3254b51f45
Parents: 65116a4
Author: Paul Campbell 
Authored: Wed Sep 26 11:13:20 2018 +0100
Committer: Paul Campbell 
Committed: Wed Sep 26 11:45:22 2018 +0100

--
 karaf/features/src/main/feature/feature.xml | 8 
 parent/pom.xml  | 5 +
 pom.xml | 1 +
 3 files changed, 14 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c643a501/karaf/features/src/main/feature/feature.xml
--
diff --git a/karaf/features/src/main/feature/feature.xml 
b/karaf/features/src/main/feature/feature.xml
index ca60ad8..3a65c29 100644
--- a/karaf/features/src/main/feature/feature.xml
+++ b/karaf/features/src/main/feature/feature.xml
@@ -143,6 +143,14 @@
 mvn:com.fasterxml.jackson.core/jackson-annotations/${fasterxml.jackson.version}
 mvn:net.minidev/json-smart/${jsonSmart.version}
 mvn:net.minidev/accessors-smart/${minidev.accessors-smart.version}
+mvn:org.ow2.asm/asm/${ow2.asm.version}
+mvn:org.eclipse.jetty/jetty-client/${jetty.version}
+mvn:org.eclipse.jetty/jetty-http/${jetty.version}
+mvn:org.eclipse.jetty/jetty-util/${jetty.version}
+mvn:org.eclipse.jetty/jetty-io/${jetty.version}
+mvn:org.eclipse.jetty/jetty-server/${jetty.version}
+mvn:org.ops4j.pax.web/pax-web-spi/${pax-web.version}
+mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3
 mvn:com.thoughtworks.xstream/xstream/${xstream.version}
 mvn:org.freemarker/freemarker/${freemarker.version}
 mvn:com.hierynomus/sshj/${sshj.version}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c643a501/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 683e2fe..226a822 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -572,6 +572,11 @@
openshift-client
${kubernetes-client.version}

+
+org.ops4j.pax.web
+pax-web-spi
+${pax-web.version}
+


 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c643a501/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 8f93924..5d829fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,6 +219,7 @@
 
 2.2.11
 1.1.1
+6.0.6
 
 
 



[01/14] brooklyn-server git commit: Use non-jdk versions of JAXB and JAva Activation

2018-10-09 Thread aledsage
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 187a9a03b -> c7ce1d280


Use non-jdk versions of JAXB and JAva Activation

JAXB and Java Activation are no longer bundled as part of JDK 9.


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

Branch: refs/heads/master
Commit: 72fb6d70961876b7ba74716260ac54bc552ebbf0
Parents: e27cc7b
Author: Paul Campbell 
Authored: Tue Sep 18 10:49:28 2018 +0100
Committer: Paul Campbell 
Committed: Thu Sep 20 16:42:34 2018 +0100

--
 camp/camp-server/pom.xml |  8 
 parent/pom.xml   | 20 
 pom.xml  |  2 ++
 3 files changed, 30 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/72fb6d70/camp/camp-server/pom.xml
--
diff --git a/camp/camp-server/pom.xml b/camp/camp-server/pom.xml
index 175eb57..bc97c84 100644
--- a/camp/camp-server/pom.xml
+++ b/camp/camp-server/pom.xml
@@ -38,6 +38,14 @@
 
 
 
+javax.xml.bind
+jaxb-api
+
+
+javax.activation
+activation
+
+
 org.apache.brooklyn.camp
 camp-base
 ${project.version}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/72fb6d70/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index cf6e105..683e2fe 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -55,6 +55,26 @@
 
 
 
+javax.xml.bind
+jaxb-api
+${jaxb.version}
+
+
+com.sun.xml.bind
+jaxb-core
+${jaxb.version}
+
+
+com.sun.xml.bind
+jaxb-impl
+${jaxb.version}
+
+
+javax.activation
+activation
+${javax.activation.version}
+
+
 ch.qos.logback
 logback-classic
 ${logback.version}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/72fb6d70/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 30eeaf7..c4161a1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -217,6 +217,8 @@
 1.7
 1.8.4
 
+2.2.11
+1.1.1
 
 
 



[03/14] brooklyn-server git commit: Bump karaf from 4.1.6 to 4.2.1

2018-10-09 Thread aledsage
Bump karaf from 4.1.6 to 4.2.1


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

Branch: refs/heads/master
Commit: 92ef30532bd3cd91b73c8f1667c19a0b078eeceb
Parents: 1c0bf3b
Author: Paul Campbell 
Authored: Wed Sep 19 17:31:17 2018 +0100
Committer: Paul Campbell 
Committed: Fri Sep 21 11:47:07 2018 +0100

--
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/92ef3053/pom.xml
--
diff --git a/pom.xml b/pom.xml
index c4161a1..8f93924 100644
--- a/pom.xml
+++ b/pom.xml
@@ -162,8 +162,8 @@
 1.4.27
 
 
-4.1.6
-4.1.6
+4.2.1
+${karaf.version}
 5.6.10
 9.3.24.v20180605
 



[2/2] brooklyn-server git commit: This closes #1004

2018-10-02 Thread aledsage
This closes #1004


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

Branch: refs/heads/master
Commit: c3d71a2e9fde3383e8ed7af0a444981b7e31073a
Parents: 97a922d eafd8d0
Author: Aled Sage 
Authored: Tue Oct 2 09:24:18 2018 +0100
Committer: Aled Sage 
Committed: Tue Oct 2 09:24:18 2018 +0100

--
 .../camp/brooklyn/ConfigParametersYamlTest.java | 65 +++
 .../brooklyn/core/objs/BasicSpecParameter.java  | 10 ++-
 .../resources/BundleAndTypeResourcesTest.java   | 86 
 3 files changed, 159 insertions(+), 2 deletions(-)
--




[1/2] brooklyn-server git commit: BROOKLYN-602: fix config key order for yaml overrides

2018-10-02 Thread aledsage
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 97a922d6c -> c3d71a2e9


BROOKLYN-602: fix config key order for yaml overrides


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

Branch: refs/heads/master
Commit: eafd8d047f0746c953ebc42385c332591a515ecc
Parents: 97a922d
Author: Aled Sage 
Authored: Mon Oct 1 15:49:20 2018 +0100
Committer: Aled Sage 
Committed: Tue Oct 2 09:22:24 2018 +0100

--
 .../camp/brooklyn/ConfigParametersYamlTest.java | 65 +++
 .../brooklyn/core/objs/BasicSpecParameter.java  | 10 ++-
 .../resources/BundleAndTypeResourcesTest.java   | 86 
 3 files changed, 159 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/eafd8d04/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
--
diff --git 
a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
 
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
index 7770270..5f277ee 100644
--- 
a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
+++ 
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
@@ -29,13 +29,17 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
+import org.apache.brooklyn.api.catalog.CatalogConfig;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.EntitySpec;
 import org.apache.brooklyn.api.entity.ImplementedBy;
 import org.apache.brooklyn.api.internal.AbstractBrooklynObjectSpec;
 import org.apache.brooklyn.api.location.Location;
 import org.apache.brooklyn.api.location.PortRange;
+import org.apache.brooklyn.api.objs.SpecParameter;
+import org.apache.brooklyn.api.typereg.RegisteredType;
 import org.apache.brooklyn.camp.brooklyn.catalog.SpecParameterUnwrappingTest;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog;
@@ -49,6 +53,7 @@ import org.apache.brooklyn.core.entity.Dumper;
 import org.apache.brooklyn.core.location.PortRanges;
 import org.apache.brooklyn.core.sensor.Sensors;
 import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.apache.brooklyn.core.test.entity.TestEntityImpl;
 import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
 import org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess;
 import org.apache.brooklyn.entity.stock.BasicApplication;
@@ -1194,6 +1199,66 @@ public class ConfigParametersYamlTest extends 
AbstractYamlRebindTest {
 }
 }
 
+@Test
+public void testConfigParameterPinnedOrder() throws Exception {
+addCatalogItems(
+"brooklyn.catalog:",
+"  version: " + TEST_VERSION,
+"  itemType: entity",
+"  items:",
+"- id: entity-without-keys",
+"  item:",
+"type: "+TestEntityWithPinnedConfig.class.getName(),
+"- id: entity-with-keys-redeclared",
+"  item:",
+"type: "+TestEntityWithPinnedConfig.class.getName(),
+"brooklyn.parameters:",
+"  - name: pinned2",
+"  - name: unpinned2");
+
+for (String symbolicName : ImmutableList.of("entity-without-keys", 
"entity-with-keys-redeclared")) {
+// Mimicking the code in REST api's TypeResource, for getting the 
config keys
+RegisteredType item = mgmt().getTypeRegistry().get(symbolicName, 
TEST_VERSION);
+AbstractBrooklynObjectSpec spec = 
mgmt().getTypeRegistry().createSpec(item, null, null);
+List> params = spec.getParameters();
+SpecParameter pinned2 = Iterables.find(params, (p) -> 
p.getConfigKey().getName().equals("pinned2"));
+SpecParameter unpinned2 = Iterables.find(params, (p) -> 
p.getConfigKey().getName().equals("unpinned2"));
+
+assertEquals(pinned2.getLabel(), "mylabel-pinned2", 
"item="+symbolicName);
+assertEquals(pinned2.isPinned(), true, "item="+symbolicName);
+
+assertEquals(unpinned2.getLabel(), "mylabel-unpinned2", 
"item="+symbolicName);
+assertEquals(unpinned2.isPinned(), false, "item="+symbolicName);
+
+List 

[2/2] brooklyn git commit: This closes #23

2018-10-01 Thread aledsage
This closes #23


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

Branch: refs/heads/master
Commit: 7f421bb10bffe1ba966d3a16bf1f172f85d84022
Parents: a915db7 18d07ee
Author: Aled Sage 
Authored: Mon Oct 1 09:19:35 2018 +0100
Committer: Aled Sage 
Committed: Mon Oct 1 09:19:35 2018 +0100

--
 Jenkinsfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--




[1/2] brooklyn git commit: jenkins: fix npm build, removing docker -u

2018-10-01 Thread aledsage
Repository: brooklyn
Updated Branches:
  refs/heads/master a915db731 -> 7f421bb10


jenkins: fix npm build, removing docker -u

npm writes to ~/.npm, and reads ~/.npmrc. But user 910 does
not exist in container, so has no home directory. Therefore
npm fails. Reverting `-u` for now.


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

Branch: refs/heads/master
Commit: 18d07ee82b10c5fc9415accd200701e1e4ca8642
Parents: bd0f52c
Author: Aled Sage 
Authored: Mon Oct 1 09:14:58 2018 +0100
Committer: Aled Sage 
Committed: Mon Oct 1 09:15:05 2018 +0100

--
 Jenkinsfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/18d07ee8/Jenkinsfile
--
diff --git a/Jenkinsfile b/Jenkinsfile
index f37b75f..c41da46 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -38,7 +38,7 @@ node(label: 'ubuntu') {
 }
 
 stage('Run tests') {
-environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
 sh 'mvn clean install -Duser.home=/var/maven 
-Duser.name=jenkins'
 }
 }
@@ -46,7 +46,7 @@ node(label: 'ubuntu') {
 // Conditional stage to deploy artifacts, when not building a PR
 if (env.CHANGE_ID == null) {
 stage('Deploy artifacts') {
-environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
 sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=jenkins'
 }
 }



[2/2] brooklyn git commit: This closes #19

2018-10-01 Thread aledsage
This closes #19


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

Branch: refs/heads/master
Commit: a915db73123703bf5fd2bffb9841d2cc313fc299
Parents: bd0f52c 48bb7ac
Author: Aled Sage 
Authored: Mon Oct 1 09:03:09 2018 +0100
Committer: Aled Sage 
Committed: Mon Oct 1 09:03:09 2018 +0100

--
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/a915db73/Dockerfile
--



[1/2] brooklyn git commit: Update Docker image to use Maven 3.5.4

2018-10-01 Thread aledsage
Repository: brooklyn
Updated Branches:
  refs/heads/master bd0f52c3b -> a915db731


Update Docker image to use Maven 3.5.4

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

Branch: refs/heads/master
Commit: 48bb7ac45953c97859ed72cec76362d8585d3fa8
Parents: 3af021d
Author: Sylwester Lachiewicz 
Authored: Sat Sep 8 14:55:03 2018 +0200
Committer: GitHub 
Committed: Sat Sep 8 14:55:03 2018 +0200

--
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/48bb7ac4/Dockerfile
--
diff --git a/Dockerfile b/Dockerfile
index 95600c0..32c6691 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,7 +17,7 @@
 
 # For all Brooklyn, we use a debian distribution instead of alpine as there 
are some libgcc incompatibilities with GO
 # and PhantomJS
-FROM maven:3.5.2-jdk-8
+FROM maven:3.5.4-jdk-8
 
 # Install the non-headless JRE as some tests requires them
 RUN apt-get update && apt-get install -y openjdk-8-jre



[2/2] brooklyn-client git commit: This closes #70

2018-09-29 Thread aledsage
This closes #70


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

Branch: refs/heads/master
Commit: 2287c07e9063714df80b9459dc11de0109d07b8e
Parents: 05031a7 185a31c
Author: Aled Sage 
Authored: Sat Sep 29 10:38:08 2018 +0100
Committer: Aled Sage 
Committed: Sat Sep 29 10:38:08 2018 +0100

--
 Dockerfile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--




[1/2] brooklyn-client git commit: fix jenkins docker build Jenkins build failed writing to /var/maven/.brooklyn

2018-09-29 Thread aledsage
Repository: brooklyn-client
Updated Branches:
  refs/heads/master 05031a79d -> 2287c07e9


fix jenkins docker build
Jenkins build failed writing to /var/maven/.brooklyn

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

Branch: refs/heads/master
Commit: 185a31c87f86dc2884f9038c748b910f018f4965
Parents: 05031a7
Author: frogfather 
Authored: Fri Sep 28 12:13:05 2018 +0100
Committer: frogfather 
Committed: Fri Sep 28 12:13:05 2018 +0100

--
 Dockerfile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/185a31c8/Dockerfile
--
diff --git a/Dockerfile b/Dockerfile
index 6a5d960..dc7f650 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,7 +16,9 @@
 # under the License.
 
 # For Brooklyn Client, we use a debian distribution instead of alpine as there 
are some libgcc incompatibilities with GO
-FROM maven:3.5.2-jdk-8-slim
+FROM maven:3.5.4-jdk-8-slim
 
 # Install necessary binaries to build brooklyn-client
 RUN apt-get update && apt-get install -y git-core golang-go
+
+RUN mkdir -p /var/maven/.m2/ && chmod -R 777 /var/maven/
\ No newline at end of file



[3/3] brooklyn git commit: This closes #22

2018-09-27 Thread aledsage
This closes #22


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

Branch: refs/heads/master
Commit: bd0f52c3bf790f3e3cc9d01b2fb7fa7facb15c99
Parents: 2610f68 5122c6d
Author: Aled Sage 
Authored: Thu Sep 27 10:43:43 2018 +0100
Committer: Aled Sage 
Committed: Thu Sep 27 10:43:43 2018 +0100

--
 Jenkinsfile | 4 ++--
 README.md   | 6 --
 2 files changed, 6 insertions(+), 4 deletions(-)
--




[1/3] brooklyn git commit: jenkins: fix user.name in docker

2018-09-27 Thread aledsage
Repository: brooklyn
Updated Branches:
  refs/heads/master 2610f6898 -> bd0f52c3b


jenkins: fix user.name in docker

User 910 is unknown in the docker container, so 
`${id -un 910}` does not return a name. We don’t 
care what user.name it has, as long as there is one.

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

Branch: refs/heads/master
Commit: c2a3f37518278c8a03c738f8ef1d4378fe628d3b
Parents: 2610f68
Author: Aled Sage 
Authored: Thu Sep 27 10:40:47 2018 +0100
Committer: Aled Sage 
Committed: Thu Sep 27 10:40:47 2018 +0100

--
 Jenkinsfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/c2a3f375/Jenkinsfile
--
diff --git a/Jenkinsfile b/Jenkinsfile
index e06ad4b..f37b75f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -39,7 +39,7 @@ node(label: 'ubuntu') {
 
 stage('Run tests') {
 environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
-sh 'mvn clean install -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
+sh 'mvn clean install -Duser.home=/var/maven 
-Duser.name=jenkins'
 }
 }
 
@@ -47,7 +47,7 @@ node(label: 'ubuntu') {
 if (env.CHANGE_ID == null) {
 stage('Deploy artifacts') {
 environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
-sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
+sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=jenkins'
 }
 }
 }



[2/3] brooklyn git commit: README: fix path to built karaf artifact

2018-09-27 Thread aledsage
README: fix path to built karaf artifact

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

Branch: refs/heads/master
Commit: 5122c6d558465a6254c81fa7c1bcc6b959f6710d
Parents: c2a3f37
Author: Aled Sage 
Authored: Thu Sep 27 10:41:07 2018 +0100
Committer: Aled Sage 
Committed: Thu Sep 27 10:41:07 2018 +0100

--
 README.md | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/5122c6d5/README.md
--
diff --git a/README.md b/README.md
index c0dc0ae..5dc1e1a 100644
--- a/README.md
+++ b/README.md
@@ -49,8 +49,10 @@ docker run -i --rm --name brooklyn -u $(id -u):$(id -g) \
 The results are in `brooklyn-dist/dist/target/`, including a tar and a zip.
 Or to run straight after the build, do:
 
-pushd brooklyn-dist/dist/target/brooklyn-dist/brooklyn/
-bin/brooklyn launch
+```bash
+pushd brooklyn-dist/karaf/apache-brooklyn/target/assembly/
+./bin/start
+```
 
 
 ### Resources



brooklyn git commit: jenkins: add submodule-init

2018-09-25 Thread aledsage
Repository: brooklyn
Updated Branches:
  refs/heads/master 4b9d577cf -> 2610f6898


jenkins: add submodule-init


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

Branch: refs/heads/master
Commit: 2610f689804974f93cfbc2c63ca0d9a98be5ca66
Parents: 4b9d577
Author: Aled Sage 
Authored: Tue Sep 25 15:41:27 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 15:41:27 2018 +0100

--
 Jenkinsfile | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/2610f689/Jenkinsfile
--
diff --git a/Jenkinsfile b/Jenkinsfile
index 0fcd6d3..e06ad4b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,6 +31,7 @@ node(label: 'ubuntu') {
 stage('Prepare environment') {
 echo 'Creating maven cache ...'
 sh 'mkdir -p ${WORKSPACE}/.m2'
+sh 'git submodule init'
 sh 'git submodule update --remote --merge --recursive'
 echo 'Building docker image for test environment ...'
 environmentDockerImage = docker.build('brooklyn:${DOCKER_TAG}')



[1/2] brooklyn git commit: Jenkins: use pipeline, and don’t bind-mount .m2

2018-09-25 Thread aledsage
Repository: brooklyn
Updated Branches:
  refs/heads/master 3af021d73 -> 4b9d577cf


Jenkins: use pipeline, and don’t bind-mount .m2

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

Branch: refs/heads/master
Commit: d1280c84bb88ccb9b99ccaf3faa0ce0583b36a61
Parents: 3af021d
Author: Aled Sage 
Authored: Tue Sep 25 15:21:49 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 15:21:49 2018 +0100

--
 Dockerfile  |  6 -
 Jenkinsfile | 81 
 README.md   | 17 +---
 3 files changed, 100 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn/blob/d1280c84/Dockerfile
--
diff --git a/Dockerfile b/Dockerfile
index 95600c0..6214f3a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -37,4 +37,8 @@ RUN apt-get update && apt-get install -y \
 dpkg \
 pkg-config \
 nasm \
-gcc \
+gcc
+
+# For mvn-build
+RUN mkdir -p /var/maven/.m2/ && chmod -R 777 /var/maven/
+ENV MAVEN_CONFIG=/var/maven/.m2

http://git-wip-us.apache.org/repos/asf/brooklyn/blob/d1280c84/Jenkinsfile
--
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 000..0fcd6d3
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+node(label: 'ubuntu') {
+catchError {
+def environmentDockerImage
+
+def dockerTag = env.BUILD_TAG.replace('%2F', '-')
+
+withEnv(["DOCKER_TAG=${dockerTag}"]) {
+stage('Clone repository') {
+checkout scm
+}
+
+stage('Prepare environment') {
+echo 'Creating maven cache ...'
+sh 'mkdir -p ${WORKSPACE}/.m2'
+sh 'git submodule update --remote --merge --recursive'
+echo 'Building docker image for test environment ...'
+environmentDockerImage = docker.build('brooklyn:${DOCKER_TAG}')
+}
+
+stage('Run tests') {
+environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+sh 'mvn clean install -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
+}
+}
+
+// Conditional stage to deploy artifacts, when not building a PR
+if (env.CHANGE_ID == null) {
+stage('Deploy artifacts') {
+environmentDockerImage.inside('-i --rm --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
+}
+}
+}
+}
+}
+
+//  Post actions steps, to always perform 
+
+stage('Publish test results') {
+// Publish JUnit results
+junit allowEmptyResults: true, testResults: 
'**/target/surefire-reports/junitreports/*.xml'
+
+// Publish TestNG results
+step([
+$class: 'Publisher',
+reportFilenamePattern: '**/testng-results.xml'
+])
+}
+
+// Conditional stage, when not building a PR
+if (env.CHANGE_ID == null) {
+stage('Send notifications') {
+// Send email notifications
+step([
+$class: 'Mailer',
+notifyEveryUnstableBuild: true,
+recipients: 'd...@brooklyn.apache.org',
+sendToIndividuals: false
+])
+}
+}
+}


[2/2] brooklyn git commit: This closes #21

2018-09-25 Thread aledsage
This closes #21


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

Branch: refs/heads/master
Commit: 4b9d577cf4b12ef82ee04ba681c7f4a1409d50c9
Parents: 3af021d d1280c8
Author: Aled Sage 
Authored: Tue Sep 25 15:24:18 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 15:24:18 2018 +0100

--
 Dockerfile  |  6 -
 Jenkinsfile | 81 
 README.md   | 17 +---
 3 files changed, 100 insertions(+), 4 deletions(-)
--




[1/2] brooklyn-library git commit: jenkins: add settings.xml for 'mvn deploy'

2018-09-25 Thread aledsage
Repository: brooklyn-library
Updated Branches:
  refs/heads/master 01cc0b584 -> 6a214e773


jenkins: add settings.xml for 'mvn deploy'


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

Branch: refs/heads/master
Commit: 35612262cf8c782d2152049d8b865cdd094c03dd
Parents: 01cc0b5
Author: Aled Sage 
Authored: Tue Sep 25 12:26:29 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 12:26:29 2018 +0100

--
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/35612262/Jenkinsfile
--
diff --git a/Jenkinsfile b/Jenkinsfile
index 67c1b79..8300127 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -44,7 +44,7 @@ node(label: 'ubuntu') {
 // Conditional stage to deploy artifacts, when not building a PR
 if (env.CHANGE_ID == null) {
 stage('Deploy artifacts') {
-environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
 sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
 }
 }



[2/2] brooklyn-library git commit: This closes #161

2018-09-25 Thread aledsage
This closes #161


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

Branch: refs/heads/master
Commit: 6a214e7733a97ba0ef3cc37e2218225d1c58cfd5
Parents: 01cc0b5 3561226
Author: Aled Sage 
Authored: Tue Sep 25 12:29:56 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 12:29:56 2018 +0100

--
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/2] brooklyn-library git commit: jenkins: don't bind mount .m2

2018-09-25 Thread aledsage
Repository: brooklyn-library
Updated Branches:
  refs/heads/master 0c0f1a81d -> 01cc0b584


jenkins: don't bind mount .m2


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

Branch: refs/heads/master
Commit: 893ca1b0f0e9b55961116a5c53cee4af18a46897
Parents: 0c0f1a8
Author: Aled Sage 
Authored: Mon Sep 24 16:11:43 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 09:38:08 2018 +0100

--
 Dockerfile  |  4 
 Jenkinsfile |  8 
 README.md   | 34 ++
 software/webapp/pom.xml |  1 +
 4 files changed, 31 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/Dockerfile
--
diff --git a/Dockerfile b/Dockerfile
index 662762f..75fca62 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,3 +19,7 @@ FROM maven:3.5.4-jdk-8-alpine
 
 # Install necessary binaries to build brooklyn-library
 RUN apk add --no-cache git procps
+
+RUN mkdir -p /var/maven/.m2/ && chmod -R 777 /var/maven/
+ENV MAVEN_CONFIG=/var/maven/.m2
+

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/Jenkinsfile
--
diff --git a/Jenkinsfile b/Jenkinsfile
index 76a41e3..67c1b79 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -36,16 +36,16 @@ node(label: 'ubuntu') {
 }
 
 stage('Run tests') {
-environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}/.m2:/var/maven/.m2 -v 
${WORKSPACE}:/usr/build -w /usr/build -e MAVEN_CONFIG=/var/maven/.m2') {
-sh 'mvn clean install -Duser.name=$(id -un 910)'
+environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+sh 'mvn clean install -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
 }
 }
 
 // Conditional stage to deploy artifacts, when not building a PR
 if (env.CHANGE_ID == null) {
 stage('Deploy artifacts') {
-environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}/.m2:/var/maven/.m2 -v 
${WORKSPACE}:/usr/build -w /usr/build -e MAVEN_CONFIG=/var/maven/.m2') {
-sh 'mvn deploy -DskipTests -Duser.name=$(id -un 910)'
+environmentDockerImage.inside('-i --name 
brooklyn-${DOCKER_TAG} -u 910:910 -v ${WORKSPACE}:/usr/build -w /usr/build') {
+sh 'mvn deploy -DskipTests -Duser.home=/var/maven 
-Duser.name=$(id -un 910)'
 }
 }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/893ca1b0/README.md
--
diff --git a/README.md b/README.md
index 147295e..7cc40b2 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,20 @@
 ### Library of Entities for Apache Brooklyn
 
 This sub-project contains various entities not *needed* for Brooklyn,
-but useful in practice as building blocks, including entities for webapps,
+but useful as building blocks, including entities for webapps,
 datastores, and more.
 
 ### Building the project
 
-2 methods are available to build this project: within a docker container or 
directly with maven.
+Two methods are available to build this project: within a docker container or 
directly with maven.
+
+ Using maven
+
+Simply run:
+
+```bash
+mvn clean install
+```
 
  Using docker
 
@@ -23,16 +31,18 @@ docker build -t brooklyn:library .
 Then run the build:
 
 ```bash
-docker run -i --rm --name brooklyn-library -u $(id -u $(whoami)):$(id -g 
$(whoami)) \
--e MAVEN_CONFIG=/var/maven/.m2 \
--v ${HOME}/.m2:/var/maven/.m2 -v ${PWD}:/usr/build -w /usr/build \
-brooklyn:library mvn clean install -Duser.home=/var/maven 
-Duser.name=$(whoami)
-```
+docker run -i --rm --name brooklyn-library -u $(id -u):$(id -g) \
+ --mount 
type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly
 \
+ -v ${PWD}:/usr/build -w /usr/build \
+ brooklyn:library mvn clean install -Duser.home=/var/maven 
-Duser.name=$(id -un)
 
-### Using maven
-
-Simply run:
+```
 
-```bash
-mvn clean install
+You can speed this up by using your local .m2 cache:
+```
+docker run -i --rm --name brooklyn-library -u $(id -u):$(id -g) \
+-v 

[2/2] brooklyn-library git commit: This closes #160

2018-09-25 Thread aledsage
This closes #160


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

Branch: refs/heads/master
Commit: 01cc0b5846a122d15f006dc8ba89696ccee2af8e
Parents: 0c0f1a8 893ca1b
Author: Aled Sage 
Authored: Tue Sep 25 10:33:22 2018 +0100
Committer: Aled Sage 
Committed: Tue Sep 25 10:33:22 2018 +0100

--
 Dockerfile  |  4 
 Jenkinsfile |  8 
 README.md   | 34 ++
 software/webapp/pom.xml |  1 +
 4 files changed, 31 insertions(+), 16 deletions(-)
--




[1/2] brooklyn-library git commit: Update Docker image to use Maven 3.5.4

2018-09-24 Thread aledsage
Repository: brooklyn-library
Updated Branches:
  refs/heads/master 8ac59f977 -> 0c0f1a81d


Update Docker image to use Maven 3.5.4



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

Branch: refs/heads/master
Commit: 0fd00cc8a210af991c92b1bd7b89335eb4c1e78e
Parents: a94f7d8
Author: Sylwester Lachiewicz 
Authored: Sat Sep 8 14:44:57 2018 +0200
Committer: Sylwester Lachiewicz 
Committed: Sat Sep 8 14:44:57 2018 +0200

--
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/0fd00cc8/Dockerfile
--
diff --git a/Dockerfile b/Dockerfile
index 0c5b9f5..662762f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-FROM maven:3.5.2-jdk-8-alpine
+FROM maven:3.5.4-jdk-8-alpine
 
 # Install necessary binaries to build brooklyn-library
 RUN apk add --no-cache git procps



[2/2] brooklyn-library git commit: This closes #158

2018-09-24 Thread aledsage
This closes #158


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

Branch: refs/heads/master
Commit: 0c0f1a81d8c39124e47662ee9677381fa2c790ff
Parents: 8ac59f9 0fd00cc
Author: Aled Sage 
Authored: Mon Sep 24 17:07:52 2018 +0100
Committer: Aled Sage 
Committed: Mon Sep 24 17:07:52 2018 +0100

--
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[1/2] brooklyn-docs git commit: document add'l constraints

2018-09-24 Thread aledsage
Repository: brooklyn-docs
Updated Branches:
  refs/heads/master 2b06e9605 -> 1730d7262


document add'l constraints


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

Branch: refs/heads/master
Commit: 43ae2e947bff5bb659b66714fb361895e91f6b73
Parents: 97515cb
Author: Alex Heneveld 
Authored: Mon Sep 24 10:49:12 2018 +0100
Committer: Alex Heneveld 
Committed: Mon Sep 24 10:49:12 2018 +0100

--
 guide/blueprints/entity-configuration.md | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/43ae2e94/guide/blueprints/entity-configuration.md
--
diff --git a/guide/blueprints/entity-configuration.md 
b/guide/blueprints/entity-configuration.md
index 1bd1db1..e3b4434 100644
--- a/guide/blueprints/entity-configuration.md
+++ b/guide/blueprints/entity-configuration.md
@@ -55,13 +55,19 @@ and for a complete reference on the syntax of 
`brooklyn.parameters` see that sec
 
  Config Key Constraints
 
-The config keys in the `brooklyn.parameters` can also have constraints 
defined, for what values
+The config keys in the `brooklyn.parameters` can also have a list of 
constraints defined, for what values
 are valid. If more than one constraint is defined, then they must all be 
satisfied. The constraints 
 can be any of:
 
-* `required`: deployment will fail if no value is supplied for this config key.
-* `regex: ...`: the value will be compared against the given regular 
expression.
-* A predicate, declared using the DSL `$brooklyn:object`.  
+* `required`: deployment will fail if no value is supplied for this config key
+* `regex: `: the value must match the regular expression ``
+* `glob: `: the value must match the bash-style wildcard glob 
``
+* `urlExists: `: the server must be able to resolve and access the URL 
``
+* `forbiddenIf: `: setting a value is disallowed if the config key 
`` has a value set
+* `forbiddenUnless: `: setting a value is disallowed if the config key 
`` does not have a value set
+* `requiredIf: `: a value is required if the config key `` has a 
value set
+* `requiredUnless: `: a value is required if the config key `` does 
not have a value set
+* Any java `Predicate`, declared using the DSL `$brooklyn:object`.  
 
 This is illustrated in the example below:
 



[2/2] brooklyn-docs git commit: This closes #268

2018-09-24 Thread aledsage
This closes #268


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

Branch: refs/heads/master
Commit: 1730d726211ec7dcb63b89aa786f6b49aa668b2c
Parents: 2b06e96 43ae2e9
Author: Aled Sage 
Authored: Mon Sep 24 14:22:11 2018 +0100
Committer: Aled Sage 
Committed: Mon Sep 24 14:22:11 2018 +0100

--
 guide/blueprints/entity-configuration.md | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)
--




[7/7] brooklyn-server git commit: This closes #999

2018-09-24 Thread aledsage
This closes #999


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

Branch: refs/heads/master
Commit: a3d0ea06edcd15362688107f0afd9b153048c7e6
Parents: e27cc7b 3d214b8
Author: Aled Sage 
Authored: Mon Sep 24 12:30:11 2018 +0100
Committer: Aled Sage 
Committed: Mon Sep 24 12:30:11 2018 +0100

--
 .../brooklyn/core/config/ConfigConstraints.java | 103 +
 .../brooklyn/core/objs/BasicSpecParameter.java  |  51 +--
 .../core/objs/ConstraintSerialization.java  | 375 +++
 .../brooklyn/util/core/ResourcePredicates.java  |   6 +-
 .../core/config/ConfigKeyConstraintTest.java| 133 +--
 .../objs/BasicSpecParameterFromListTest.java|   5 +-
 .../core/objs/ConstraintSerializationTest.java  | 121 ++
 .../brooklyn/rest/domain/ConfigSummary.java |  17 +-
 .../java/org/apache/brooklyn/test/Asserts.java  |  16 +-
 .../brooklyn/util/text/StringPredicates.java|  11 +-
 .../org/apache/brooklyn/util/text/Strings.java  |  22 +-
 .../org/apache/brooklyn/test/AssertsTest.java   |   2 +-
 12 files changed, 752 insertions(+), 110 deletions(-)
--




[4/7] brooklyn-server git commit: forgot to use deserialization routines when parsing catalog input

2018-09-24 Thread aledsage
forgot to use deserialization routines when parsing catalog input

also test and fix for some edge-cases in serializing


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

Branch: refs/heads/master
Commit: fdb2784a8bdc7a3bc53508a381b258539f7aafc0
Parents: 5fec275
Author: Alex Heneveld 
Authored: Sat Sep 22 01:24:09 2018 +0100
Committer: Alex Heneveld 
Committed: Sat Sep 22 01:24:09 2018 +0100

--
 .../brooklyn/core/config/ConfigConstraints.java |  9 
 .../brooklyn/core/objs/BasicSpecParameter.java  | 51 +---
 .../core/objs/ConstraintSerialization.java  |  9 ++--
 .../brooklyn/util/core/ResourcePredicates.java  |  2 +-
 .../core/objs/ConstraintSerializationTest.java  | 45 +
 5 files changed, 52 insertions(+), 64 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fdb2784a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java 
b/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
index 4ee584d..c234aae 100644
--- a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
+++ b/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
@@ -22,6 +22,7 @@ package org.apache.brooklyn.core.config;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.location.Location;
@@ -244,6 +245,14 @@ public abstract class ConfigConstraints {
 public String toString() {
 return "required()";
 }
+@Override
+public boolean equals(Object obj) {
+return (obj instanceof RequiredPredicate) && 
obj.getClass().equals(getClass());
+}
+@Override
+public int hashCode() {
+return Objects.hash(toString());
+}
 }
 
 private static abstract class OtherKeyPredicate implements 
BrooklynObjectPredicate {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fdb2784a/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java 
b/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
index 7c1bde0..7c777f8 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
@@ -18,8 +18,6 @@
  */
 package org.apache.brooklyn.core.objs;
 
-import static com.google.common.base.Preconditions.checkArgument;
-
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -55,7 +53,6 @@ import org.apache.brooklyn.util.collections.MutableList;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.collections.MutableSet;
 import org.apache.brooklyn.util.guava.Maybe;
-import org.apache.brooklyn.util.text.StringPredicates;
 import org.apache.brooklyn.util.time.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -70,7 +67,6 @@ import com.google.common.base.Predicates;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
 import com.google.common.reflect.TypeToken;
 
 public class BasicSpecParameter implements SpecParameter{
@@ -221,18 +217,6 @@ public class BasicSpecParameter implements 
SpecParameter{
 .put("port", PortRange.class)
 .build();
 
-private static final Map> BUILT_IN_CONSTRAINTS = 
ImmutableMap.>of(
-"required", StringPredicates.isNonBlank());
-
-private static final Map>> 
BUILT_IN_CONSTRAINT_FACTORIES = ImmutableMap.>>of(
-"regex", new Function>() {
-@Override public Predicate apply(Object input) {
-// TODO Could try to handle deferred supplier as well?
-checkArgument(input instanceof String, "Constraint 
regex value must be a string, but got %s (%s)",
-(input == null ? "null" : 
input.getClass().getName()), input);
-return StringPredicates.matchesRegex((String)input);
-}});
-
  

[1/7] brooklyn-server git commit: proper serialization and deserialization for constraints

2018-09-24 Thread aledsage
Repository: brooklyn-server
Updated Branches:
  refs/heads/master e27cc7b6d -> a3d0ea06e


proper serialization and deserialization for constraints


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

Branch: refs/heads/master
Commit: bd34655c81400f8228c329ecec31ce6e378f78b0
Parents: e27cc7b
Author: Alex Heneveld 
Authored: Thu Sep 20 22:34:25 2018 +0100
Committer: Alex Heneveld 
Committed: Thu Sep 20 22:34:25 2018 +0100

--
 .../brooklyn/core/config/ConfigConstraints.java |  25 ++
 .../core/objs/ConstraintSerialization.java  | 354 +++
 .../core/objs/ConstraintSerializationTest.java  |  84 +
 .../brooklyn/rest/domain/ConfigSummary.java |  17 +-
 .../brooklyn/util/text/StringPredicates.java|  11 +-
 .../org/apache/brooklyn/util/text/Strings.java  |  22 +-
 .../org/apache/brooklyn/test/AssertsTest.java   |   2 +-
 7 files changed, 497 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/bd34655c/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java 
b/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
index 17b7c9d..35f672e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
+++ b/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
@@ -33,6 +33,7 @@ import org.apache.brooklyn.core.entity.EntityInternal;
 import org.apache.brooklyn.core.objs.AbstractEntityAdjunct;
 import org.apache.brooklyn.core.objs.BrooklynObjectInternal;
 import org.apache.brooklyn.core.objs.BrooklynObjectPredicate;
+import org.apache.brooklyn.core.objs.ConstraintSerialization;
 import org.apache.brooklyn.util.core.task.Tasks;
 import org.apache.brooklyn.util.exceptions.ReferenceWithError;
 import org.apache.brooklyn.util.guava.Maybe;
@@ -185,6 +186,13 @@ public abstract class ConfigConstraints {
 return brooklynObject;
 }
 
+/**
+ * Convenience method to get the serialization routines.
+ */
+public static ConstraintSerialization serialization() {
+return ConstraintSerialization.INSTANCE;
+}
+
 private static class EntityConfigConstraints extends 
ConfigConstraints {
 public EntityConfigConstraints(Entity brooklynObject) {
 super(brooklynObject);
@@ -218,4 +226,21 @@ public abstract class ConfigConstraints {
 }
 }
 
+public static  Predicate required() {
+return new RequiredPredicate();
+}
+
+/** Predicate indicating a field is required:  it must not be null and if 
a string it must not be empty */
+public static class RequiredPredicate implements Predicate {
+@Override
+public boolean apply(T input) {
+if (input==null) return false;
+if (input instanceof CharSequence && 
((CharSequence)input).length()==0) return false;
+return true;
+}
+@Override
+public String toString() {
+return "required()";
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/bd34655c/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java 
b/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
new file mode 100644
index 000..a6b7039
--- /dev/null
+++ 
b/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
@@ -0,0 +1,354 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.objs;
+
+import java.util.Collection;

[5/7] brooklyn-server git commit: address further PR comments

2018-09-24 Thread aledsage
address further PR comments


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

Branch: refs/heads/master
Commit: fc1c588381029a3623c155d88a76185d7e01f696
Parents: fdb2784
Author: Alex Heneveld 
Authored: Sat Sep 22 01:45:00 2018 +0100
Committer: Alex Heneveld 
Committed: Sat Sep 22 01:45:00 2018 +0100

--
 .../apache/brooklyn/core/config/ConfigConstraints.java| 10 +-
 .../brooklyn/core/objs/ConstraintSerialization.java   |  4 +++-
 .../org/apache/brooklyn/util/core/ResourcePredicates.java |  2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fc1c5883/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java 
b/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
index c234aae..67d8aef 100644
--- a/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
+++ b/core/src/main/java/org/apache/brooklyn/core/config/ConfigConstraints.java
@@ -256,7 +256,7 @@ public abstract class ConfigConstraints {
 }
 
 private static abstract class OtherKeyPredicate implements 
BrooklynObjectPredicate {
-private String otherKeyName;
+private final String otherKeyName;
 
 public OtherKeyPredicate(String otherKeyName) {
 this.otherKeyName = otherKeyName;
@@ -286,7 +286,7 @@ public abstract class ConfigConstraints {
 }
 
 public static Predicate forbiddenIf(String otherKeyName) { return 
new ForbiddenIfPredicate(otherKeyName); }
-public static class ForbiddenIfPredicate extends OtherKeyPredicate {
+protected static class ForbiddenIfPredicate extends OtherKeyPredicate {
 public ForbiddenIfPredicate(String otherKeyName) { 
super(otherKeyName); }
 @Override public String predicateName() { return "forbiddenIf"; }
 @Override public boolean test(Object thisValue, Object otherValue) { 
@@ -295,7 +295,7 @@ public abstract class ConfigConstraints {
 }
 
 public static Predicate forbiddenUnless(String otherKeyName) { 
return new ForbiddenUnlessPredicate(otherKeyName); }
-public static class ForbiddenUnlessPredicate extends OtherKeyPredicate {
+protected static class ForbiddenUnlessPredicate extends OtherKeyPredicate {
 public ForbiddenUnlessPredicate(String otherKeyName) { 
super(otherKeyName); }
 @Override public String predicateName() { return "forbiddenUnless"; }
 @Override public boolean test(Object thisValue, Object otherValue) { 
@@ -304,7 +304,7 @@ public abstract class ConfigConstraints {
 }
 
 public static Predicate requiredIf(String otherKeyName) { return 
new RequiredIfPredicate(otherKeyName); }
-public static class RequiredIfPredicate extends OtherKeyPredicate {
+protected static class RequiredIfPredicate extends OtherKeyPredicate {
 public RequiredIfPredicate(String otherKeyName) { super(otherKeyName); 
}
 @Override public String predicateName() { return "requiredIf"; }
 @Override public boolean test(Object thisValue, Object otherValue) { 
@@ -313,7 +313,7 @@ public abstract class ConfigConstraints {
 }
 
 public static Predicate requiredUnless(String otherKeyName) { 
return new RequiredUnlessPredicate(otherKeyName); }
-public static class RequiredUnlessPredicate extends OtherKeyPredicate {
+protected static class RequiredUnlessPredicate extends OtherKeyPredicate {
 public RequiredUnlessPredicate(String otherKeyName) { 
super(otherKeyName); }
 @Override public String predicateName() { return "requiredUnless"; }
 @Override public boolean test(Object thisValue, Object otherValue) { 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fc1c5883/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java 
b/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
index 2fef0e8..984e2e7 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
@@ -40,12 +40,14 @@ import 
org.apache.brooklyn.util.text.StringEscapes.JavaStringEscapes;
 import org.apache.brooklyn.util.text.StringPredicates;
 import 

[6/7] brooklyn-server git commit: split out notNull as different to required=nonBlank, fix tests

2018-09-24 Thread aledsage
split out notNull as different to required=nonBlank, fix tests


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

Branch: refs/heads/master
Commit: 3d214b89fc5308451e5078ee4651f878eab6d081
Parents: fc1c588
Author: Alex Heneveld 
Authored: Sat Sep 22 02:19:42 2018 +0100
Committer: Alex Heneveld 
Committed: Sat Sep 22 02:48:58 2018 +0100

--
 .../org/apache/brooklyn/core/objs/ConstraintSerialization.java  | 3 ++-
 .../brooklyn/core/objs/BasicSpecParameterFromListTest.java  | 5 +++--
 .../apache/brooklyn/core/objs/ConstraintSerializationTest.java  | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3d214b89/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
--
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java 
b/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
index 984e2e7..32b71f0 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/objs/ConstraintSerialization.java
@@ -167,12 +167,13 @@ public class ConstraintSerialization {
 @SuppressWarnings({ "unchecked", "rawtypes" })
 private void init() {
 PredicateSerializationRuleAdder.predicateListConstructor((o) -> 
ConfigConstraints.required()).
-equivalentPredicates(Predicates.notNull(), 
StringPredicates.isNonBlank()).add(this);
+equivalentPredicates(StringPredicates.isNonBlank()).add(this);
 
 PredicateSerializationRuleAdder.predicateListConstructor((o) -> 
Predicates.or((Iterable)o)).preferredName("any").equivalentNames("or").add(this);
 PredicateSerializationRuleAdder.predicateListConstructor((o) -> /* and 
predicate is default when given list */ 
toPredicateFromJson(o)).preferredName("all").sample(Predicates.and(Collections.emptyList())).equivalentNames("and").add(this);
 
PredicateSerializationRuleAdder.noArgConstructor(Predicates::alwaysFalse).add(this);
 
PredicateSerializationRuleAdder.noArgConstructor(Predicates::alwaysTrue).add(this);
+
PredicateSerializationRuleAdder.noArgConstructor(Predicates::notNull).add(this);
 
 
PredicateSerializationRuleAdder.noArgConstructor(ResourcePredicates::urlExists).preferredName("urlExists").add(this);
 
PredicateSerializationRuleAdder.noArgConstructor(StringPredicates::isBlank).add(this);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3d214b89/core/src/test/java/org/apache/brooklyn/core/objs/BasicSpecParameterFromListTest.java
--
diff --git 
a/core/src/test/java/org/apache/brooklyn/core/objs/BasicSpecParameterFromListTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/objs/BasicSpecParameterFromListTest.java
index 887e054..3ce8d9c 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/objs/BasicSpecParameterFromListTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/objs/BasicSpecParameterFromListTest.java
@@ -28,6 +28,7 @@ import java.util.List;
 import org.apache.brooklyn.api.mgmt.classloading.BrooklynClassLoadingContext;
 import org.apache.brooklyn.api.objs.SpecParameter;
 import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigConstraints;
 import 
org.apache.brooklyn.core.mgmt.classloading.JavaBrooklynClassLoadingContext;
 import org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport;
 import org.apache.brooklyn.util.text.StringPredicates;
@@ -99,7 +100,7 @@ public class BasicSpecParameterFromListTest extends 
BrooklynMgmtUnitTestSupport
 assertEquals(type.getDefaultValue(), defaultValue);
 assertEquals(type.getDescription(), description);
 assertTrue(type.getInheritanceByContext().values().isEmpty(), 
"Unexpected inheritance: "+type.getInheritanceByContext());
-assertConstraint(type.getConstraint(), StringPredicates.isNonBlank());
+assertConstraint(type.getConstraint(), ConfigConstraints.required());
 }
 
 @Test
@@ -132,7 +133,7 @@ public class BasicSpecParameterFromListTest extends 
BrooklynMgmtUnitTestSupport
 "name", name,
 "constraints", ImmutableList.of(constraint)));
 ConfigKey type = input.getConfigKey();
-assertConstraint(type.getConstraint(), StringPredicates.isNonBlank());
+assertConstraint(type.getConstraint(), ConfigConstraints.required());
 }
 
 

  1   2   3   4   5   6   7   8   9   10   >