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/05/19 22:47:29 UTC
git commit: Convert TestNG to Spock
Updated Branches:
refs/heads/master a2ea032b0 -> 6c8da1857
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/6c8da185
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6c8da185
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6c8da185
Branch: refs/heads/master
Commit: 6c8da18572c86f58be3c074adeee85b6c7be91fd
Parents: a2ea032
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Sat May 19 13:47:01 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Sat May 19 13:47:01 2012 -0700
----------------------------------------------------------------------
.../ioc/internal/LoggingSourceImplSpec.groovy | 29 +++++++++
.../ioc/internal/LoggerSourceImplTest.java | 48 ---------------
2 files changed, 29 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6c8da185/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/internal/LoggingSourceImplSpec.groovy
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/internal/LoggingSourceImplSpec.groovy b/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/internal/LoggingSourceImplSpec.groovy
new file mode 100644
index 0000000..3601124
--- /dev/null
+++ b/tapestry-ioc/src/test/groovy/org/apache/tapestry5/ioc/internal/LoggingSourceImplSpec.groovy
@@ -0,0 +1,29 @@
+package org.apache.tapestry5.ioc.internal
+
+import org.apache.tapestry5.ioc.LoggerSource
+import org.slf4j.LoggerFactory
+import spock.lang.Specification
+
+class LoggingSourceImplSpec extends Specification {
+
+ LoggerSource loggerSource = new LoggerSourceImpl()
+
+ def "get logger by class"() {
+ Class clazz = getClass()
+
+ expect:
+
+ loggerSource.getLogger(clazz).is(LoggerFactory.getLogger(clazz))
+ }
+
+ def "get logger by name"() {
+ String name = "foo.Bar"
+
+ expect:
+
+ loggerSource.getLogger(name).is(LoggerFactory.getLogger(name))
+
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6c8da185/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/LoggerSourceImplTest.java
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/LoggerSourceImplTest.java b/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/LoggerSourceImplTest.java
deleted file mode 100644
index e59f38c..0000000
--- a/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/LoggerSourceImplTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2006, 2007 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;
-
-import org.apache.tapestry5.ioc.LoggerSource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-
-public class LoggerSourceImplTest extends IOCInternalTestCase
-{
- @Test
- public void get_by_class()
- {
- Class clazz = getClass();
-
- Logger expected = LoggerFactory.getLogger(clazz);
- LoggerSource logSource = new LoggerSourceImpl();
- Logger actual = logSource.getLogger(clazz);
-
- assertSame(actual, expected);
- }
-
- @Test
- public void get_by_name()
- {
- String name = "foo.Bar";
-
- Logger expected = LoggerFactory.getLogger(name);
- LoggerSource logSource = new LoggerSourceImpl();
- Logger actual = logSource.getLogger(name);
-
- assertSame(actual, expected);
-
- }
-}