brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/5] incubator-brooklyn git commit: Username can be omitted if it is longer than the rules defined in BasicCloudMachineNamer()
Date Fri, 28 Aug 2015 10:56:51 GMT
Username can be omitted if it is longer than the rules defined in
  BasicCloudMachineNamer()

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

Branch: refs/heads/master
Commit: ed18f7c76adebf43dd98f08ba52febd46ff8940d
Parents: cdcce8c
Author: Yavor Yanchev <yavor@yanchev.com>
Authored: Wed Aug 26 19:19:05 2015 +0300
Committer: Yavor Yanchev <yavor@yanchev.com>
Committed: Thu Aug 27 15:49:00 2015 +0300

----------------------------------------------------------------------
 .../location/jclouds/JcloudsMachineNamerTest.java      | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ed18f7c7/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsMachineNamerTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsMachineNamerTest.java
b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsMachineNamerTest.java
index 515f10d..8c796fa 100644
--- a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsMachineNamerTest.java
+++ b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsMachineNamerTest.java
@@ -42,10 +42,15 @@ public class JcloudsMachineNamerTest {
         // br-<code>-<user>-myco-1234
         Assert.assertTrue(result.length() <= 24-4-1, "result: "+result);
         
-        String user = Strings.maxlen(System.getProperty("user.name"), 2).toLowerCase();
-        // (length 2 will happen if user is brooklyn, to avoid brooklyn-brooklyn at start!)
-        Assert.assertTrue(result.indexOf(user) >= 0);
+        String user = System.getProperty("user.name");
+        String userExt = Strings.maxlen(user, 2).toLowerCase();
+        
+        // Username can be omitted if it is longer than the rules defined in BasicCloudMachineNamer()
+        if (user.length() <= 4) { 
+            // (length 2 will happen if user is brooklyn, to avoid brooklyn-brooklyn at start!)
+            Assert.assertTrue(result.indexOf(userExt) >= 0);
+        }
         Assert.assertTrue(result.indexOf("-myc") >= 0);
     }
     
-}
+}
\ No newline at end of file


Mime
View raw message