ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [07/12] ignite git commit: IGNITE-3386 - Minor code style changes
Date Tue, 21 Mar 2017 11:41:30 GMT
IGNITE-3386 - Minor code style changes


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

Branch: refs/heads/master
Commit: 3310f10b9d48d64280d0ebf2464ad892f3f31c52
Parents: c2b201e
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Mar 2 10:37:00 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Mar 2 10:37:00 2017 +0300

----------------------------------------------------------------------
 .../internal/GridCacheRecreateLockTest.java     | 32 +++++++++-----------
 1 file changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3310f10b/modules/core/src/test/java/org/apache/ignite/internal/GridCacheRecreateLockTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridCacheRecreateLockTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridCacheRecreateLockTest.java
index ae4ef87..ae850f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridCacheRecreateLockTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridCacheRecreateLockTest.java
@@ -13,11 +13,10 @@ import org.apache.ignite.testframework.junits.common.GridCommonTest;
  */
 @GridCommonTest(group = "Kernal Self")
 public class GridCacheRecreateLockTest extends GridCommonAbstractTest {
-
     /**
      * @throws IgniteCheckedException If failed.
      */
-    public void test() throws Exception {
+    public void testLockOwnerLeavesGrid() throws Exception {
         final Ignite ignite = startNodeAndLock("node1");
 
         new Thread(new Runnable() {
@@ -36,27 +35,24 @@ public class GridCacheRecreateLockTest extends GridCommonAbstractTest
{
         startNodeAndLock("node2");
     }
 
-    private Ignite startNodeAndLock(String name) {
-        try {
-            IgniteConfiguration cfg = new IgniteConfiguration();
-            cfg.setGridName(name);
-
-            Ignite ignite = Ignition.start(cfg);
+    /**
+     * @param name Grid name.
+     * @return Started Ignite instance.
+     */
+    private Ignite startNodeAndLock(String name) throws Exception {
+        IgniteConfiguration cfg = new IgniteConfiguration();
+        cfg.setGridName(name);
 
-            IgniteLock lock = ignite.reentrantLock("lock", true, true, true);
+        Ignite ignite = Ignition.start(cfg);
 
-            System.out.println("acquiring lock");
+        IgniteLock lock = ignite.reentrantLock("lock", true, true, true);
 
-            lock.lock();
+        System.out.println("acquiring lock");
 
-            System.out.println("acquired lock");
+        lock.lock();
 
-            return ignite;
-        }
-        catch (Exception e) {
-            assertTrue(false);
-        }
+        System.out.println("acquired lock");
 
-        return null;
+        return ignite;
     }
 }
\ No newline at end of file


Mime
View raw message