brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [28/50] [abbrv] brooklyn-server git commit: Adjusting the test to take into account the new length
Date Mon, 01 Feb 2016 17:50:44 GMT
Adjusting the test to take into account the new length

Name max length is set to 9, because the constructed name will look
  like "br-ntsb50"
  br - 2 chars
  dash (-) - 1 char
  timeStamp - 6 chars

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

Branch: refs/heads/0.8.0-incubating
Commit: 77768c07200da102df0416f115d7e4673d6f74c9
Parents: 2a0639a
Author: Yavor Yanchev <yavor@yanchev.com>
Authored: Fri Aug 28 12:07:24 2015 +0300
Committer: Yavor Yanchev <yavor@yanchev.com>
Committed: Fri Aug 28 12:07:24 2015 +0300

----------------------------------------------------------------------
 .../brooklyn/core/location/cloud/CloudMachineNamerTest.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/77768c07/core/src/test/java/org/apache/brooklyn/core/location/cloud/CloudMachineNamerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/location/cloud/CloudMachineNamerTest.java
b/core/src/test/java/org/apache/brooklyn/core/location/cloud/CloudMachineNamerTest.java
index 4ebaaec..0759114 100644
--- a/core/src/test/java/org/apache/brooklyn/core/location/cloud/CloudMachineNamerTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/location/cloud/CloudMachineNamerTest.java
@@ -113,9 +113,13 @@ public class CloudMachineNamerTest {
         ConfigBag cfg = new ConfigBag()
             .configure(CloudLocationConfig.CALLER_CONTEXT, child);
         BasicCloudMachineNamer namer = new BasicCloudMachineNamer();
-        namer.setDefaultMachineNameMaxLength(10);
+        // name max length is set to 9, because the constructed name will look like "br-ntsb50"
+        // br - 2 chars
+        // dash (-) - 1 char
+        // timeStamp - 6 chars
+        namer.setDefaultMachineNameMaxLength(2 + 1 + 6);
         String result = namer.generateNewMachineUniqueName(cfg);
-        Assert.assertEquals(result.length(), 10);
+        Assert.assertEquals(result.length(), 2 + 1 + 6);
     }
     
     @Test


Mime
View raw message