You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by aledsage <gi...@git.apache.org> on 2016/06/14 17:17:23 UTC
[GitHub] brooklyn-server pull request #200: Move DEFAULT_DISPLAY_NAME from app to ent...
GitHub user aledsage opened a pull request:
https://github.com/apache/brooklyn-server/pull/200
Move DEFAULT_DISPLAY_NAME from app to entity
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aledsage/brooklyn-server entity-default_display_name
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/200.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 #200
----
commit 4c177bf30deddacfdb3db5bf19fa2870d817725a
Author: Aled Sage <al...@gmail.com>
Date: 2016-06-14T17:16:42Z
Move DEFAULT_DISPLAY_NAME from app to entity
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server issue #200: Move DEFAULT_DISPLAY_NAME from app to entity
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the issue:
https://github.com/apache/brooklyn-server/pull/200
Compilation of Brooklyn core fails after pulling this:
```
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/sam/code/brooklyn.io/brooklyn/brooklyn-server/core/src/test/java/org/apache/brooklyn/core/entity/EntityNameTest.java:[65,40] error: incompatible types: Entity cannot be converted to TestEntity
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.458 s
[INFO] Finished at: 2016-06-15T16:21:26+01:00
[INFO] Final Memory: 26M/686M
[INFO] ------------------------------------------------------------------------
```
Line in question:
```java
public void testDefaultDisplayNameUsesDeferredSupplier() {
TestEntity entity = app.addChild(EntitySpec.create(TestEntity.class)
```
Tried both Oracle JDK 1.7 and 1.8.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server pull request #200: Move DEFAULT_DISPLAY_NAME from app to ent...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/200#discussion_r67162187
--- Diff: camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntityNameYamlTest.java ---
@@ -0,0 +1,90 @@
+/*
+ * 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.camp.brooklyn;
+
+import static org.testng.Assert.assertEquals;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+
+@Test
+public class EntityNameYamlTest extends AbstractYamlTest {
+ private static final Logger log = LoggerFactory.getLogger(EntityNameYamlTest.class);
+
+ @Test
+ public void testExplicitDisplayName() throws Exception {
+ String yaml = Joiner.on("\n").join(
+ "services:",
+ "- type: org.apache.brooklyn.core.test.entity.TestEntity",
+ " name: myDisplayName");
+ deployAndAssertDisplayName(yaml, "myDisplayName");
+ }
+
+ @Test
+ public void testExplicitDefaultDisplayName() throws Exception {
+ String yaml = Joiner.on("\n").join(
+ "services:",
+ "- type: org.apache.brooklyn.core.test.entity.TestEntity",
+ " brooklyn.config:",
+ " defaultDisplayName: myDefaultName");
+ deployAndAssertDisplayName(yaml, "myDefaultName");
+ }
+
+ @Test
+ public void testExplicitDefaultDisplayNameReferrencingConfig() throws Exception {
+ String yaml = Joiner.on("\n").join(
+ "services:",
+ "- type: org.apache.brooklyn.core.test.entity.TestEntity",
+ " brooklyn.config:",
+ " myconf: myval",
+ " defaultDisplayName:",
+ " $brooklyn:formatString:",
+ " - \"PREFIX%sSUFFIX\"",
+ " - $brooklyn:config(\"myconf\")");
+ deployAndAssertDisplayName(yaml, "PREFIXmyvalSUFFIX");
+ }
+
+ @Test
+ public void testBrooklynConfig() throws Exception {
--- End diff --
Good point @geomacy - I'll delete this duplicate 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server issue #200: Move DEFAULT_DISPLAY_NAME from app to entity
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the issue:
https://github.com/apache/brooklyn-server/pull/200
Build failure looks like it's caused by infrastructure problems:
```
Modules changed, recalculating dependency graph
Build timed out (after 60 minutes). Marking the build as aborted.
Build was aborted
Putting comment on the pull request
Finished: ABORTED
```
I've done a `git commit --amend && push -f` to try to trigger another jenkins build.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server issue #200: Move DEFAULT_DISPLAY_NAME from app to entity
Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:
https://github.com/apache/brooklyn-server/pull/200
Thanks for pointing out @sjcorbett. Fixed in https://github.com/apache/brooklyn-server/commit/3bb69b6080fbde17279753ba562f4a5008bbd0f6.
The Eclipse compiler is too smart sometimes, especially around generics and losing type info, able to figure out things which leave the java compiler wondering.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server issue #200: Move DEFAULT_DISPLAY_NAME from app to entity
Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:
https://github.com/apache/brooklyn-server/pull/200
Looks like jenkins gave up on this PR entirely. 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server pull request #200: Move DEFAULT_DISPLAY_NAME from app to ent...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/brooklyn-server/pull/200
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] brooklyn-server pull request #200: Move DEFAULT_DISPLAY_NAME from app to ent...
Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/200#discussion_r67148906
--- Diff: camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EntityNameYamlTest.java ---
@@ -0,0 +1,90 @@
+/*
+ * 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.camp.brooklyn;
+
+import static org.testng.Assert.assertEquals;
+
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+
+@Test
+public class EntityNameYamlTest extends AbstractYamlTest {
+ private static final Logger log = LoggerFactory.getLogger(EntityNameYamlTest.class);
+
+ @Test
+ public void testExplicitDisplayName() throws Exception {
+ String yaml = Joiner.on("\n").join(
+ "services:",
+ "- type: org.apache.brooklyn.core.test.entity.TestEntity",
+ " name: myDisplayName");
+ deployAndAssertDisplayName(yaml, "myDisplayName");
+ }
+
+ @Test
+ public void testExplicitDefaultDisplayName() throws Exception {
+ String yaml = Joiner.on("\n").join(
+ "services:",
+ "- type: org.apache.brooklyn.core.test.entity.TestEntity",
+ " brooklyn.config:",
+ " defaultDisplayName: myDefaultName");
+ deployAndAssertDisplayName(yaml, "myDefaultName");
+ }
+
+ @Test
+ public void testExplicitDefaultDisplayNameReferrencingConfig() throws Exception {
+ String yaml = Joiner.on("\n").join(
+ "services:",
+ "- type: org.apache.brooklyn.core.test.entity.TestEntity",
+ " brooklyn.config:",
+ " myconf: myval",
+ " defaultDisplayName:",
+ " $brooklyn:formatString:",
+ " - \"PREFIX%sSUFFIX\"",
+ " - $brooklyn:config(\"myconf\")");
+ deployAndAssertDisplayName(yaml, "PREFIXmyvalSUFFIX");
+ }
+
+ @Test
+ public void testBrooklynConfig() throws Exception {
--- End diff --
I know it's a bit late commenting after a merge, but what's different about this test than `testExplicitDisplayName` above? Did you mean to update this to refer to Brooklyn property config in some way?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---