ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [39/50] incubator-ignite git commit: # Improve generation of node ID for test nodes.
Date Thu, 23 Apr 2015 06:05:38 GMT
# Improve generation of node ID for test nodes.


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

Branch: refs/heads/ignite-80
Commit: 702f1721a5b3e50089bb6183bda0ba00094ca729
Parents: 4e7a691
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed Apr 22 11:48:06 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed Apr 22 11:48:06 2015 +0300

----------------------------------------------------------------------
 .../testframework/junits/GridAbstractTest.java       | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/702f1721/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index a6ada3d..d5c0d44 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -985,6 +985,21 @@ public abstract class GridAbstractTest extends TestCase {
 
         cfg.setNodeId(null);
 
+        if (gridName.matches(".*\\d")) {
+            String idStr = UUID.randomUUID().toString();
+
+            char[] chars = idStr.toCharArray();
+
+            chars[0] = gridName.charAt(gridName.length() - 1);
+            chars[1] = '0';
+
+            chars[chars.length - 3] = '0';
+            chars[chars.length - 2] = '0';
+            chars[chars.length - 1] = gridName.charAt(gridName.length() - 1);
+
+            cfg.setNodeId(UUID.fromString(new String(chars)));
+        }
+
         return cfg;
     }
 


Mime
View raw message