You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2022/02/10 11:23:35 UTC

[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1299: member.locations support in GroupsChangePolicy

ahgittin commented on a change in pull request #1299:
URL: https://github.com/apache/brooklyn-server/pull/1299#discussion_r803572693



##########
File path: camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/policy/GroupsChangePolicyOsgiTest.java
##########
@@ -0,0 +1,472 @@
+/*
+ * 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.policy;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+import org.apache.brooklyn.api.effector.Effector;
+import org.apache.brooklyn.api.entity.Entity;
+import org.apache.brooklyn.api.entity.EntityLocal;
+import org.apache.brooklyn.api.mgmt.TaskAdaptable;
+import org.apache.brooklyn.camp.brooklyn.AbstractYamlTest;
+import org.apache.brooklyn.core.effector.CompositeEffector;
+import org.apache.brooklyn.core.effector.EffectorBody;
+import org.apache.brooklyn.core.effector.Effectors;
+import org.apache.brooklyn.core.entity.*;
+import org.apache.brooklyn.core.objs.AdjunctType;
+import org.apache.brooklyn.core.sensor.Sensors;
+import org.apache.brooklyn.core.sensor.StaticSensor;
+import org.apache.brooklyn.core.sensor.password.CreatePasswordSensor;
+import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.apache.brooklyn.enricher.stock.Transformer;
+import org.apache.brooklyn.entity.group.DynamicGroup;
+import org.apache.brooklyn.entity.group.GroupsChangePolicy;
+import org.apache.brooklyn.location.ssh.SshMachineLocation;
+import org.apache.brooklyn.policy.InvokeEffectorOnSensorChange;
+import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import java.io.Serializable;
+import java.util.Objects;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import static org.apache.brooklyn.test.Asserts.*;
+
+/**
+ *  Tests for adding {@link GroupsChangePolicy#INITIALIZERS}, {@link GroupsChangePolicy#LOCATIONS},
+ *  {@link GroupsChangePolicy#ENRICHERS} and {@link GroupsChangePolicy#POLICIES} to members once joined. Config keys and
+ *  attributes are expected to be resolved in the member context in all cases.
+ */
+public class GroupsChangePolicyOsgiTest extends AbstractYamlTest {
+
+    private ExecutorService executor;
+
+    @Override
+    @BeforeMethod(alwaysRun=true)
+    public void setUp() throws Exception {
+        super.setUp();
+        executor = Executors.newCachedThreadPool();
+    }
+
+
+    @AfterMethod(alwaysRun = true)
+    @Override
+    public void tearDown() throws Exception {
+        super.tearDown();
+        if (executor != null) executor.shutdownNow();
+    }
+
+    @Override
+    protected boolean disableOsgi() {
+        return false; // enable OSGI

Review comment:
       do we need this?  osgi tests are slower to set up and run so if not needed remove this bit (and rename the class)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org