[jira] [Commented] (BROOKLYN-421) Catalog libraries: externalized config for basic-auth credentials in url (via YAML)

2017-02-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15856902#comment-15856902
 ] 

ASF GitHub Bot commented on BROOKLYN-421:
-

Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/551
  
`URLEncoder.encode` is used for encoding form data for submission in the 
request body with a `x-www-form-urlencoded` `Content-Type`. That's different 
from URL encoding.
Here's a relevant [SO 
link](http://stackoverflow.com/questions/444112/how-do-i-encode-uri-parameter-values).
 See also the last downvoted answer.
We should deprecate `Urls.encode` and use a proper URL builder instead. 
[This](https://github.com/mikaelhg/urlbuilder) one I like for being small with 
no dependencies.


> Catalog libraries: externalized config for basic-auth credentials in url (via 
> YAML)
> ---
>
> Key: BROOKLYN-421
> URL: https://issues.apache.org/jira/browse/BROOKLYN-421
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.10.0
>Reporter: Aled Sage
>
> A customer wants to use YAML catalog items, where the library bundles are 
> retrieved from their Nexus repo using basic-auth. They want the nexus 
> credentials to be stored in an externalized credential store. They want the 
> credentials to be able to contain special characters (e.g. "@") that are not 
> valid in a URL.
> Building up to this, here is what we currently support...
> Either of the catalog items below is valid (i.e. the credentials can be 
> encoded in the url; the library can be supplied either as a string or as a 
> map (where the map currently takes keys of "url", "name" and "version")):
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - url: https://myuser:myp...@nexus.example.com/mybundle.jar
>   item:
> ...
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - https://myuser:myp...@nexus.example.com/mybundle.jar
>   item:
> ...
> {noformat}
> For usernames / passwords with special characters, these need to be escaped 
> before adding to the url. For example, for username "myu...@example.com", the 
> url would be 
> {{https://myuser%40mydomain.com:myp...@nexus.example.com/mybundle.jar}}.
> For externalized config, one can use the example below:
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - $brooklyn:formatString:
> - https://%s:%s...@nexus.example.com/mybundle.jar
> - $brooklyn:external("myprovider", "username")
> - $brooklyn:external("myprovider", "password")
>   item:
> ...
> {noformat}
> However, this requires that the externalised config stores the username and 
> password in its url-escaped form (rather than as the raw password).
> It also means that the password is embedded in the url, which is potentially 
> logged or persisted.
> ---
> We could fix the first of these problems (i.e. credentials store can just 
> supply the raw username/password) by adding DSL support for 
> {{$brooklyn:escapeUrl}}. One could write something like:
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - $brooklyn:formatString:
> - https://%s:%s...@nexus.example.com/mybundle.jar
> - $brooklyn:escapeUrl:
>   - $brooklyn:external("myprovider", "username")
> - $brooklyn:escapeUrl:
>   - $brooklyn:external("myprovider", "password")
>   item:
> ...
> {noformat}
> ---
> Alternatively (as well?) we could supply the basic-auth credentials as an 
> explicit configuration option. The advantage of this is that we should be 
> able to keep it as the DSL "deferred supplier" so not persist the password.
> For example, something like the YAML below:
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - url: https://nexus.example.com/mybundle.jar
> basicAuth:
>   username: $brooklyn:external("myprovider", "username")
>   password: $brooklyn:external("myprovider", "password")
>   item:
> ...
> {noformat}
> However, this is fiddly to implement. Looking at the code path for where it 
> eventually loads the bundle over http(s):
> {noformat}
> "main" prio=5 tid=0x7fa34c002000 nid=0x1703 at 
> breakpoint[0x70217000]
>java.lang.Thread.State: RUNNABLE
> at 
> org.apache.brooklyn.util.core.ResourceUtils.getResourceViaHttp(ResourceUtils.java:420)
> at 
> org.apache.brooklyn.util.core.ResourceUtils.getResourceFromUrl(ResourceUtils.java:251)
> at 
> org.apache.brooklyn.util.core.osgi.Osgis.getUrlStream(Osgis.java:421)
> at 

[GitHub] brooklyn-server issue #551: BROOKLYN-421: Adds DSL for $brooklyn:urlEncode(....

2017-02-07 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/551
  
`URLEncoder.encode` is used for encoding form data for submission in the 
request body with a `x-www-form-urlencoded` `Content-Type`. That's different 
from URL encoding.
Here's a relevant [SO 
link](http://stackoverflow.com/questions/444112/how-do-i-encode-uri-parameter-values).
 See also the last downvoted answer.
We should deprecate `Urls.encode` and use a proper URL builder instead. 
[This](https://github.com/mikaelhg/urlbuilder) one I like for being small with 
no dependencies.


---
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 #493: Make the Repeater class use a threads to ...

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

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


---
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 #493: Make the Repeater class use a threads to execute...

2017-02-07 Thread neykov
Github user neykov commented on the issue:

https://github.com/apache/brooklyn-server/pull/493
  
Thanks for updates @grkvlt, merging.


---
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 #144: Allows for multiple deserialization class...

2017-02-07 Thread nakomis
Github user nakomis closed the pull request at:

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


---
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 #144: Allows for multiple deserialization class rename...

2017-02-07 Thread nakomis
Github user nakomis commented on the issue:

https://github.com/apache/brooklyn-server/pull/144
  
Not needed for classic, so #492 should suffice, closing


---
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 #447

2017-02-07 Thread Apache Jenkins Server
See 

Changes:

[duncan.grant] Prefer centos 7

--
[...truncated 20853 lines...]
2017-02-07 14:50:59,749 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.server.entity.BrooklynMetricsTest.setUp()
2017-02-07 14:50:59,771 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod 
org.apache.brooklyn.core.server.entity.BrooklynMetricsTest.setUp() finished in 
22 ms
2017-02-07 14:50:59,771 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.core.server.entity.BrooklynMetricsTest.testInitialBrooklynMetrics()
2017-02-07 14:50:59,773 INFO  No Camp-YAML parser registered for parsing 
catalog item DSL; skipping DSL-parsing
2017-02-07 14:50:59,774 WARN  Deprecated use of unmanaged location 
(SimulatedLocation{id=llvahljygu, name=SimulatedLocation:llva}); will be 
managed automatically now but not supported in future versions
2017-02-07 14:50:59,979 WARN  Service is not up when setting running on 
Application[aujvjyoe]; delayed 203ms but Sensor: service.isUp 
(java.lang.Boolean) did not recover from null; not-up-indicators={}
2017-02-07 14:51:00,182 WARN  Service is not up when setting running on 
Application[aujvjyoe]; delayed 203ms but Sensor: service.isUp 
(java.lang.Boolean) did not recover from null; not-up-indicators={}
2017-02-07 14:51:00,191 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.server.entity.BrooklynMetricsTest.testInitialBrooklynMetrics()
 finished in 420 ms
2017-02-07 14:51:00,192 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.server.entity.BrooklynMetricsTest.tearDown()
2017-02-07 14:51:00,196 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.server.entity.BrooklynMetricsTest.tearDown() finished 
in 4 ms
2017-02-07 14:51:00,197 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp()
2017-02-07 14:51:00,215 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp() 
finished in 18 ms
2017-02-07 14:51:00,216 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.core.sensor.SensorEventPredicatesTest.testSensorEqualTo()
2017-02-07 14:51:00,217 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.sensor.SensorEventPredicatesTest.testSensorEqualTo() 
finished in 1 ms
2017-02-07 14:51:00,217 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown()
2017-02-07 14:51:00,223 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown() finished 
in 6 ms
2017-02-07 14:51:00,223 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp()
2017-02-07 14:51:00,238 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp() 
finished in 15 ms
2017-02-07 14:51:00,239 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.core.sensor.SensorEventPredicatesTest.testSensorSatisfies()
2017-02-07 14:51:00,239 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.sensor.SensorEventPredicatesTest.testSensorSatisfies() 
finished in 0 ms
2017-02-07 14:51:00,239 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown()
2017-02-07 14:51:00,243 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown() finished 
in 4 ms
2017-02-07 14:51:00,243 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp()
2017-02-07 14:51:00,258 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp() 
finished in 15 ms
2017-02-07 14:51:00,258 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.core.sensor.SensorEventPredicatesTest.testValueEqualTo()
2017-02-07 14:51:00,259 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.sensor.SensorEventPredicatesTest.testValueEqualTo() 
finished in 1 ms
2017-02-07 14:51:00,259 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown()
2017-02-07 14:51:00,262 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown() finished 
in 3 ms
2017-02-07 14:51:00,262 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod 

[GitHub] brooklyn-server pull request #544: Prefer centos 7

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

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


---
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.
---


Google Summer of Code

2017-02-07 Thread Richard Downer
Hi all,

Do we have any projects that we'd like to put forward for GSoC 2017?

Apache has the structure and processes in place for GSoC so all we need to
do is come up with ideas!

The deadline for a list of ideas is Thursday (apologies for the short
notice, due to illness I've been away and only just got the notification).

Cheers
Richard.


[GitHub] brooklyn-server pull request #546: Sequencer entity

2017-02-07 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/546#discussion_r99815295
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/entity/stock/SequenceEntity.java ---
@@ -0,0 +1,84 @@
+/*
+ * 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.entity.stock;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.annotation.Effector;
+import org.apache.brooklyn.core.effector.MethodEffector;
+import org.apache.brooklyn.core.entity.trait.Startable;
+import org.apache.brooklyn.entity.group.SequenceGroup;
+import org.apache.brooklyn.util.core.flags.SetFromFlag;
+
+/**
+ * An entity that supplies a sequence of values through an effector.
+ * 
+ * Usage:
+ * {@code
+ * - type: org.apache.brooklyn.entity.stock.SequenceEntity
+ *   id: global-sequence
+ *   brooklyn.config:
+ * sequence.start: 0
+ * sequence.increment: 1
+ * sequence.format: "global-%03d"
+ * }
+ */
+@ImplementedBy(SequenceEntityImpl.class)
+public interface SequenceEntity extends Entity, Startable {
+
+AttributeSensor SEQUENCE_VALUE = SequenceGroup.SEQUENCE_VALUE;
+
+AttributeSensor SEQUENCE_STRING = 
SequenceGroup.SEQUENCE_STRING;
+
+@SetFromFlag("sequenceStart")
+ConfigKey SEQUENCE_START = SequenceGroup.SEQUENCE_START;
+
+@SetFromFlag("sequenceIncrement")
+ConfigKey SEQUENCE_INCREMENT = 
SequenceGroup.SEQUENCE_INCREMENT;
+
+@SetFromFlag("sequenceFormat")
+ConfigKey SEQUENCE_FORMAT = SequenceGroup.SEQUENCE_FORMAT;
+
+MethodEffector RESET = new 
MethodEffector(SequenceEntity.class, "reset");
+MethodEffector INCREMENT = new 
MethodEffector(SequenceEntity.class, "increment");
+MethodEffector CURRENT_VALUE = new 
MethodEffector(SequenceEntity.class, "currentValue");
+MethodEffector CURRENT_STRING = new 
MethodEffector(SequenceEntity.class, "currentString");
+MethodEffector NEXT_VALUE = new 
MethodEffector(SequenceEntity.class, "nextValue");
+MethodEffector NEXT_STRING = new 
MethodEffector(SequenceEntity.class, "nextString");
+
+@Effector(description = "Reset the sequence to initial value")
+Void reset();
+
+@Effector(description = "Update the value of the sequence by the 
configured increment")
+Void increment();
+
+@Effector(description = "Return the current numeric value of the 
sequence")
+Integer currentValue();
+
+@Effector(description = "Return the current string representation of 
the sequence")
+String currentString();
+
+@Effector(description = "Update and return the next numeric value of 
the sequence")
+Integer nextValue();
--- End diff --

I'd prefer we follow the naming conventions of `AtomicInteger` - so rename 
`increment` to `incrementAndGet`, and delete `nextValue` + `nextString`.

I'm inclined to let the caller do the formatting of the result, rather than 
having separate `nextValue` and `nextString`. The difference between those two 
methods, and their interaction, feels as though it might confuse.


---
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 #546: Sequencer entity

2017-02-07 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/546#discussion_r99814504
  
--- Diff: 
core/src/test/java/org/apache/brooklyn/entity/group/SequenceGroupTest.java ---
@@ -0,0 +1,165 @@
+/*
+ * 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.entity.group;
+
+import static org.apache.brooklyn.test.Asserts.assertEqualsIgnoringOrder;
+import static org.apache.brooklyn.test.Asserts.*;
+import static org.apache.brooklyn.core.entity.EntityAsserts.*;
+
+import java.util.Set;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.entity.EntityPredicates;
+import org.apache.brooklyn.core.sensor.Sensors;
+import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport;
+import org.apache.brooklyn.core.test.entity.TestApplication;
+import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+
+public class SequenceGroupTest extends BrooklynAppUnitTestSupport {
+
+private TestApplication app;
+private SequenceGroup group;
+private TestEntity e1, e2, e3;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+super.setUp();
+
+app = TestApplication.Factory.newManagedInstanceForTests();
+group = 
app.createAndManageChild(EntitySpec.create(SequenceGroup.class)
+.configure(SequenceGroup.SEQUENCE_STRING_SENSOR, 
Sensors.newStringSensor("test.sequence"))
+.configure(SequenceGroup.SEQUENCE_FORMAT, "test-%02d"));
+e1 = app.createAndManageChild(EntitySpec.create(TestEntity.class));
+e2 = app.createAndManageChild(EntitySpec.create(TestEntity.class));
+e3 = app.createAndManageChild(EntitySpec.create(TestEntity.class));
+}
+
+@AfterMethod(alwaysRun=true)
+@Override
+public void tearDown() throws Exception {
+if (app != null) Entities.destroyAll(app.getManagementContext());
+
+super.tearDown();
+}
+
+
+@Test
+public void testGroupDefaults() throws Exception {
+assertTrue(group.getMembers().isEmpty());
+}
+
+@Test
+public void testGroupWithMatchingFilterReturnsOnlyMatchingMembers() 
throws Exception {
+group.setEntityFilter(EntityPredicates.idEqualTo(e1.getId()));
+
+assertEqualsIgnoringOrder(group.getMembers(), 
ImmutableList.of(e1));
+assertAttributeEquals(e1, SequenceGroup.SEQUENCE_VALUE, 1);
+assertAttributeEquals(group, SequenceGroup.SEQUENCE_NEXT, 2);
+}
+
+@Test
+public void testGroupConfiguration() throws Exception {
+group.setEntityFilter(EntityPredicates.idEqualTo(e1.getId()));
+
+assertEqualsIgnoringOrder(group.getMembers(), 
ImmutableList.of(e1));
+assertAttributeEquals(e1, SequenceGroup.SEQUENCE_STRING, null);
+assertAttributeEquals(e1, 
Sensors.newStringSensor("test.sequence"), "test-01");
+}
+
+@Test
+public void testAlternateGroupConfiguration() throws Exception {
+AttributeSensor value = 
Sensors.newIntegerSensor("test.value");
+AttributeSensor string = 
Sensors.newStringSensor("test.string");
+group = 
app.createAndManageChild(EntitySpec.create(SequenceGroup.class)
+.configure(SequenceGroup.SEQUENCE_START, 12345)
+.configure(SequenceGroup.SEQUENCE_INCREMENT, 678)
+

[GitHub] brooklyn-server pull request #546: Sequencer entity

2017-02-07 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/546#discussion_r99813663
  
--- Diff: 
core/src/test/java/org/apache/brooklyn/entity/group/SequenceGroupTest.java ---
@@ -0,0 +1,165 @@
+/*
+ * 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.entity.group;
+
+import static org.apache.brooklyn.test.Asserts.assertEqualsIgnoringOrder;
+import static org.apache.brooklyn.test.Asserts.*;
+import static org.apache.brooklyn.core.entity.EntityAsserts.*;
+
+import java.util.Set;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.entity.EntityPredicates;
+import org.apache.brooklyn.core.sensor.Sensors;
+import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport;
+import org.apache.brooklyn.core.test.entity.TestApplication;
+import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+
+public class SequenceGroupTest extends BrooklynAppUnitTestSupport {
+
+private TestApplication app;
+private SequenceGroup group;
+private TestEntity e1, e2, e3;
+
+@BeforeMethod(alwaysRun=true)
+@Override
+public void setUp() throws Exception {
+super.setUp();
+
+app = TestApplication.Factory.newManagedInstanceForTests();
--- End diff --

super-class will have instantiated app - don't do it here, and delete the 
private field `app`. Also delete `tearDown` as that is done by super.


---
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-library pull request #88: Add missing @Override annotations and oth...

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

https://github.com/apache/brooklyn-library/pull/88


---
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-library pull request #91: Updated "hello-world-sql" example webapp ...

2017-02-07 Thread justinThompson
GitHub user justinThompson opened a pull request:

https://github.com/apache/brooklyn-library/pull/91

Updated "hello-world-sql" example webapp to support Redis

### Added Redis integration into hello-world-sql example webapp

- added Jedis dependency
- updated `available.jsp` to optionally display link to `Redis.jsp`
- added a page for the Redis chatroom

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

$ git pull https://github.com/justinThompson/brooklyn-library 
hello-world-sql-redis-webapp

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

https://github.com/apache/brooklyn-library/pull/91.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 #91


commit 8540bab993029c9b667ef8121e29dde8ad3dc999
Author: Justin Thompson 
Date:   2017-02-07T12:33:30Z

* Added Redis integration into hello-world-sql example*

- added Jedis dependency
- updated available.jsp to optionally display Redis link
- added a jsp for the Redis chatroom




---
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 #446

2017-02-07 Thread Apache Jenkins Server
See 



[GitHub] brooklyn-server pull request #549: SecurityGroupEditor- Allow for different ...

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

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


---
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-master-build #800

2017-02-07 Thread Apache Jenkins Server
See 



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

2017-02-07 Thread Apache Jenkins Server
See 

Changes:

[geoff.macartney] Add Openstack live test.

--
[...truncated 20878 lines...]
In progress, thread waiting (timed) on 
java.util.concurrent.CountDownLatch$Sync@176329df
At: 
org.apache.brooklyn.core.effector.EffectorConcatenateTest$MyEntityImpl$2.call(EffectorConcatenateTest.java:116)

org.apache.brooklyn.core.effector.EffectorConcatenateTest$MyEntityImpl$2.call(EffectorConcatenateTest.java:110)

org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529)
2017-02-07 10:51:46,235 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.testReportsSpawnedTaskDetails()
 finished in 5 ms
2017-02-07 10:51:46,235 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.tearDown()
2017-02-07 10:51:46,253 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.tearDown() finished 
in 18 ms
2017-02-07 10:51:46,254 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.effector.EffectorConcatenateTest.setUp()
2017-02-07 10:51:46,256 WARN  Deprecated use of 
Entities.startManagement(Entity), for entity Application[6rdnknfg]
2017-02-07 10:51:46,256 WARN  Deprecated invocation of startManagement for 
Application[6rdnknfg] without a management context present; a new local 
management context is being created! (Not recommended unless you really know 
what you are doing.)
2017-02-07 10:51:46,459 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.effector.EffectorConcatenateTest.setUp() 
finished in 205 ms
2017-02-07 10:51:46,459 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.testReportsTaskDetails()
2017-02-07 10:51:46,462 INFO  waitabit task says:
waitabit.blocking

waitabit extra status details

Task[waitabit]@g1y1sZxE

In progress, thread waiting (timed) on 
java.util.concurrent.CountDownLatch$Sync@6c7f495b
At: 
org.apache.brooklyn.core.effector.EffectorConcatenateTest$MyEntityImpl$1.call(EffectorConcatenateTest.java:98)

org.apache.brooklyn.core.effector.EffectorConcatenateTest$MyEntityImpl$1.call(EffectorConcatenateTest.java:94)
org.apache.brooklyn.util.core.task.Tasks.withBlockingDetails(Tasks.java:106)

org.apache.brooklyn.core.effector.EffectorConcatenateTest$MyEntityImpl.waitabit(EffectorConcatenateTest.java:94)

org.apache.brooklyn.util.groovy.GroovyJavaMethods.invokeMethodOnMetaClass(GroovyJavaMethods.java:206)

org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodLocal(AbstractManagementContext.java:318)

org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:343)

org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:276)

org.apache.brooklyn.core.effector.MethodEffector.call(MethodEffector.java:149)

org.apache.brooklyn.core.effector.AbstractEffector.call(AbstractEffector.java:61)

org.apache.brooklyn.core.effector.AbstractEffector$1$1.call(AbstractEffector.java:83)

org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:360)

org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529)
2017-02-07 10:51:46,463 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.testReportsTaskDetails()
 finished in 4 ms
2017-02-07 10:51:46,464 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.tearDown()
2017-02-07 10:51:46,483 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.effector.EffectorConcatenateTest.tearDown() finished 
in 20 ms
2017-02-07 10:51:46,483 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp()
2017-02-07 10:51:46,498 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@BeforeMethod org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport.setUp() 
finished in 15 ms
2017-02-07 10:51:46,498 INFO  TESTNG INVOKING: "Surefire test" - 
org.apache.brooklyn.core.effector.ProxyEffectorTest.testHappyPath()
2017-02-07 10:51:46,529 INFO  TESTNG PASSED: "Surefire test" - 
org.apache.brooklyn.core.effector.ProxyEffectorTest.testHappyPath() finished in 
31 ms
2017-02-07 10:51:46,529 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - 
@AfterMethod 
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown()
2017-02-07 10:51:46,537 INFO  TESTNG PASSED CONFIGURATION: "Surefire test" - 
@AfterMethod 

[GitHub] brooklyn-server issue #144: Allows for multiple deserialization class rename...

2017-02-07 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-server/pull/144
  
Hey @nakomis, overloading the class deserialisation has been addressed in 
#492 but for **karaf edition** only. Do you also need it for the classic 
edition? In this case, could you rebase on the latest master + add 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.
---


Build failed in Jenkins: brooklyn-master-build #799

2017-02-07 Thread Apache Jenkins Server
See 

--
[...truncated 56077 lines...]
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-launcher-common/0.11.0-SNAPSHOT/brooklyn-launcher-common-0.11.0-SNAPSHOT-tests.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-launcher-common/0.11.0-SNAPSHOT/brooklyn-launcher-common-0.11.0-SNAPSHOT-sources.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-launcher-common/0.11.0-SNAPSHOT/brooklyn-launcher-common-0.11.0-SNAPSHOT-test-sources.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-examples-webapps-parent/0.11.0-SNAPSHOT/brooklyn-examples-webapps-parent-0.11.0-SNAPSHOT.pom
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-example-simple-web-cluster/0.11.0-SNAPSHOT/brooklyn-example-simple-web-cluster-0.11.0-SNAPSHOT.pom
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-example-simple-web-cluster/0.11.0-SNAPSHOT/brooklyn-example-simple-web-cluster-0.11.0-SNAPSHOT.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-example-simple-web-cluster/0.11.0-SNAPSHOT/brooklyn-example-simple-web-cluster-0.11.0-SNAPSHOT-tests.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-example-simple-web-cluster/0.11.0-SNAPSHOT/brooklyn-example-simple-web-cluster-0.11.0-SNAPSHOT-sources.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-example-simple-web-cluster/0.11.0-SNAPSHOT/brooklyn-example-simple-web-cluster-0.11.0-SNAPSHOT-test-sources.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-itest/0.11.0-SNAPSHOT/brooklyn-itest-0.11.0-SNAPSHOT.pom
[JENKINS] Archiving 

 to 
org.apache.brooklyn.example/brooklyn-examples-parent/0.11.0-SNAPSHOT/brooklyn-examples-parent-0.11.0-SNAPSHOT.pom
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT.pom
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT-tests.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT-dist.tar.gz
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT-dist.zip
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT-sources.jar
[JENKINS] Archiving 

 to 
org.apache.brooklyn/brooklyn-dist/0.11.0-SNAPSHOT/brooklyn-dist-0.11.0-SNAPSHOT-test-sources.jar
Compressed 119.76 MB of 

[GitHub] brooklyn-server pull request #550: Add Openstack live test.

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

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


---
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 #549: SecurityGroupEditor- Allow for different jclouds...

2017-02-07 Thread geomacy
Github user geomacy commented on the issue:

https://github.com/apache/brooklyn-server/pull/549
  
changes made as suggested thanks @neykov, and squashed 


---
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 #542: Resolve deferred values in containers (li...

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

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


---
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 #542: Resolve deferred values in containers (list, map...

2017-02-07 Thread drigodwin
Github user drigodwin commented on the issue:

https://github.com/apache/brooklyn-server/pull/542
  
LGTM, thanks @neykov 


---
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.
---


[jira] [Commented] (BROOKLYN-421) Catalog libraries: externalized config for basic-auth credentials in url (via YAML)

2017-02-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15855643#comment-15855643
 ] 

ASF GitHub Bot commented on BROOKLYN-421:
-

Github user asfgit closed the pull request at:

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


> Catalog libraries: externalized config for basic-auth credentials in url (via 
> YAML)
> ---
>
> Key: BROOKLYN-421
> URL: https://issues.apache.org/jira/browse/BROOKLYN-421
> Project: Brooklyn
>  Issue Type: Bug
>Affects Versions: 0.10.0
>Reporter: Aled Sage
>
> A customer wants to use YAML catalog items, where the library bundles are 
> retrieved from their Nexus repo using basic-auth. They want the nexus 
> credentials to be stored in an externalized credential store. They want the 
> credentials to be able to contain special characters (e.g. "@") that are not 
> valid in a URL.
> Building up to this, here is what we currently support...
> Either of the catalog items below is valid (i.e. the credentials can be 
> encoded in the url; the library can be supplied either as a string or as a 
> map (where the map currently takes keys of "url", "name" and "version")):
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - url: https://myuser:myp...@nexus.example.com/mybundle.jar
>   item:
> ...
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - https://myuser:myp...@nexus.example.com/mybundle.jar
>   item:
> ...
> {noformat}
> For usernames / passwords with special characters, these need to be escaped 
> before adding to the url. For example, for username "myu...@example.com", the 
> url would be 
> {{https://myuser%40mydomain.com:myp...@nexus.example.com/mybundle.jar}}.
> For externalized config, one can use the example below:
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - $brooklyn:formatString:
> - https://%s:%s...@nexus.example.com/mybundle.jar
> - $brooklyn:external("myprovider", "username")
> - $brooklyn:external("myprovider", "password")
>   item:
> ...
> {noformat}
> However, this requires that the externalised config stores the username and 
> password in its url-escaped form (rather than as the raw password).
> It also means that the password is embedded in the url, which is potentially 
> logged or persisted.
> ---
> We could fix the first of these problems (i.e. credentials store can just 
> supply the raw username/password) by adding DSL support for 
> {{$brooklyn:escapeUrl}}. One could write something like:
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - $brooklyn:formatString:
> - https://%s:%s...@nexus.example.com/mybundle.jar
> - $brooklyn:escapeUrl:
>   - $brooklyn:external("myprovider", "username")
> - $brooklyn:escapeUrl:
>   - $brooklyn:external("myprovider", "password")
>   item:
> ...
> {noformat}
> ---
> Alternatively (as well?) we could supply the basic-auth credentials as an 
> explicit configuration option. The advantage of this is that we should be 
> able to keep it as the DSL "deferred supplier" so not persist the password.
> For example, something like the YAML below:
> {noformat}
> brooklyn.catalog:
>   id: simple-example
>   version: "1.0"
>   itemType: template
>   libraries:
>   - url: https://nexus.example.com/mybundle.jar
> basicAuth:
>   username: $brooklyn:external("myprovider", "username")
>   password: $brooklyn:external("myprovider", "password")
>   item:
> ...
> {noformat}
> However, this is fiddly to implement. Looking at the code path for where it 
> eventually loads the bundle over http(s):
> {noformat}
> "main" prio=5 tid=0x7fa34c002000 nid=0x1703 at 
> breakpoint[0x70217000]
>java.lang.Thread.State: RUNNABLE
> at 
> org.apache.brooklyn.util.core.ResourceUtils.getResourceViaHttp(ResourceUtils.java:420)
> at 
> org.apache.brooklyn.util.core.ResourceUtils.getResourceFromUrl(ResourceUtils.java:251)
> at 
> org.apache.brooklyn.util.core.osgi.Osgis.getUrlStream(Osgis.java:421)
> at org.apache.brooklyn.util.core.osgi.Osgis.cacheFile(Osgis.java:369)
> at org.apache.brooklyn.util.core.osgi.Osgis.install(Osgis.java:342)
> at 
> org.apache.brooklyn.core.mgmt.ha.OsgiManager.registerBundle(OsgiManager.java:122)
> at 
> org.apache.brooklyn.core.catalog.internal.CatalogUtils.installLibraries(CatalogUtils.java:160)
> at 
> org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog.collectCatalogItems(BasicBrooklynCatalog.java:494)
> at 
> 

[GitHub] brooklyn-server pull request #551: BROOKLYN-421: Adds DSL for $brooklyn:urlE...

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

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


---
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.
---