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/01/05 18:55:05 UTC
[GitHub] incubator-brooklyn pull request: Test correct persistence of attri...
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1120#discussion_r48873785
--- Diff: brooklyn-server/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java ---
@@ -19,58 +19,82 @@
package org.apache.brooklyn.camp.brooklyn;
import java.io.File;
+import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.brooklyn.api.entity.Application;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.api.mgmt.ha.MementoCopyMode;
+import org.apache.brooklyn.api.mgmt.rebind.mementos.BrooklynMementoRawData;
import org.apache.brooklyn.api.sensor.AttributeSensor;
import org.apache.brooklyn.api.sensor.Sensor;
+import org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier;
import org.apache.brooklyn.config.ConfigKey;
import org.apache.brooklyn.core.config.ConfigKeys;
import org.apache.brooklyn.core.entity.Attributes;
import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.entity.EntityAsserts;
import org.apache.brooklyn.core.entity.EntityInternal;
import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
+import org.apache.brooklyn.core.mgmt.persist.BrooklynPersistenceUtils;
import org.apache.brooklyn.core.mgmt.rebind.RebindTestUtils;
import org.apache.brooklyn.core.sensor.Sensors;
import org.apache.brooklyn.core.test.entity.TestEntity;
-import org.apache.brooklyn.test.EntityTestUtils;
+import org.apache.brooklyn.entity.group.DynamicCluster;
import org.apache.brooklyn.util.collections.MutableSet;
import org.apache.brooklyn.util.core.task.Tasks;
+import org.apache.brooklyn.util.guava.Maybe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
import com.google.common.io.Files;
@Test
public class DslAndRebindYamlTest extends AbstractYamlTest {
-
+
private static final Logger log = LoggerFactory.getLogger(DslAndRebindYamlTest.class);
-
+
protected ClassLoader classLoader = getClass().getClassLoader();
protected File mementoDir;
protected Set<ManagementContext> mgmtContexts = MutableSet.of();
+ protected ExecutorService executor;
@Override
protected LocalManagementContext newTestManagementContext() {
- if (mementoDir!=null) throw new IllegalStateException("already created mgmt context");
+ if (mementoDir != null) throw new IllegalStateException("already created mgmt context");
mementoDir = Files.createTempDir();
mementoDir.deleteOnExit();
LocalManagementContext mgmt = RebindTestUtils.newPersistingManagementContext(mementoDir, classLoader, 1);
mgmtContexts.add(mgmt);
return mgmt;
}
+
+ @BeforeMethod(alwaysRun = true)
+ @Override
+ public void setUp() {
+ super.setUp();
--- End diff --
Are these tabs? Or 3 spaces? Can you change them to 4 spaces 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---