[GitHub] brooklyn-server pull request #716: Fixing/disabling failing integration test...

2017-06-06 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/716


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #715: Feature/http commnand effector improvements

2017-06-06 Thread andreaturli
Github user andreaturli commented on the issue:

https://github.com/apache/brooklyn-server/pull/715
  
thanks!



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Build failed in Jenkins: brooklyn-server-master #618

2017-06-06 Thread Apache Jenkins Server
See 


Changes:

[andrea.turli] manage content-type urlencoded

[andrea.turli] add javadoc to HttpCommandEffector

[andrea.turli] more unit tests

[andrea.turli] address @geomacy comments

--
[...truncated 6.36 MB...]
2017-06-06 14:07:46,986 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod() finished in 
0 ms
2017-06-06 14:07:46,986 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.rest.resources.EntityResourceTest.testTagsDoNotSerializeTooMuch()
2017-06-06 14:07:46,996 INFO  TAGS raw: 
["foo",{"type":"org.apache.brooklyn.api.entity.Entity","id":"bp2550l3mn"}]
2017-06-06 14:07:46,997 INFO  TAGS are: [foo, 
{type=org.apache.brooklyn.api.entity.Entity, id=bp2550l3mn}]
2017-06-06 14:07:47,000 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.rest.resources.EntityResourceTest.testTagsDoNotSerializeTooMuch()
 finished in 13 ms
2017-06-06 14:07:47,000 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod()
2017-06-06 14:07:47,001 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod() finished 
in 0 ms
2017-06-06 14:07:47,001 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod()
2017-06-06 14:07:47,002 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod() finished in 
1 ms
2017-06-06 14:07:47,002 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.rest.resources.EntityResourceTest.testTagsSanity()
2017-06-06 14:07:47,012 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.rest.resources.EntityResourceTest.testTagsSanity() finished 
in 10 ms
2017-06-06 14:07:47,013 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod()
2017-06-06 14:07:47,013 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod() finished 
in 0 ms
2017-06-06 14:07:47,014 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterClass org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownClass()
2017-06-06 14:07:47,016 INFO  Stopping application 
BasicApplicationImpl{id=bp2550l3mn}
2017-06-06 14:07:47,017 INFO  Stopping application 
BasicApplicationImpl{id=jm389ce14z}
2017-06-06 14:07:47,018 INFO  Stopping application 
BasicApplicationImpl{id=tk6b9hhc56}
2017-06-06 14:07:47,019 INFO  Stopping RestMockSimpleEntity{id=luj24zxwcp} in 
[SshMachineLocation[localhost:n...@qnode3.quenda.co/127.0.1.1:22(id=sjre2hrxej)]]
2017-06-06 14:07:47,019 INFO  Stopped application 
BasicApplicationImpl{id=jm389ce14z}
2017-06-06 14:07:47,020 INFO  Stopped application 
BasicApplicationImpl{id=tk6b9hhc56}
2017-06-06 14:07:47,048 INFO  Stopped application 
BasicApplicationImpl{id=bp2550l3mn}
2017-06-06 14:07:47,053 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterClass 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownClass() finished 
in 39 ms
2017-06-06 14:07:47,056 INFO  TESTNG 
===
Surefire test
Tests run: 179, Failures: 7, Skips: 0
===
[GC (Allocation Failure)  238745K->63214K(743936K), 0.0116024 secs]
Tests run: 179, Failures: 7, Errors: 0, Skipped: 0, Time elapsed: 50.52 sec <<< 
FAILURE! - in TestSuite
testArchiveWithoutBom(org.apache.brooklyn.rest.resources.CatalogResourceTest)  
Time elapsed: 0.036 sec  <<< FAILURE!
java.lang.AssertionError: expected [400] but found [500]
at 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testArchiveWithoutBom(CatalogResourceTest.java:597)

testArchiveWithoutBundle(org.apache.brooklyn.rest.resources.CatalogResourceTest)
  Time elapsed: 0.02 sec  <<< FAILURE!
java.lang.AssertionError: expected [400] but found [500]
at 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testArchiveWithoutBundle(CatalogResourceTest.java:636)

testArchiveWithoutBundleAndVersion(org.apache.brooklyn.rest.resources.CatalogResourceTest)
  Time elapsed: 0.057 sec  <<< FAILURE!
java.lang.AssertionError: expected [400] but found [500]
at 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testArchiveWithoutBundleAndVersion(CatalogResourceTest.java:616)

testArchiveWithoutVersion(org.apache.brooklyn.rest.resources.CatalogResourceTest)
  Time elapsed: 0.017 sec  <<< FAILURE!
java.lang.AssertionError: expected [400] but found [500]
at 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testArchiveWithoutVersion(CatalogResourceTest.java:657)


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

2017-06-06 Thread andreaturli
Github user andreaturli commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120352362
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -88,7 +91,9 @@
 public static final ConfigKey> 
EFFECTOR_HTTP_HEADERS = new MapConfigKey(String.class, "headers");
 public static final ConfigKey EFFECTOR_HTTP_PAYLOAD = 
ConfigKeys.newConfigKey(Object.class, "httpPayload");
 public static final ConfigKey JSON_PATH = 
ConfigKeys.newStringConfigKey("jsonPath", "JSON path to select in HTTP 
response");
-public static final ConfigKey> 
JSON_PATHS_AND_SENSORS = new MapConfigKey(String.class, "jsonPathAndSensors", 
"json path selector and correspondant sensor name tha will publish the json 
path extracted value");
+@Deprecated 
+public static final ConfigKey PUBLISH_SENSOR = 
ConfigKeys.newStringConfigKey("publishSensor", "Sensor name where to store json 
path extracted value");
+public static final ConfigKey> 
JSON_PATHS_AND_SENSORS = new MapConfigKey(String.class, "jsonPathAndSensors", 
"json path selector and correspondant sensor name that will publish the json 
path extracted value");
--- End diff --

thanks! :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

2017-06-06 Thread andreaturli
Github user andreaturli commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120353161
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -88,7 +91,9 @@
 public static final ConfigKey> 
EFFECTOR_HTTP_HEADERS = new MapConfigKey(String.class, "headers");
 public static final ConfigKey EFFECTOR_HTTP_PAYLOAD = 
ConfigKeys.newConfigKey(Object.class, "httpPayload");
 public static final ConfigKey JSON_PATH = 
ConfigKeys.newStringConfigKey("jsonPath", "JSON path to select in HTTP 
response");
-public static final ConfigKey> 
JSON_PATHS_AND_SENSORS = new MapConfigKey(String.class, "jsonPathAndSensors", 
"json path selector and correspondant sensor name tha will publish the json 
path extracted value");
+@Deprecated 
--- End diff --

thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

2017-06-06 Thread andreaturli
Github user andreaturli commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120353271
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -72,7 +74,8 @@
  * It deals with some {@link HttpHeaders.CONTENT_TYPE} namely 
'application/json' (as default) and 'application/x-www-form-urlencoded'. 
  * In the latter case, a map payload will be URLEncoded in a single string
  * 
- * With optional JSON_PATH config key, the effector will extract a section 
of the json response.
+ * With optional JSON_PATH config key, the effector will extract a section 
of the json response. 
+ * Notice if both JSON_PATH and JSON_PATHS_AND_SENSORS are both defined, 
JSON_PATH will take precedence. 
--- End diff --

forgot to remove this comment after changing the impl. thx


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #718: WIP - DO NOT MERGE - improve OSGi serialization ...

2017-06-06 Thread ahgittin
Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/718
  
currently when xstream writes a reference to a java type it checks whether 
that class comes from a bundle and if so it prefixes the reference with the 
bundle name.  in the past some things have been white-listed but we are 
white-listing fewer and fewer of these.  the code does this for most "normal" 
references (though I'm still a bit unclear in `XmlSerializer` what "normal 
usage" is, as contrasted to "low-level mentions").

normal usage seems to exclude the `SpecConverter.{,un}marshal` so specs 
always write the unadorned java name, and can't understand a prefix.

normal usage _does_ include things like miscellaneous classes being 
written, like a `ConfigKey` whose value is a type 
`com.custom.bundle.MyEnum`.

i think most people are agreed that in an ideal world we'd serialize only 
registered types, and json primitives, not arbitrary java.  but given what's 
out there already, and the work needed on supporting arbitrary types in the 
registry (mainly in API/UI, the backend is pretty good) we have to be able to 
read/write many java items, and increasingly these are from osgi.

so the suggested solution is:

1) if there is a registered type which is a simple wrapper for a java type, 
refer to that type name when reading and writing; that contains all the bundle 
info to create the type, and our update strategies for registered types can 
apply to them.  attend to search paths when reading so we prefer things in a 
local bundle.

2) if not, WARN, then-

* on write:  prefix with the bundle name

* on read: try loading it ignoring the bundle but using the search path 
(bundles, and for legacy readings also catalog item(s)); if that doesn't work, 
then look in the declared bundle



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #718: WIP - DO NOT MERGE - improve OSGi serialization ...

2017-06-06 Thread ahgittin
Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/718
  
in `SpecConverter`, if the catalog item ID is set i think that implies the 
java type so we _could_ skip writing and _should_ ignore it (just use the 
catalog item ID) when reading.  that would solve the problem identified here.

a different solution would be to make sure the CLC for `foo-wrapped` 
includes bundles declared in ancestor types.  that's probably (?) wanted in any 
case, so feels like we should do both of these.

those are quicker, necessary, and independent fixes instead of the 
suggestion in the previous post about the wider osgi serialization approach.  
(that approach should also look at comments in `ClassRenamingMapper` about 
unifying it with `OsgiClassnameMapper`; and a related improvement is for the 
search path to refer to bundles.)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #718: WIP - DO NOT MERGE - improve OSGi serialization ...

2017-06-06 Thread ahgittin
Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/718
  
we also need a way to fix existing deployments that suffer this problem.  
any of the above fixes should suffice, but i wonder whether there is a 
workaround that doesn't involve upgrading to a new version once we've fixed it.

if you're using a recent brooklyn, we can take advantage of the fact that 
`ClassRenamingMapper` applies to "low-level mentions", and understands OSGi 
prefixes.  we can define a rename from `foo.Foo` to `foo-bundle:foo.Foo` and 
that works.

however i've a deployment that predates the above behaviour, and i'd like 
to be able to load its state.  i can't find a way, not even with edits to the 
persisted state.  :(


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-client pull request #53: show bundle info and message when doing `c...

2017-06-06 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-client/pull/53


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #672: Bundle uninstall and snapshot

2017-06-06 Thread ahgittin
Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/672
  
Thanks @geomacy.  Merged https://github.com/apache/brooklyn-client/pull/53 
following @Graeme-Miller 's review there but as I'm a go newbie (g00b ?) 
appreciate any comments you have there.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-client issue #53: show bundle info and message when doing `catalog ...

2017-06-06 Thread geomacy
Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-client/pull/53
  
Looks good to me too!   Sorry about late review but wouldn't have had any 
comments anyway :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

2017-06-06 Thread geomacy
Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
Hm, build fails with same error - I can't reproduce that however. I did 
reproduce the original error, then built everything successfully after making 
the change above. Odd...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

2017-06-06 Thread geomacy
Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #604: WIP DO NOT MERGE Fixes to testManuallyAdd...

2017-06-06 Thread geomacy
Github user geomacy closed the pull request at:

https://github.com/apache/brooklyn-server/pull/604


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #604: WIP DO NOT MERGE Fixes to testManuallyAdd...

2017-06-06 Thread geomacy
Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/604
  
Just going to close this PR, it can be revived when we think it's important 
to get round to those comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Build failed in Jenkins: brooklyn-server-master #617

2017-06-06 Thread Apache Jenkins Server
See 


Changes:

[alex.heneveld] basic support for uninstalling bundle, and sketch of reinstall

[alex.heneveld] record the containing bundle for any catalog item / registered 
type

[alex.heneveld] uninstall removes catalog items

[alex.heneveld] refactor osgi installation to facilitate upgrades and richer 
return

[alex.heneveld] install and start in separate phases when rebinding or loading 
libs

[alex.heneveld] Fixup of tests which failed following BOM auto-install

[alex.heneveld] address PR comments - the straightforward ones

[alex.heneveld] utils for working with VersionedName better

[alex.heneveld] record VersionedName instead of string for containing bundle, 
as per PR

[alex.heneveld] Revert "record VersionedName instead of string for containing 
bundle, as

[alex.heneveld] notes on containing bundle being a versioned name

[alex.heneveld] synchronize osgi bundle managers inside dedicated 
package-private class

[alex.heneveld] better detail in REST API response when posting ZIP

--
[...truncated 6.75 MB...]
2017-06-06 12:39:52,383 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod()
2017-06-06 12:39:52,383 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod() finished in 
0 ms
2017-06-06 12:39:52,383 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testDeleteOnlyLatestLocation()
2017-06-06 12:39:52,404 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testDeleteOnlyLatestLocation()
 finished in 21 ms
2017-06-06 12:39:52,405 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod()
2017-06-06 12:39:52,405 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod() finished 
in 1 ms
2017-06-06 12:39:52,405 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod()
2017-06-06 12:39:52,405 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod() finished in 
0 ms
2017-06-06 12:39:52,405 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testDeleteOnlyLatestPolicy()
2017-06-06 12:39:52,443 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testDeleteOnlyLatestPolicy()
 finished in 38 ms
2017-06-06 12:39:52,449 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod()
2017-06-06 12:39:52,449 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod() finished 
in 0 ms
2017-06-06 12:39:52,449 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod()
2017-06-06 12:39:52,450 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.setUpMethod() finished in 
0 ms
2017-06-06 12:39:52,450 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testDeleteOnlyLatestApplication()
2017-06-06 12:39:52,483 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.rest.resources.CatalogResourceTest.testDeleteOnlyLatestApplication()
 finished in 33 ms
2017-06-06 12:39:52,484 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod()
2017-06-06 12:39:52,484 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownMethod() finished 
in 0 ms
2017-06-06 12:39:52,484 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterClass org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownClass()
2017-06-06 12:39:52,485 INFO  Stopping application 
BasicApplicationImpl{id=g5hjjbr384}
2017-06-06 12:39:52,486 INFO  Stopped application 
BasicApplicationImpl{id=g5hjjbr384}
[GC (Allocation Failure)  238162K->63892K(743936K), 0.0086753 secs]
2017-06-06 12:39:52,602 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterClass 
org.apache.brooklyn.rest.testing.BrooklynRestApiTest.tearDownClass() finished 
in 118 ms
2017-06-06 12:39:52,638 INFO  TESTNG 
===
Surefire test
Tests run: 179, Failures: 7, Skips: 0
===
Tests run: 179, Failures: 7, Errors: 0, 

[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

2017-06-06 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120345288
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -72,7 +74,8 @@
  * It deals with some {@link HttpHeaders.CONTENT_TYPE} namely 
'application/json' (as default) and 'application/x-www-form-urlencoded'. 
  * In the latter case, a map payload will be URLEncoded in a single string
  * 
- * With optional JSON_PATH config key, the effector will extract a section 
of the json response.
+ * With optional JSON_PATH config key, the effector will extract a section 
of the json response. 
+ * Notice if both JSON_PATH and JSON_PATHS_AND_SENSORS are both defined, 
JSON_PATH will take precedence. 
--- End diff --

This is different from the behaviour implemented at lines 139-141


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

2017-06-06 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120344061
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -88,7 +91,9 @@
 public static final ConfigKey> 
EFFECTOR_HTTP_HEADERS = new MapConfigKey(String.class, "headers");
 public static final ConfigKey EFFECTOR_HTTP_PAYLOAD = 
ConfigKeys.newConfigKey(Object.class, "httpPayload");
 public static final ConfigKey JSON_PATH = 
ConfigKeys.newStringConfigKey("jsonPath", "JSON path to select in HTTP 
response");
-public static final ConfigKey> 
JSON_PATHS_AND_SENSORS = new MapConfigKey(String.class, "jsonPathAndSensors", 
"json path selector and correspondant sensor name tha will publish the json 
path extracted value");
+@Deprecated 
--- End diff --

Needs a comment with "Deprecated since=0.12.0"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

2017-06-06 Thread geomacy
Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120347806
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -211,7 +226,7 @@ private HttpRequest buildHttpRequest(String httpVerb, 
URI uri, Map[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r12033
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/effector/http/HttpCommandEffector.java
 ---
@@ -88,7 +91,9 @@
 public static final ConfigKey> 
EFFECTOR_HTTP_HEADERS = new MapConfigKey(String.class, "headers");
 public static final ConfigKey EFFECTOR_HTTP_PAYLOAD = 
ConfigKeys.newConfigKey(Object.class, "httpPayload");
 public static final ConfigKey JSON_PATH = 
ConfigKeys.newStringConfigKey("jsonPath", "JSON path to select in HTTP 
response");
-public static final ConfigKey> 
JSON_PATHS_AND_SENSORS = new MapConfigKey(String.class, "jsonPathAndSensors", 
"json path selector and correspondant sensor name tha will publish the json 
path extracted value");
+@Deprecated 
+public static final ConfigKey PUBLISH_SENSOR = 
ConfigKeys.newStringConfigKey("publishSensor", "Sensor name where to store json 
path extracted value");
+public static final ConfigKey> 
JSON_PATHS_AND_SENSORS = new MapConfigKey(String.class, "jsonPathAndSensors", 
"json path selector and correspondant sensor name that will publish the json 
path extracted value");
--- End diff --

maybe better "corresponding" rather than "correspondent" 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

Github user geomacy commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120349310
  
--- Diff: 
core/src/test/java/org/apache/brooklyn/core/effector/http/HttpCommandEffectorTest.java
 ---
@@ -248,6 +248,27 @@ public void testPayloadWithContentTypeHeaderXml() 
throws InterruptedException {
}
 
@Test
+   public void testPayloadWithContentTypeFormUrlEncoded() throws 
InterruptedException {
+  server.enqueue(jsonResponse("url-encoded-response.json"));
+
+  httpCommandEffector = new HttpCommandEffector(ConfigBag.newInstance()
+  .configure(HttpCommandEffector.EFFECTOR_NAME, 
EFFECTOR_HTTP_COMMAND.getName())
+  .configure(HttpCommandEffector.EFFECTOR_URI, url("/post"))
+  .configure(HttpCommandEffector.EFFECTOR_HTTP_VERB, "POST")
+  .configure(HttpCommandEffector.EFFECTOR_HTTP_PAYLOAD, 
ImmutableMap.of("key", ""))
+  .configure(HttpCommandEffector.EFFECTOR_HTTP_HEADERS, 
ImmutableMap.of(HttpHeaders.CONTENT_TYPE, 
HttpCommandEffector.APPLICATION_X_WWW_FORM_URLENCODE))
+  .configure(HttpCommandEffector.JSON_PATH, "$.data")
+  );
+  assertNotNull(httpCommandEffector);
+  TestEntity testEntity = 
app.createAndManageChild(buildEntitySpec(httpCommandEffector));
+  Object output = testEntity.invoke(EFFECTOR_HTTP_COMMAND, 
ImmutableMap.of()).getUnchecked(Duration.seconds(1));
+  assertEquals(output, "{\"key\", \"%3Cimg%3E\"}");
+  
+  assertEquals(server.getRequestCount(), 1);
+  assertSent(server, "POST", "/post");
--- End diff --

you could add a check on the result of `assertSent` in here to verify that 
the payload key got successfully URL encoded


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #717: Fix/disable integration tests

GitHub user neykov opened a pull request:

https://github.com/apache/brooklyn-server/pull/717

Fix/disable integration tests



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/neykov/brooklyn-server fix-integration-tests-4

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/717.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #717


commit d0dea6b39e712ae15e2d5c35766f0994dc623f01
Author: Svetoslav Neykov 
Date:   2017-06-06T12:25:59Z

Fix/disable integration tests




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #672: Bundle uninstall and snapshot

Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/672
  
Tests all look good, I added test672a.zip to catalog
```
[geoff:] master(+0/-889)* ± br catalog add test672a.zip
myTestEnt:0.12.0.SNAPSHOT
myOtherTest:0.12.0.SNAPSHOT
testent1:0.12.0.SNAPSHOT
```
then deployed a `testEnt1` from it, then added the revised snapshot version 
of the blueprint by adding  test672b.zip:
```
[geoff:] master(+0/-889)* ± br catalog add test672b.zip
myTestEnt:0.12.0.SNAPSHOT
myOtherTest:0.12.0.SNAPSHOT
myOtherTest2:0.12.0.SNAPSHOT
furtherTest:0.12.0.SNAPSHOT
testent1:0.12.0.SNAPSHOT
testent2:0.12.0.SNAPSHOT
```
and again deployed a `testEnt1`; on this second deployment the updated 
definition from the second zip was used and the entity created with two 
children.

LGTM, will merge.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #672: Bundle uninstall and snapshot

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/672


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

Github user andreaturli commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/715#discussion_r120356395
  
--- Diff: 
core/src/test/java/org/apache/brooklyn/core/effector/http/HttpCommandEffectorTest.java
 ---
@@ -248,6 +248,27 @@ public void testPayloadWithContentTypeHeaderXml() 
throws InterruptedException {
}
 
@Test
+   public void testPayloadWithContentTypeFormUrlEncoded() throws 
InterruptedException {
+  server.enqueue(jsonResponse("url-encoded-response.json"));
+
+  httpCommandEffector = new HttpCommandEffector(ConfigBag.newInstance()
+  .configure(HttpCommandEffector.EFFECTOR_NAME, 
EFFECTOR_HTTP_COMMAND.getName())
+  .configure(HttpCommandEffector.EFFECTOR_URI, url("/post"))
+  .configure(HttpCommandEffector.EFFECTOR_HTTP_VERB, "POST")
+  .configure(HttpCommandEffector.EFFECTOR_HTTP_PAYLOAD, 
ImmutableMap.of("key", ""))
+  .configure(HttpCommandEffector.EFFECTOR_HTTP_HEADERS, 
ImmutableMap.of(HttpHeaders.CONTENT_TYPE, 
HttpCommandEffector.APPLICATION_X_WWW_FORM_URLENCODE))
+  .configure(HttpCommandEffector.JSON_PATH, "$.data")
+  );
+  assertNotNull(httpCommandEffector);
+  TestEntity testEntity = 
app.createAndManageChild(buildEntitySpec(httpCommandEffector));
+  Object output = testEntity.invoke(EFFECTOR_HTTP_COMMAND, 
ImmutableMap.of()).getUnchecked(Duration.seconds(1));
+  assertEquals(output, "{\"key\", \"%3Cimg%3E\"}");
+  
+  assertEquals(server.getRequestCount(), 1);
+  assertSent(server, "POST", "/post");
--- End diff --

good idea, added it to the test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #715: Feature/http commnand effector improvements

Github user andreaturli commented on the issue:

https://github.com/apache/brooklyn-server/pull/715
  
@geomacy I think I've addressed all of your comments. please let me know if 
it is good to merge


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #715: Feature/http commnand effector improvemen...

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/715


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
LGTM, will wait for the tests to pass and merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
retest this please, after deleting the workspace


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
Hm very strange - it looks as if the test hasn't pulled the 
[change](https://github.com/apache/brooklyn-server/pull/719/files#diff-774e93f2e6ad061ee24dbb975abff1d0R174),
 see 


https://builds.apache.org/job/brooklyn-server-pull-requests/ws/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java

Copying the relevant lines as the above will be thrown away on next rebuild:

```java
@SuppressWarnings("deprecation")
public static BundleInstallationRestResult 
of(OsgiBundleInstallationResult in, ManagementContext mgmt, 
BrooklynRestResourceUtils brooklynU, UriInfo ui) {
BundleInstallationRestResult result = new 
BundleInstallationRestResult();
result.message = in.getMessage();
result.bundle = in.getMetadata().getVersionedName().toString();
result.code = in.getCode();
if (in.getCatalogItemsInstalled()!=null) {
result.types = MutableMap.of();
for (String id: in.getCatalogItemsInstalled()) {
// TODO prefer to use RegisteredType, but we need 
transformer for those in REST
//RegisteredType ci = mgmt.getTypeRegistry().get(id);

CatalogItem ci = 
CatalogUtils.getCatalogItemOptionalVersion(mgmt, id);
CatalogItemSummary summary = 
CatalogTransformer.catalogItemSummary(brooklynU, ci, ui.getBaseUriBuilder());
result.types.put(id, summary);
}
}
return result;
}
```

Note the line 
```
result.bundle = in.getMetadata().getVersionedName().toString();
```

which doesn't include the change linked above.





---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #719: Check versionedName to avoid NPE.

GitHub user geomacy opened a pull request:

https://github.com/apache/brooklyn-server/pull/719

Check versionedName to avoid NPE.

Fixes break from https://github.com/apache/brooklyn-server/pull/672,
I merged without re-running unit tests :-(

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/geomacy/brooklyn-server check-on-catresource

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/719.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #719


commit c545381152a22df29d16c063fd6cd2fab4ec7b33
Author: Geoff Macartney 
Date:   2017-06-06T16:15:10Z

Check versionedName to avoid NPE.

Fixes break from https://github.com/apache/brooklyn-server/pull/672,
I merged without re-running unit tests :-(




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request #719: Check versionedName to avoid NPE.

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/719


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
Looks like it is fetching the apache master instead of the branch from my 
fork, as below.  Note `c545381152a22df29d16c063fd6cd2fab4ec7b33` is my change 
but it is fetching from 
```
Checking out Revision 57b9d7270ba87486f311020bf62b37105d4ca0e4 
(refs/remotes/origin/master)
```
rather than from `refs/heads/pr/719`.

From build log:
```
GitHub pull request #719 of commit 
c545381152a22df29d16c063fd6cd2fab4ec7b33, no merge conflicts.
Setting status of c545381152a22df29d16c063fd6cd2fab4ec7b33 to PENDING with 
url https://builds.apache.org/job/brooklyn-server-pull-requests/2265/ and 
message: 'Build started sha1 is merged.'
Using context: Jenkins: brooklyn-server-pull-request
[EnvInject] - Loading node environment variables.
Building remotely on H14 (ubuntu xenial) in workspace 
/home/jenkins/jenkins-slave/workspace/brooklyn-server-pull-requests
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://github.com/apache/brooklyn-server.git 
# timeout=10
Fetching upstream changes from git://github.com/apache/brooklyn-server.git
 > git --version # timeout=10
 > git fetch --tags --progress git://github.com/apache/brooklyn-server.git 
+refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 57b9d7270ba87486f311020bf62b37105d4ca0e4 
(refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 57b9d7270ba87486f311020bf62b37105d4ca0e4
First time build. Skipping changelog.
Parsing POMs
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Jenkins build is back to normal : brooklyn-server-master #619

See 




[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/719
  
Tests pass locally, merging. Will investigate jenkins issue separately.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---