You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2015/12/16 22:53:35 UTC
incubator-geode git commit: renamed IntegrationTest to JUnitTest for
gradle support
Repository: incubator-geode
Updated Branches:
refs/heads/feature/GEODE-678 23f808d0c -> 2b082bf77
renamed IntegrationTest to JUnitTest for gradle support
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/2b082bf7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/2b082bf7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/2b082bf7
Branch: refs/heads/feature/GEODE-678
Commit: 2b082bf775f5cf75be6868b1bc70089ec27f2165
Parents: 23f808d
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Dec 16 13:52:43 2015 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Dec 16 13:52:43 2015 -0800
----------------------------------------------------------------------
.../DLockReentrantLockIntegrationTest.java | 84 --------------------
.../locks/DLockReentrantLockJUnitTest.java | 84 ++++++++++++++++++++
2 files changed, 84 insertions(+), 84 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2b082bf7/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockIntegrationTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockIntegrationTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockIntegrationTest.java
deleted file mode 100644
index 07824db..0000000
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockIntegrationTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.distributed.internal.locks;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionFactory;
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Lock;
-
-@Category(IntegrationTest.class)
-public class DLockReentrantLockIntegrationTest {
- final long id = 1213L;
-
- private Cache cache;
- private Region<Long, String> region;
-
- @Before
- public void setup() {
- cache = new CacheFactory().set("mcast-port", "0").set("locators", "").create();
- final RegionFactory<Long, String> regionFactory = cache.createRegionFactory("REPLICATE");
- regionFactory.setScope(Scope.GLOBAL);
- region = regionFactory.create("ReentrantLockRegion");
- region.put(id, new String("TestValue1"));
- }
-
- @After
- public void tearDown() {
- cache.close();
- }
-
- /**
- * Tests GEM-96/GEODE-678
- */
- @Test
- public void testReentrantLock() throws Exception {
-
- Assert.assertEquals(Scope.GLOBAL, region.getAttributes().getScope());
-
- final Lock lock1 = region.getDistributedLock(id);
- final Lock lock2 = region.getDistributedLock(id);
-
- for (int i = 0; i < 50; i++) {
- lock1.lock();
- boolean reenteredLock = false;
- try {
- reenteredLock = lock2.tryLock(1, TimeUnit.NANOSECONDS);
- if (!reenteredLock) {
- System.out.println("ERROR: could not reenter lock");
- }
- Assert.assertTrue("Failed getting lock at 2:" + i, reenteredLock);
- } finally {
- if (reenteredLock) {
- lock2.unlock();
- }
- lock1.unlock();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2b082bf7/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockJUnitTest.java
new file mode 100644
index 0000000..2dbd231
--- /dev/null
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/locks/DLockReentrantLockJUnitTest.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.distributed.internal.locks;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+
+@Category(IntegrationTest.class)
+public class DLockReentrantLockJUnitTest {
+ final long id = 1213L;
+
+ private Cache cache;
+ private Region<Long, String> region;
+
+ @Before
+ public void setup() {
+ cache = new CacheFactory().set("mcast-port", "0").set("locators", "").create();
+ final RegionFactory<Long, String> regionFactory = cache.createRegionFactory("REPLICATE");
+ regionFactory.setScope(Scope.GLOBAL);
+ region = regionFactory.create("ReentrantLockRegion");
+ region.put(id, new String("TestValue1"));
+ }
+
+ @After
+ public void tearDown() {
+ cache.close();
+ }
+
+ /**
+ * Tests GEM-96/GEODE-678
+ */
+ @Test
+ public void testReentrantLock() throws Exception {
+
+ Assert.assertEquals(Scope.GLOBAL, region.getAttributes().getScope());
+
+ final Lock lock1 = region.getDistributedLock(id);
+ final Lock lock2 = region.getDistributedLock(id);
+
+ for (int i = 0; i < 50; i++) {
+ lock1.lock();
+ boolean reenteredLock = false;
+ try {
+ reenteredLock = lock2.tryLock(1, TimeUnit.NANOSECONDS);
+ if (!reenteredLock) {
+ System.out.println("ERROR: could not reenter lock");
+ }
+ Assert.assertTrue("Failed getting lock at 2:" + i, reenteredLock);
+ } finally {
+ if (reenteredLock) {
+ lock2.unlock();
+ }
+ lock1.unlock();
+ }
+ }
+ }
+}