brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/4] brooklyn-server git commit: Fix broken test for preRelease/postRelease
Date Thu, 26 Jan 2017 09:43:44 GMT
Fix broken test for preRelease/postRelease


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/588ef4b9
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/588ef4b9
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/588ef4b9

Branch: refs/heads/master
Commit: 588ef4b97789770cb2fa5c48b267b35cedcc8ae3
Parents: 6fef914
Author: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Authored: Thu Jan 19 17:28:31 2017 +0000
Committer: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Committed: Wed Jan 25 15:46:35 2017 +0000

----------------------------------------------------------------------
 .../JcloudsCustomizerInstantiationYamlDslTest.java        |  9 ++++++---
 .../apache/brooklyn/location/jclouds/JcloudsLocation.java | 10 +++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/588ef4b9/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsCustomizerInstantiationYamlDslTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsCustomizerInstantiationYamlDslTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsCustomizerInstantiationYamlDslTest.java
index f97065d..1c6df9f 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsCustomizerInstantiationYamlDslTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsCustomizerInstantiationYamlDslTest.java
@@ -22,6 +22,7 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertSame;
 import static org.testng.Assert.assertTrue;
 
+import java.util.Arrays;
 import java.util.List;
 
 import com.google.common.collect.ImmutableList;
@@ -89,7 +90,7 @@ public class JcloudsCustomizerInstantiationYamlDslTest extends AbstractJcloudsSt
         }
     }
     
-    @Test(groups = "Broken")
+    @Test
     public void testCustomizers() throws Exception {
         String yaml = Joiner.on("\n").join(
                 "location: " + LOCATION_CATALOG_ID,
@@ -132,10 +133,12 @@ public class JcloudsCustomizerInstantiationYamlDslTest extends AbstractJcloudsSt
     }
 
     private void assertCallsMade(String ...values) {
-        List<String> expected = ImmutableList.copyOf(values);
+        List<String> expected = MutableList.of();
+        expected.addAll(Arrays.asList(values));
         for (RecordingLocationCustomizer.CallParams parm : RecordingLocationCustomizer.calls)
{
-            assertTrue(expected.contains(parm.method));
+            assertTrue(expected.remove(parm.method));
         }
+        assertEquals(expected.size(), 0);
     }
 
     public static class RecordingLocationCustomizer extends BasicJcloudsLocationCustomizer
{

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/588ef4b9/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 200b0e5..7549f6a 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -72,6 +72,7 @@ import org.apache.brooklyn.core.location.cloud.AbstractCloudMachineProvisioningL
 import org.apache.brooklyn.core.location.cloud.AvailabilityZoneExtension;
 import org.apache.brooklyn.core.location.cloud.names.AbstractCloudMachineNamer;
 import org.apache.brooklyn.core.location.cloud.names.CloudMachineNamer;
+import org.apache.brooklyn.core.location.internal.LocationInternal;
 import org.apache.brooklyn.core.mgmt.internal.LocalLocationManager;
 import org.apache.brooklyn.core.mgmt.persist.LocationWithObjectStore;
 import org.apache.brooklyn.core.mgmt.persist.PersistenceObjectStore;
@@ -1058,6 +1059,13 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
                     + " and os customized in "+Duration.of(customizedTimestamp).subtract(usableTimestamp).toStringRounded()+"
- "+Joiner.on(", ").join(customisationForLogging)+")";
             LOG.info(logMessage);
 
+            if (customizers.size() > 0) {
+                machineLocation.config().set(JCLOUDS_LOCATION_CUSTOMIZERS, customizers);
+            }
+            if (machineCustomizers.size() > 0) {
+                machineLocation.config().set(MACHINE_LOCATION_CUSTOMIZERS, machineCustomizers);
+            }
+
             return machineLocation;
 
         } catch (Exception e) {
@@ -2221,7 +2229,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
 
         Exception tothrow = null;
 
-        ConfigBag setup = config().getBag();
+        ConfigBag setup = ((LocationInternal)machine).config().getBag();
         Collection<JcloudsLocationCustomizer> customizers = getCustomizers(setup);
         Collection<MachineLocationCustomizer> machineCustomizers = getMachineCustomizers(setup);
         


Mime
View raw message