You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2022/07/18 16:07:31 UTC
[brooklyn-server] 01/04: new test
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit fea1b60ac9ec76435376d7f55bf980e2b3f12d79
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Mon Jul 18 17:03:48 2022 +0100
new test
saw some weirdness resolving this syntax at root; seems to have gone away, i think my container might have been in a weird state, but something to watch
---
.../brooklyn/camp/brooklyn/EnrichersYamlTest.java | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java
index c50ad3c08f..37c04fb571 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/EnrichersYamlTest.java
@@ -283,7 +283,27 @@ public class EnrichersYamlTest extends AbstractYamlTest {
((TestEntity)childEntity).sensors().set(TestEntity.NAME, "New Name");
Asserts.eventually(Entities.attributeSupplier(parentEntity, TestEntity.NAME), Predicates.<String>equalTo("New Name"));
}
-
+
+ @Test
+ public void testPropogateChildSensorAtRoot() throws Exception {
+ Entity app = createAndStartApplication(loadYaml("test-entity-basic-template.yaml",
+ " id: c1",
+ "brooklyn.enrichers:",
+ " - type: org.apache.brooklyn.enricher.stock.Propagator",
+ " brooklyn.config:",
+ " enricher.producer: $brooklyn:component(\"c1\")",
+ " enricher.propagating.inclusions: [ main.uri ]"));
+ waitForApplicationTasks(app);
+
+ log.info("App started:");
+ Dumper.dumpInfo(app);
+ Assert.assertEquals(app.getChildren().size(), 1);
+ final Entity c1 = app.getChildren().iterator().next();
+ AttributeSensor<String> mainUri = Sensors.newSensor(String.class, "main.uri");
+ c1.sensors().set(mainUri, "http://foo/");
+ EntityAsserts.assertAttributeEqualsEventually(app, mainUri, "http://foo/");
+ }
+
@Test
public void testMultipleEnricherReferences() throws Exception {
final Entity app = createAndStartApplication(loadYaml("test-referencing-enrichers.yaml"));