brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] incubator-brooklyn git commit: Fix tests on Windows
Date Wed, 03 Jun 2015 16:25:35 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master d84630eee -> ba280a179


Fix tests on Windows


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/74d87885
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/74d87885
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/74d87885

Branch: refs/heads/master
Commit: 74d878851f3b0e1c89180789114a793e57d5b3cc
Parents: 5dd08aa
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Wed Jun 3 17:18:24 2015 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Wed Jun 3 17:18:24 2015 +0300

----------------------------------------------------------------------
 .../brooklyn/entity/rebind/PeriodicDeltaChangeListener.java    | 4 +++-
 .../java/brooklyn/location/basic/LocationConfigUtilsTest.java  | 6 ++++--
 usage/cli/src/test/java/brooklyn/cli/CliTest.java              | 3 ++-
 .../src/test/java/brooklyn/launcher/BrooklynWebServerTest.java | 3 ++-
 4 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/74d87885/core/src/main/java/brooklyn/entity/rebind/PeriodicDeltaChangeListener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/rebind/PeriodicDeltaChangeListener.java b/core/src/main/java/brooklyn/entity/rebind/PeriodicDeltaChangeListener.java
index 4203b4b..2c3271d 100644
--- a/core/src/main/java/brooklyn/entity/rebind/PeriodicDeltaChangeListener.java
+++ b/core/src/main/java/brooklyn/entity/rebind/PeriodicDeltaChangeListener.java
@@ -278,7 +278,9 @@ public class PeriodicDeltaChangeListener implements ChangeListener {
                 while (writeCount.get() <= targetWriteCount) {
                     Duration left = timer.getDurationRemaining();
                     if (left.isPositive()) {
-                        writeCount.wait(left.lowerBound(Duration.millis(10)).toMilliseconds());
+                        synchronized(writeCount) {
+                            writeCount.wait(left.lowerBound(Duration.millis(10)).toMilliseconds());
+                        }
                     } else {
                         throw new TimeoutException("Timeout waiting for independent write
of rebind-periodic-delta, after "+timer.getDurationElapsed());
                     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/74d87885/core/src/test/java/brooklyn/location/basic/LocationConfigUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/location/basic/LocationConfigUtilsTest.java b/core/src/test/java/brooklyn/location/basic/LocationConfigUtilsTest.java
index 1d1ad06..ba580eb 100644
--- a/core/src/test/java/brooklyn/location/basic/LocationConfigUtilsTest.java
+++ b/core/src/test/java/brooklyn/location/basic/LocationConfigUtilsTest.java
@@ -21,6 +21,8 @@ package brooklyn.location.basic;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
 
+import java.io.File;
+
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -120,7 +122,7 @@ public class LocationConfigUtilsTest {
     
     public void testReadsPrivateKeyFileWithMultipleColonSeparatedFilesWithGoodLast() throws
Exception {
         ConfigBag config = ConfigBag.newInstance();
-        config.put(LocationConfigKeys.PRIVATE_KEY_FILE, "/path/does/not/exist:"+SSH_PRIVATE_KEY_FILE);
+        config.put(LocationConfigKeys.PRIVATE_KEY_FILE, "/path/does/not/exist"+File.pathSeparator+SSH_PRIVATE_KEY_FILE);
         
         String data = LocationConfigUtils.getOsCredential(config).getPreferredCredential();
         assertTrue(data != null && data.length() > 0);
@@ -128,7 +130,7 @@ public class LocationConfigUtilsTest {
     
     public void testReadsPrivateKeyFileWithMultipleColonSeparatedFilesWithGoodFirst() throws
Exception {
         ConfigBag config = ConfigBag.newInstance();
-        config.put(LocationConfigKeys.PRIVATE_KEY_FILE, SSH_PRIVATE_KEY_FILE+":/path/does/not/exist");
+        config.put(LocationConfigKeys.PRIVATE_KEY_FILE, SSH_PRIVATE_KEY_FILE+File.pathSeparator+"/path/does/not/exist");
 
         String data = LocationConfigUtils.getOsCredential(config).getPreferredCredential();
         assertTrue(data != null && data.length() > 0);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/74d87885/usage/cli/src/test/java/brooklyn/cli/CliTest.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/test/java/brooklyn/cli/CliTest.java b/usage/cli/src/test/java/brooklyn/cli/CliTest.java
index a50b058..a6c6b13 100644
--- a/usage/cli/src/test/java/brooklyn/cli/CliTest.java
+++ b/usage/cli/src/test/java/brooklyn/cli/CliTest.java
@@ -40,6 +40,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Pattern;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -525,7 +526,7 @@ public class CliTest {
                 throw new ExecutionException(exception.get());
             }
             
-            return ImmutableList.copyOf(Splitter.on("\n").split(new String(stdoutBytes.toByteArray())));
+            return ImmutableList.copyOf(Splitter.on(Pattern.compile("\r?\n")).split(new String(stdoutBytes.toByteArray())));
         } finally {
             System.setIn(origIn);
             System.setOut(origOut);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/74d87885/usage/launcher/src/test/java/brooklyn/launcher/BrooklynWebServerTest.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/java/brooklyn/launcher/BrooklynWebServerTest.java b/usage/launcher/src/test/java/brooklyn/launcher/BrooklynWebServerTest.java
index 8a688c8..b40a023 100644
--- a/usage/launcher/src/test/java/brooklyn/launcher/BrooklynWebServerTest.java
+++ b/usage/launcher/src/test/java/brooklyn/launcher/BrooklynWebServerTest.java
@@ -188,9 +188,10 @@ public class BrooklynWebServerTest {
     
     @Test
     public void testGetFileFromUrl() throws Exception {
+        // On Windows will treat as relative paths
         String url = "file:///tmp/special%40file%20with%20spaces";
         String file = "/tmp/special@file with spaces";
-        assertEquals(getFile(new URL(url)), file);
+        assertEquals(getFile(new URL(url)), new File(file).getAbsolutePath());
     }
 
     private String getFile(String classpathResource) {


Mime
View raw message