You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2012/06/21 02:34:12 UTC

[2/4] git commit: Convert TestNG to Spock`

Convert TestNG to Spock`


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/ce8ecb79
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/ce8ecb79
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/ce8ecb79

Branch: refs/heads/master
Commit: ce8ecb79273fac4f0a2b49067963ea04a82e77d5
Parents: 73e4d96
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Jun 20 17:04:54 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Jun 20 17:04:54 2012 -0700

----------------------------------------------------------------------
 .../apache/tapestry5/ioc/util/DummyLockSpec.groovy |   28 +++++++++++
 .../tapestry5/ioc/internal/util/DummyLockTest.java |   37 ---------------
 2 files changed, 28 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ce8ecb79/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/util/DummyLockSpec.groovy
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/util/DummyLockSpec.groovy b/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/util/DummyLockSpec.groovy
new file mode 100644
index 0000000..465871c
--- /dev/null
+++ b/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/util/DummyLockSpec.groovy
@@ -0,0 +1,28 @@
+package org.apache.tapestry5.ioc.util
+
+import org.apache.tapestry5.ioc.internal.util.DummyLock
+import spock.lang.Specification
+
+import java.util.concurrent.locks.Lock
+
+class DummyLockSpec extends Specification {
+
+  def "all methods are no-ops"() {
+    Lock lock = new DummyLock()
+
+    when:
+
+    lock.lock()
+    lock.unlock()
+    lock.lockInterruptibly()
+
+    then:
+
+    noExceptionThrown()
+
+    expect:
+    lock.newCondition() == null
+    lock.tryLock()
+    lock.tryLock(0, null)
+  }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/ce8ecb79/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/util/DummyLockTest.java
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/util/DummyLockTest.java b/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/util/DummyLockTest.java
deleted file mode 100644
index d8a91df..0000000
--- a/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/util/DummyLockTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2009 The Apache Software Foundation
-//
-// Licensed 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 org.apache.tapestry5.ioc.internal.util;
-
-import java.util.concurrent.locks.Lock;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-public class DummyLockTest extends Assert
-{
-    @Test
-    public void dummy_lock_functions_are_noops() throws Exception
-    {
-        Lock lock = new DummyLock();
-
-        lock.lock();
-        lock.unlock();
-        lock.lockInterruptibly();
-
-        assertNull(lock.newCondition());
-        assertTrue(lock.tryLock());
-        assertTrue(lock.tryLock(0, null));
-    }
-}