You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by jw...@apache.org on 2016/07/21 05:10:00 UTC
[1/2] groovy git commit: test cleanup: remove println calls (closes
#369)
Repository: groovy
Updated Branches:
refs/heads/master 67f2d4cb9 -> 858a6fd2e
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/SubscriptOnStringArrayBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/SubscriptOnStringArrayBug.groovy b/src/test/groovy/bugs/SubscriptOnStringArrayBug.groovy
index 1724073..8cfc987 100644
--- a/src/test/groovy/bugs/SubscriptOnStringArrayBug.groovy
+++ b/src/test/groovy/bugs/SubscriptOnStringArrayBug.groovy
@@ -28,8 +28,6 @@ class SubscriptOnStringArrayBug extends TestSupport {
array[0] = "d"
assert array[0] == "d"
-
- println("Contents of array are ${array.inspect()}")
}
void testRobsTestCase() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/SynchronizedBytecodeBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/SynchronizedBytecodeBug.groovy b/src/test/groovy/bugs/SynchronizedBytecodeBug.groovy
index 803d389c..aef4531 100644
--- a/src/test/groovy/bugs/SynchronizedBytecodeBug.groovy
+++ b/src/test/groovy/bugs/SynchronizedBytecodeBug.groovy
@@ -31,21 +31,14 @@ class SynchronizedBytecodeBug extends GroovyTestCase {
Integer foo = 0
Thread.start{
- println "sleeping for a moment"
sleep 100
- println "slept and synchronizing from thread"
synchronized(foo) {
- println "notifying"
foo.notify()
- println "notified"
}
}
- println "synchronizing"
synchronized(foo) {
- println "starting to wait"
foo.wait()
- println "waited"
}
// if this point is reached, the test worked :-)
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/TestSupport.java
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/TestSupport.java b/src/test/groovy/bugs/TestSupport.java
index 401ac28..b2d2cfa 100644
--- a/src/test/groovy/bugs/TestSupport.java
+++ b/src/test/groovy/bugs/TestSupport.java
@@ -49,8 +49,6 @@ public abstract class TestSupport extends GroovyTestCase {
}
public Iterator iterator() {
- System.out.println("Calling custom iterator() method for " + this);
-
return Arrays.asList(getMockArguments()).iterator();
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/ToStringBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/ToStringBug.groovy b/src/test/groovy/bugs/ToStringBug.groovy
index 096834d..3330f7b 100644
--- a/src/test/groovy/bugs/ToStringBug.groovy
+++ b/src/test/groovy/bugs/ToStringBug.groovy
@@ -23,13 +23,8 @@ package groovy.bugs
class ToStringBug extends GroovyTestCase {
void testBug() {
- println "Starting test"
-
def value = toString()
assert value != null
-
- println value
- println "Found value ${value}"
}
String toString() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/execute/ExecuteTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/execute/ExecuteTest.groovy b/src/test/groovy/execute/ExecuteTest.groovy
index 5cb3abb..8d29f15 100644
--- a/src/test/groovy/execute/ExecuteTest.groovy
+++ b/src/test/groovy/execute/ExecuteTest.groovy
@@ -33,42 +33,36 @@ class ExecuteTest extends GroovyTestCase {
}
void testExecuteCommandLineProcessUsingAString() {
- println "Executing String command: $cmd"
StringBuffer sbout = new StringBuffer()
StringBuffer sberr = new StringBuffer()
def process = cmd.execute()
process.waitForProcessOutput sbout, sberr
def value = process.exitValue()
int count = sbout.toString().readLines().size()
- println "Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
assert count > 1
assert value == 0
}
void testExecuteCommandLineProcessUsingAStringArray() {
def cmdArray = cmd.split(' ')
- println "Executing String[] command: $cmdArray"
StringBuffer sbout = new StringBuffer()
StringBuffer sberr = new StringBuffer()
def process = cmdArray.execute()
process.waitForProcessOutput sbout, sberr
def value = process.exitValue()
int count = sbout.toString().readLines().size()
- println "Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
assert count > 1
assert value == 0
}
void testExecuteCommandLineProcessUsingAList() {
List<String> cmdList = Arrays.asList(cmd.split(' '))
- println "Executing List<String> command: $cmdList"
StringBuffer sbout = new StringBuffer()
StringBuffer sberr = new StringBuffer()
def process = cmdList.execute()
process.waitForProcessOutput sbout, sberr
def value = process.exitValue()
int count = sbout.toString().readLines().size()
- println "Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
assert count > 1
assert value == 0
}
@@ -91,9 +85,6 @@ class ExecuteTest extends GroovyTestCase {
terr.join()
def value = process.exitValue()
int count = sbout.toString().readLines().size()
- println "Heaps of time case: Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
- System.err.println 'std err: ' + sberr.toString()
- System.err.println 'std out: ' + sbout.toString()
// assert sbout.toString().contains('Done'), "Expected 'Done' but found: " + sbout.toString() + " with error: " + sberr.toString()
assert value == 0
@@ -108,20 +99,17 @@ class ExecuteTest extends GroovyTestCase {
terr.join()
value = process.exitValue()
count = sbout.toString().readLines().size()
- println "Insufficient time case: Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
assert !sbout.toString().contains('Done')
assert value != 0 // should have been killed
}
void testExecuteCommandLineUnderWorkingDirectory() {
- println "Executing command in dir '..': $cmd"
StringBuffer sbout = new StringBuffer()
StringBuffer sberr = new StringBuffer()
def process = cmd.execute(null, new File('..'))
process.waitForProcessOutput sbout, sberr
def value = process.exitValue()
int count = sbout.toString().readLines().size()
- println "Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
assert count > 1
assert value == 0
}
@@ -135,14 +123,12 @@ class ExecuteTest extends GroovyTestCase {
"println(System.getenv('foo'))"]
println "Executing this command:\n${java.join(' ')}"
def props = ["foo=bar"]
- println "With these props: $props"
StringBuffer sbout = new StringBuffer()
StringBuffer sberr = new StringBuffer()
def process = java.execute(props, null)
process.waitForProcessOutput sbout, sberr
def value = process.exitValue()
int count = sbout.toString().readLines().size()
- println "Exit value: $value, Err lines: ${sberr.toString().readLines().size()}, Out lines: $count"
assert sbout.toString().contains('bar')
assert value == 0
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/lang/ClassReloadingTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/lang/ClassReloadingTest.groovy b/src/test/groovy/lang/ClassReloadingTest.groovy
index 488ef46..197d637 100644
--- a/src/test/groovy/lang/ClassReloadingTest.groovy
+++ b/src/test/groovy/lang/ClassReloadingTest.groovy
@@ -125,7 +125,6 @@ class ClassReloadingTest extends GroovyTestCase {
}
"""
def groovyClass = cl.loadClass(className, true, false)
- println System.identityHashCode(groovyClass)
assert !groovyClass.declaredFields.any { it.name.contains('__timeStamp') }
def message = groovyClass.newInstance().greeting
assert "hello" == message
@@ -148,7 +147,6 @@ class ClassReloadingTest extends GroovyTestCase {
// reload
groovyClass = cl.loadClass(className, true, false)
- println System.identityHashCode(groovyClass)
assert groovyClass.declaredFields.any { it.name.contains('__timeStamp') }
message = groovyClass.newInstance().greeting
assert "goodbye" == message
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/lang/ExpandoMetaClassTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/lang/ExpandoMetaClassTest.groovy b/src/test/groovy/lang/ExpandoMetaClassTest.groovy
index 8d22593..7451127 100644
--- a/src/test/groovy/lang/ExpandoMetaClassTest.groovy
+++ b/src/test/groovy/lang/ExpandoMetaClassTest.groovy
@@ -566,7 +566,6 @@ class ExpandoMetaClassTest extends GroovyTestCase {
}
void testBorrowByName() {
- println 'testBorrowByName'
def metaClass = new ExpandoMetaClass(EMCT_Class.class)
def a = new EMCT_Another()
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/runtime/MethodFailureTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/MethodFailureTest.java b/src/test/org/codehaus/groovy/runtime/MethodFailureTest.java
index ffa8b79..b634eb1 100644
--- a/src/test/org/codehaus/groovy/runtime/MethodFailureTest.java
+++ b/src/test/org/codehaus/groovy/runtime/MethodFailureTest.java
@@ -38,7 +38,7 @@ public class MethodFailureTest extends GroovyTestCase {
fail("Should have thrown an exception");
}
catch (GroovyRuntimeException e) {
- System.out.println(e);
+ // expected
}
}
@@ -50,8 +50,7 @@ public class MethodFailureTest extends GroovyTestCase {
fail("Should have thrown an exception");
}
catch (GroovyRuntimeException e) {
- System.out.println(e);
- //e.printStackTrace();
+ // expected
}
}
@@ -67,8 +66,7 @@ public class MethodFailureTest extends GroovyTestCase {
fail("Should have thrown an exception");
}
catch (GroovyRuntimeException e) {
- System.out.println(e);
- //e.printStackTrace();
+ // expected
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java b/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
index 6d2e3e1..a68c965 100644
--- a/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
+++ b/src/test/org/codehaus/groovy/runtime/NewStaticMetaMethodTest.java
@@ -49,15 +49,11 @@ public class NewStaticMetaMethodTest extends TestCase {
Object answer = metaMethod.invoke("abc", new Object[]{"123"});
assertEquals("abc123", answer);
-
- System.out.println("Found: " + answer);
}
public void testInvokeDefaultGroovyMethodUsingMetaClass() {
Object answer = InvokerHelper.invokeMethod("abc", "plus", new Object[]{"123"});
assertEquals("abc123", answer);
-
- System.out.println("Found: " + answer);
}
public static String dummyMethod(String foo, String bar) throws Exception {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/runtime/PropertyTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/PropertyTest.java b/src/test/org/codehaus/groovy/runtime/PropertyTest.java
index c36748a..f5c0127 100644
--- a/src/test/org/codehaus/groovy/runtime/PropertyTest.java
+++ b/src/test/org/codehaus/groovy/runtime/PropertyTest.java
@@ -161,7 +161,6 @@ public class PropertyTest extends GroovyTestCase {
Process process = ProcessGroovyMethods.execute(java);
Object value = InvokerHelper.getProperty(process, "in");
assertNotNull(value);
- System.out.println("Found in: " + value);
process.destroy();
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/StaticInitTest.java b/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
index 88d6216..0fb7ee9 100644
--- a/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
+++ b/src/test/org/codehaus/groovy/runtime/StaticInitTest.java
@@ -29,7 +29,6 @@ class X {
static {
StaticInitTest.failed = true;
- System.out.println("INIT");
}
}
@@ -38,12 +37,9 @@ public class StaticInitTest extends TestCase {
static boolean failed;
public void testInitOrder () throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
- System.out.println("GET FIELD");
final Field f = new GroovyClassLoader().loadClass("org.codehaus.groovy.runtime.X", false, false, false).getField("field");
- System.out.println(failed);
assertTrue(!failed);
f.getInt(null);
- System.out.println(failed);
assertTrue(failed);
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/TestDgmConverter.java
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/TestDgmConverter.java b/src/test/org/codehaus/groovy/tools/TestDgmConverter.java
index 659a72b..575ed03 100644
--- a/src/test/org/codehaus/groovy/tools/TestDgmConverter.java
+++ b/src/test/org/codehaus/groovy/tools/TestDgmConverter.java
@@ -47,8 +47,6 @@ public class TestDgmConverter extends TestCase {
File file = files[i];
final String name = file.getName();
if (name.startsWith("dgm$")) {
- System.out.println(name);
-
final String className = "org.codehaus.groovy.runtime." + name.substring(0, name.length() - ".class".length());
try {
Class cls = Class.forName(className, false, DefaultGroovyMethods.class.getClassLoader());
@@ -72,9 +70,6 @@ public class TestDgmConverter extends TestCase {
public void testRegistry () {
final MetaClassRegistryImpl metaClassRegistry = new MetaClassRegistryImpl();
final Object [] instanceMethods = metaClassRegistry.getInstanceMethods().getArray();
- for (int i = 0; i < instanceMethods.length; i++) {
- System.out.println(instanceMethods[i]);
-
- }
+ assertTrue(instanceMethods.length > 0);
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV1StubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV1StubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV1StubsTest.groovy
index 9e0cbd2..34be79d 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV1StubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV1StubsTest.groovy
@@ -27,7 +27,6 @@ package org.codehaus.groovy.tools.stubgenerator
class AnnotationMemberValuesResolutionV1StubsTest extends StringSourcesStubTestCase {
Map<String, String> provideSources() {
- println 'AnnotationMemberValuesResolutionStubsTestV1'
[
'foo/Foo4434V1.java': '''
package foo;
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV2StubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV2StubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV2StubsTest.groovy
index 3726c93..2eb26a2 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV2StubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV2StubsTest.groovy
@@ -26,7 +26,6 @@ package org.codehaus.groovy.tools.stubgenerator
class AnnotationMemberValuesResolutionV2StubsTest extends StringSourcesStubTestCase {
Map<String, String> provideSources() {
- println 'AnnotationMemberValuesResolutionStubsTestV2'
[
'foo/Foo4434V2.java': '''
package foo;
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV3StubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV3StubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV3StubsTest.groovy
index c27f9f7..e823fc9 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV3StubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/AnnotationMemberValuesResolutionV3StubsTest.groovy
@@ -26,7 +26,6 @@ package org.codehaus.groovy.tools.stubgenerator
class AnnotationMemberValuesResolutionV3StubsTest extends StringSourcesStubTestCase {
Map<String, String> provideSources() {
- println 'AnnotationMemberValuesResolutionStubsTestV3'
[
'foo/Foo4434V3.java': '''
package foo;
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/DuplicateMethodAdditionInStubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/DuplicateMethodAdditionInStubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/DuplicateMethodAdditionInStubsTest.groovy
index 2497790..c5e171f 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/DuplicateMethodAdditionInStubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/DuplicateMethodAdditionInStubsTest.groovy
@@ -55,6 +55,5 @@ class DuplicateMethodAdditionInStubsTest extends StringSourcesStubTestCase {
void verifyStubs() {
assert classes.size() == 2
assert classes['de.app.User4453'].methods['setName'].size() == 2
- println 'DuplicateMethodAdditionInStubsTest - verified'
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy5859Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy5859Bug.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy5859Bug.groovy
index 29cb0a1..9d49391 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy5859Bug.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/Groovy5859Bug.groovy
@@ -36,7 +36,6 @@ class TaggedsMap extends Groovy5859Support {
@Override
void verifyStubs() {
def stubSource = stubJavaSourceFor('TaggedsMap')
- println stubSource
assert stubSource.contains('super ((java.util.SortedMap)null);')
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForAnAnnotationStubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForAnAnnotationStubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForAnAnnotationStubsTest.groovy
index ec751ef..f5d3a88 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForAnAnnotationStubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForAnAnnotationStubsTest.groovy
@@ -47,7 +47,5 @@ class StubGenerationForAnAnnotationStubsTest extends StringSourcesStubTestCase {
String annotationClassSource = stubJavaSourceFor('Foo4451')
assert annotationClassSource.contains('public @interface Foo4451')
assert !annotationClassSource.contains('java.lang.annotation.Annotation')
-
- println 'StubGenerationForAnAnnotationStubsTest - verified'
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForConstructorWithOptionalArgsStubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForConstructorWithOptionalArgsStubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForConstructorWithOptionalArgsStubsTest.groovy
index b5cf57f..90ec613 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForConstructorWithOptionalArgsStubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/StubGenerationForConstructorWithOptionalArgsStubsTest.groovy
@@ -26,7 +26,6 @@ package org.codehaus.groovy.tools.stubgenerator
class StubGenerationForConstructorWithOptionalArgsStubsTest extends StringSourcesStubTestCase {
Map<String, String> provideSources() {
- println 'StubGenerationForConstructorWithOptionalArgsStubsTest'
[
'Base4508.java': '''
class Base4508 {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/org/codehaus/groovy/tools/stubgenerator/UnAmbigousSuperConstructorCallStubsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/UnAmbigousSuperConstructorCallStubsTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/UnAmbigousSuperConstructorCallStubsTest.groovy
index 372362d..42ae1c1 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/UnAmbigousSuperConstructorCallStubsTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/UnAmbigousSuperConstructorCallStubsTest.groovy
@@ -50,6 +50,5 @@ class UnAmbigousSuperConstructorCallStubsTest extends StringSourcesStubTestCase
assert classes['UserAuthException'] != null
String stubSource = stubJavaSourceFor('UserAuthException')
assert !stubSource.contains('super (null)')
- println 'UnAmbigousSuperConstructorCallStubsTest - verified'
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/subprojects/groovy-xml/src/test/groovy/groovy/bugs/Groovy249_Bug.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/bugs/Groovy249_Bug.groovy b/subprojects/groovy-xml/src/test/groovy/groovy/bugs/Groovy249_Bug.groovy
index 0710bc1..073559a 100644
--- a/subprojects/groovy-xml/src/test/groovy/groovy/bugs/Groovy249_Bug.groovy
+++ b/subprojects/groovy-xml/src/test/groovy/groovy/bugs/Groovy249_Bug.groovy
@@ -28,8 +28,6 @@ class Groovy249_Bug extends GroovyTestCase {
void testBug() {
def t = new Bean249()
t.b = "hello"
- println t.b
- println "test: ${t.b}"
def xml = new MarkupBuilder()
def root = xml.foo {
[2/2] groovy git commit: test cleanup: remove println calls (closes
#369)
Posted by jw...@apache.org.
test cleanup: remove println calls (closes #369)
In many cases asserts were already in place to ensure the expected
output. In places were asserts did not already exist, the println
calls were replaced by asserts.
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/858a6fd2
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/858a6fd2
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/858a6fd2
Branch: refs/heads/master
Commit: 858a6fd2e82ccac72f2c3906815af6a7d4e400ca
Parents: 67f2d4c
Author: John Wagenleitner <jw...@apache.org>
Authored: Wed Jul 20 17:02:08 2016 -0700
Committer: John Wagenleitner <jw...@apache.org>
Committed: Wed Jul 20 17:02:16 2016 -0700
----------------------------------------------------------------------
src/test/groovy/ArrayCoerceTest.groovy | 37 --------------------
src/test/groovy/ArrayParamMethodTest.groovy | 4 ---
src/test/groovy/ArrayTypeTest.groovy | 6 ++--
src/test/groovy/CastTest.groovy | 14 --------
src/test/groovy/ClassExpressionTest.groovy | 6 ----
src/test/groovy/ClassTest.groovy | 3 --
.../groovy/ClosureDefaultParameterTest.groovy | 16 +++++----
src/test/groovy/ClosureInClosureTest.groovy | 2 +-
src/test/groovy/ClosureMethodTest.groovy | 2 --
src/test/groovy/ClosureMethodsOnFileTest.groovy | 11 +++---
src/test/groovy/ClosureMissingMethodTest.groovy | 8 -----
src/test/groovy/ClosureTest.groovy | 4 +--
.../ClosureUsingOuterVariablesTest.groovy | 6 +---
.../groovy/ClosureWithDefaultParamTest.groovy | 20 +++--------
.../ClosureWithEmptyParametersTest.groovy | 6 +---
src/test/groovy/CompareEqualsTest.groovy | 2 --
src/test/groovy/CompileOrderTest.groovy | 5 ---
src/test/groovy/CompilerErrorTest.groovy | 4 ---
src/test/groovy/Constructor2Test.groovy | 5 +--
src/test/groovy/ConstructorTest.groovy | 5 +--
src/test/groovy/CurlyBracketLayoutTest.groovy | 4 +--
src/test/groovy/DefaultParamClosureTest.groovy | 2 --
src/test/groovy/ExceptionInClosureTest.groovy | 2 --
src/test/groovy/ExpandoPropertyTest.groovy | 11 +-----
src/test/groovy/ForLoopTest.groovy | 4 ---
src/test/groovy/GStringTest.groovy | 8 ++---
src/test/groovy/GeneratorTest.groovy | 4 +--
src/test/groovy/GroovyClosureMethodsTest.groovy | 31 ++++------------
src/test/groovy/GroovyMethodsTest.groovy | 9 -----
src/test/groovy/IfPropertyTest.groovy | 4 ---
src/test/groovy/IfTest.groovy | 8 ++---
src/test/groovy/LeftShiftTest.groovy | 4 ---
src/test/groovy/LoopBreakTest.groovy | 4 ---
src/test/groovy/MapConstructionTest.groovy | 5 +--
src/test/groovy/MethodCallTest.groovy | 3 +-
.../MethodCallWithoutParenthesisTest.groovy | 2 --
src/test/groovy/MinMaxTest.groovy | 4 ---
src/test/groovy/MultilineStringTest.groovy | 1 -
src/test/groovy/NewExpressionTest.groovy | 4 ---
src/test/groovy/SafeNavigationTest.groovy | 1 -
src/test/groovy/SimplePostfixTest.groovy | 2 --
src/test/groovy/SingletonBugTest.groovy | 14 ++------
src/test/groovy/SpreadDotTest.groovy | 17 ++++-----
src/test/groovy/StringBufferTest.groovy | 1 -
src/test/groovy/ThrowTest.groovy | 1 -
src/test/groovy/ToArrayBugTest.groovy | 2 --
src/test/groovy/TripleQuotedStringTest.groovy | 1 -
src/test/groovy/TryCatchTest.groovy | 3 --
src/test/groovy/WhileLoopTest.groovy | 2 +-
.../bugs/AmbiguousListOrMethodTest.groovy | 11 +-----
src/test/groovy/bugs/AsBoolBug.groovy | 17 ---------
.../bugs/AssignmentInsideExpressionBug.groovy | 8 +++--
src/test/groovy/bugs/BlockAsClosureBug.groovy | 5 ---
src/test/groovy/bugs/Bytecode2Bug.groovy | 6 +---
src/test/groovy/bugs/ClosureVariableBug.groovy | 2 --
src/test/groovy/bugs/ConstructorBug.groovy | 4 ---
.../groovy/bugs/ConstructorThisCallBug.groovy | 12 +++----
src/test/groovy/bugs/ForLoopBug.groovy | 1 -
src/test/groovy/bugs/GetterBug.groovy | 8 -----
src/test/groovy/bugs/Groovy2350Bug.groovy | 1 -
src/test/groovy/bugs/Groovy2365Bug.java | 2 --
src/test/groovy/bugs/Groovy2490Bug.groovy | 2 --
src/test/groovy/bugs/Groovy2666Bug.groovy | 2 +-
.../groovy/bugs/Groovy3156And2621Bug.groovy | 1 -
src/test/groovy/bugs/Groovy3335Bug.groovy | 2 +-
src/test/groovy/bugs/Groovy3403Bug.groovy | 1 -
src/test/groovy/bugs/Groovy3405Bug.groovy | 2 --
src/test/groovy/bugs/Groovy3410Bug.groovy | 1 -
src/test/groovy/bugs/Groovy3770Bug.groovy | 2 +-
src/test/groovy/bugs/Groovy4393Bug.groovy | 3 --
src/test/groovy/bugs/Groovy6041Bug.groovy | 1 -
src/test/groovy/bugs/Groovy770_Bug.groovy | 6 ----
src/test/groovy/bugs/Groovy872Bug.groovy | 1 -
src/test/groovy/bugs/InterfaceImplBug.groovy | 1 -
...eNormalMethodFromBuilder_Groovy657Bug.groovy | 5 ++-
src/test/groovy/bugs/NestedClosure2Bug.groovy | 6 ----
src/test/groovy/bugs/NestedClosureBug.groovy | 3 +-
src/test/groovy/bugs/POJOCallSiteBug.groovy | 1 -
src/test/groovy/bugs/PropertyNameBug.groovy | 8 -----
src/test/groovy/bugs/RodsBug.groovy | 1 -
.../bugs/RussellsOptionalParenTest.groovy | 4 +--
.../bugs/SubscriptOnStringArrayBug.groovy | 2 --
.../groovy/bugs/SynchronizedBytecodeBug.groovy | 7 ----
src/test/groovy/bugs/TestSupport.java | 2 --
src/test/groovy/bugs/ToStringBug.groovy | 5 ---
src/test/groovy/execute/ExecuteTest.groovy | 14 --------
src/test/groovy/lang/ClassReloadingTest.groovy | 2 --
.../groovy/lang/ExpandoMetaClassTest.groovy | 1 -
.../groovy/runtime/MethodFailureTest.java | 8 ++---
.../groovy/runtime/NewStaticMetaMethodTest.java | 4 ---
.../codehaus/groovy/runtime/PropertyTest.java | 1 -
.../codehaus/groovy/runtime/StaticInitTest.java | 4 ---
.../codehaus/groovy/tools/TestDgmConverter.java | 7 +---
...tionMemberValuesResolutionV1StubsTest.groovy | 1 -
...tionMemberValuesResolutionV2StubsTest.groovy | 1 -
...tionMemberValuesResolutionV3StubsTest.groovy | 1 -
.../DuplicateMethodAdditionInStubsTest.groovy | 1 -
.../tools/stubgenerator/Groovy5859Bug.groovy | 1 -
...tubGenerationForAnAnnotationStubsTest.groovy | 2 --
...rConstructorWithOptionalArgsStubsTest.groovy | 1 -
...AmbigousSuperConstructorCallStubsTest.groovy | 1 -
.../groovy/groovy/bugs/Groovy249_Bug.groovy | 2 --
102 files changed, 88 insertions(+), 434 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ArrayCoerceTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ArrayCoerceTest.groovy b/src/test/groovy/ArrayCoerceTest.groovy
index c82d31d..7bdb55b 100644
--- a/src/test/groovy/ArrayCoerceTest.groovy
+++ b/src/test/groovy/ArrayCoerceTest.groovy
@@ -28,12 +28,10 @@ class ArrayCoerceTest extends GroovyTestCase {
int[] a = [1, 2, 3]
assert a instanceof int[]
assert a.length == 3
- dump(a)
}
void testStaticallyTypedPrimitiveFieldArrays() {
primitiveField = [1, 2, 3]
- dump(primitiveField)
assert primitiveField instanceof int[]
assert primitiveField.length == 3
@@ -42,7 +40,6 @@ class ArrayCoerceTest extends GroovyTestCase {
void testFoo2() {
def x = [1, 2, 3] as Object[]
- dump(x)
assert x instanceof Object[]
def c = x.getClass()
def et = c.componentType
@@ -51,7 +48,6 @@ class ArrayCoerceTest extends GroovyTestCase {
void testStaticallyTypedObjectArrays() {
Object[] b = [1, 2, 3]
- dump(b)
assert b instanceof Object[]
assert b.length == 3
@@ -63,7 +59,6 @@ class ArrayCoerceTest extends GroovyTestCase {
void testStaticallyTypedArrays() {
Integer[] b = [1, 2, 3]
- dump(b)
assert b instanceof Integer[]
assert b.length == 3
@@ -75,7 +70,6 @@ class ArrayCoerceTest extends GroovyTestCase {
void testStaticallyTypedObjectFieldArrays() {
field = [1, 2, 3]
- dump(field)
assert field instanceof Object[]
assert field.length == 3
@@ -83,7 +77,6 @@ class ArrayCoerceTest extends GroovyTestCase {
void testStaticallyTypedFieldArrays() {
numberField = [1, 2, 3]
- dump(numberField)
assert numberField instanceof Long[]
assert numberField.length == 3
@@ -95,42 +88,34 @@ class ArrayCoerceTest extends GroovyTestCase {
x = [1, 0, 1] as boolean[]
assert x instanceof boolean[]
assert x.length == 3
- dump(x)
x = [1, 2, 3] as byte[]
assert x.length == 3
assert x instanceof byte[]
- dump(x)
x = [1, 2, 3] as char[]
assert x.length == 3
assert x instanceof char[]
- dump(x)
x = [1, 2, 3] as short[]
assert x.length == 3
assert x instanceof short[]
- dump(x)
x = [1, 2, 3] as int[]
assert x.length == 3
assert x instanceof int[]
- dump(x)
x = [1, 2, 3] as long[]
assert x.length == 3
assert x instanceof long[]
- dump(x)
x = [1, 2, 3] as float[]
assert x.length == 3
assert x instanceof float[]
- dump(x)
x = [1, 2, 3] as double[]
assert x.length == 3
assert x instanceof double[]
- dump(x)
}
@@ -140,37 +125,31 @@ class ArrayCoerceTest extends GroovyTestCase {
def c = x.getClass()
def et = c.componentType
assert et == Object.class
- dump(x)
Integer[] y = [1, 2, 3]
c = y.getClass()
et = c.componentType
assert et == Integer.class
- dump(y)
}
void testMakeArrayThenCoerceToAnotherType() {
def x = [1, 2, 3] as int[]
assert x.size() == 3
assert x instanceof int[]
- dump(x)
// lets try coerce it into an array of longs
def y = x as long[]
assert y instanceof long[]
- dump(y)
def z = y as Object[]
assert z instanceof Object[]
def c = z.getClass()
def et = c.componentType
assert et == Object.class
- dump(z)
x = y as int[]
assert x.size() == 3
assert x instanceof int[]
- dump(x)
}
@@ -180,50 +159,34 @@ class ArrayCoerceTest extends GroovyTestCase {
x = [1, 0, 1] as Boolean[]
assert x instanceof Boolean[]
assert x.length == 3
- dump(x)
x = [1, 2, 3] as Byte[]
assert x.length == 3
assert x instanceof Byte[]
- dump(x)
x = [1, 2, 3] as Character[]
assert x.length == 3
assert x instanceof Character[]
- dump(x)
x = [1, 2, 3] as Short[]
assert x.length == 3
assert x instanceof Short[]
- dump(x)
x = [1, 2, 3] as Integer[]
assert x.length == 3
assert x instanceof Integer[]
- dump(x)
x = [1, 2, 3] as Long[]
assert x.length == 3
assert x instanceof Long[]
- dump(x)
x = [1, 2, 3] as Float[]
assert x.length == 3
assert x instanceof Float[]
- dump(x)
x = [1, 2, 3] as Double[]
assert x.length == 3
assert x instanceof Double[]
- dump(x)
- }
-
- void dump(array) {
- println "Array is of type ${array.class} which has element type ${array.class.componentType}"
- for (i in array) {
- println "Contains entry $i of type ${i.class}"
- }
- println()
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ArrayParamMethodTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ArrayParamMethodTest.groovy b/src/test/groovy/ArrayParamMethodTest.groovy
index 499b3ae..f565537 100644
--- a/src/test/groovy/ArrayParamMethodTest.groovy
+++ b/src/test/groovy/ArrayParamMethodTest.groovy
@@ -29,15 +29,11 @@ class ArrayParamMethodTest extends GroovyTestCase implements DummyInterface {
}
void methodWithArrayParam(String[] args) {
- println("first item: ${args[0]}")
-
// lets turn it into a list
def list = args.toList()
assert list instanceof java.util.List
list[4] = "e"
assert list == ["a", "b", "c", null, "e"]
-
- println("Created list ${list}")
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ArrayTypeTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ArrayTypeTest.groovy b/src/test/groovy/ArrayTypeTest.groovy
index 7b0ff56..48f213b 100644
--- a/src/test/groovy/ArrayTypeTest.groovy
+++ b/src/test/groovy/ArrayTypeTest.groovy
@@ -21,20 +21,18 @@ package groovy
class ArrayTypeTest extends GroovyTestCase {
void testClosureWithTypedParam() {
- def c = {String[] foo->println("called with $foo") }
+ def c = {String[] foo-> assert !foo}
c(null)
}
void testVariableType() {
Object[] foo = methodThatReturnsArray()
- println "foo is $foo"
-
+ assert !foo
}
Object[] methodThatReturnsArray() {
- println "Invoked the method"
return null
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/CastTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/CastTest.groovy b/src/test/groovy/CastTest.groovy
index 0b51489..217d325 100644
--- a/src/test/groovy/CastTest.groovy
+++ b/src/test/groovy/CastTest.groovy
@@ -25,8 +25,6 @@ class CastTest extends GroovyTestCase {
void testCast() {
def x = (Short) 5
- println("Cast Integer to ${x} with type ${x.class}")
-
assert x.class == Short
methodWithShort(x)
@@ -35,29 +33,20 @@ class CastTest extends GroovyTestCase {
void testImplicitCast() {
Short x = 6
- println("Created ${x} with type ${x.class}")
-
assert x.class == Short , "Type is ${x.class}"
methodWithShort(x)
x = 7
-
- println("Updated ${x} with type ${x.class}")
-
assert x.class == Short , "Type is ${x.class}"
}
void testImplicitCastOfField() {
- println("Field is ${b} with type ${b.class}")
-
assert b.class == Short , "Type is ${b.class}"
b = 5
- println("Updated field ${b} with type ${b.class}")
-
assert b.class == Short , "Type is ${b.class}"
}
@@ -93,13 +82,10 @@ class CastTest extends GroovyTestCase {
}
void methodWithShort(Short s) {
- println("Called with ${s} with type ${s.class}")
assert s.class == Short
}
void methodWithChar(Character x) {
- println("Called with ${x} with type ${s.class}")
-
def text = "text"
def idx = text.indexOf(x)
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClassExpressionTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClassExpressionTest.groovy b/src/test/groovy/ClassExpressionTest.groovy
index 17b4650..eccec72 100644
--- a/src/test/groovy/ClassExpressionTest.groovy
+++ b/src/test/groovy/ClassExpressionTest.groovy
@@ -28,8 +28,6 @@ class ClassExpressionTest extends GroovyTestCase {
void testUseOfClass() {
def x = String
- System.out.println("x: " + x)
-
assert x != null
assert x.getName().endsWith('String')
@@ -48,8 +46,6 @@ class ClassExpressionTest extends GroovyTestCase {
x = ClassExpressionTest
assert x != null
-
- System.out.println("x: " + x)
}
void testClassPsuedoProperty() {
@@ -59,8 +55,6 @@ class ClassExpressionTest extends GroovyTestCase {
assert x.class != null
assert x.class == x.getClass();
-
- System.err.println( "x.class: " + x.class );
}
void testPrimitiveClasses() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClassTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClassTest.groovy b/src/test/groovy/ClassTest.groovy
index 7f186fd..38931cb 100644
--- a/src/test/groovy/ClassTest.groovy
+++ b/src/test/groovy/ClassTest.groovy
@@ -22,17 +22,14 @@ class ClassTest extends GroovyTestCase {
void testClassExpression() {
def c = String.class
- println c
assert c instanceof Class
assert c.name == "java.lang.String" , c.name
c = GroovyTestCase.class
- println c
assert c instanceof Class
assert c.name.endsWith("GroovyTestCase") , c.name
c = ClassTest.class
- println c
assert c instanceof Class
assert c.name.endsWith("ClassTest") , c.name
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureDefaultParameterTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureDefaultParameterTest.groovy b/src/test/groovy/ClosureDefaultParameterTest.groovy
index c0ede31..71fc418 100644
--- a/src/test/groovy/ClosureDefaultParameterTest.groovy
+++ b/src/test/groovy/ClosureDefaultParameterTest.groovy
@@ -25,15 +25,19 @@ class ClosureDefaultParameterTest extends GroovyTestCase {
void testClosureWithDefaultParams() {
- def block = {a = 123, b = 456 -> println "value of a = $a and b = $b" }
-
- block = { Integer a = 123, String b = "abc" ->
- println "value of a = $a and b = $b"; return "$a $b".toString() }
+ def block = {a = 123, b = 456 -> "$a $b".toString() }
assert block.call(456, "def") == "456 def"
- assert block.call() == "123 abc"
- assert block(456) == "456 abc"
+ assert block.call() == "123 456"
+ assert block(456) == "456 456"
assert block(456, "def") == "456 def"
+
+ def block2 = { Integer a = 123, String b = "abc" -> "$a $b".toString() }
+
+ assert block2.call(456, "def") == "456 def"
+ assert block2.call() == "123 abc"
+ assert block2(456) == "456 abc"
+ assert block2(456, "def") == "456 def"
}
void testClosureWithDefaultParamFromOuterScope() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureInClosureTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureInClosureTest.groovy b/src/test/groovy/ClosureInClosureTest.groovy
index 5af96a1..8941cad 100644
--- a/src/test/groovy/ClosureInClosureTest.groovy
+++ b/src/test/groovy/ClosureInClosureTest.groovy
@@ -37,7 +37,7 @@ class ClosureInClosureTest extends GroovyTestCase {
l.each{
it.each{
- println(text)
+ assert text == 'test '
}
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureMethodTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureMethodTest.groovy b/src/test/groovy/ClosureMethodTest.groovy
index d29db1b..3b5de12 100644
--- a/src/test/groovy/ClosureMethodTest.groovy
+++ b/src/test/groovy/ClosureMethodTest.groovy
@@ -328,13 +328,11 @@ class ClosureMethodTest extends GroovyTestCase {
void testDump() {
def text = dump()
- println("Dumping object ${text}")
assert text != null && text.startsWith("<")
}
void testInspect() {
def text = [1, 2, 'three'].inspect()
- println("Inspecting ${text}")
assert text == "[1, 2, 'three']"
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureMethodsOnFileTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureMethodsOnFileTest.groovy b/src/test/groovy/ClosureMethodsOnFileTest.groovy
index 4d0ea75..ca54a11 100644
--- a/src/test/groovy/ClosureMethodsOnFileTest.groovy
+++ b/src/test/groovy/ClosureMethodsOnFileTest.groovy
@@ -37,11 +37,14 @@ class ClosureMethodsOnFileTest extends GroovyTestCase {
}
void testEachLine() {
- file.eachLine { line -> println(line) }
+ file.eachLine { line -> assert line != null }
}
void testEachLineWithCount() {
- file.eachLine { line, count -> println "$count > $line" }
+ int i = 0
+ file.eachLine { line, count ->
+ assert count == ++i && line != null
+ }
}
void testReadLines() {
@@ -51,8 +54,6 @@ class ClosureMethodsOnFileTest extends GroovyTestCase {
}
void testEachFile() {
- println("Closure loop to display contents of dir: " + dir)
- dir.eachFile { f -> println(f.getName()) }
- println("")
+ dir.eachFile { f -> assert f.getName() }
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureMissingMethodTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureMissingMethodTest.groovy b/src/test/groovy/ClosureMissingMethodTest.groovy
index 15b2082..f058b94 100644
--- a/src/test/groovy/ClosureMissingMethodTest.groovy
+++ b/src/test/groovy/ClosureMissingMethodTest.groovy
@@ -29,12 +29,10 @@ class ClosureMissingMethodTest extends GroovyTestCase {
int count = 0
foo = {
- println "inside foo"
count++
bar()
}
baz = {
- println "inside baz"
foo()
}
@@ -55,12 +53,10 @@ class ClosureMissingMethodTest extends GroovyTestCase {
int count = 0
def foo = {
- println "inside foo"
count++
bar()
}
def baz = {
- println "inside baz"
foo()
}
@@ -79,12 +75,10 @@ class ClosureMissingMethodTest extends GroovyTestCase {
int count = 0
foo = {
- println "inside foo"
count++
bar()
}
baz = {
- println "inside baz"
foo()
}
mc = new ExpandoMetaClass(baz.getClass())
@@ -108,12 +102,10 @@ class ClosureMissingMethodTest extends GroovyTestCase {
int count = 0
def foo = {
- println "inside foo"
count++
bar()
}
def baz = {
- println "inside baz"
foo()
}
MetaClass mc = new ExpandoMetaClass(baz.getClass())
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureTest.groovy b/src/test/groovy/ClosureTest.groovy
index 2c49f9b..c36d10a 100644
--- a/src/test/groovy/ClosureTest.groovy
+++ b/src/test/groovy/ClosureTest.groovy
@@ -93,9 +93,9 @@ class ClosureTest extends GroovyTestCase {
assert count == 1
- block = System.out.&println
+ block = Math.&min
- block.call("I just invoked a closure!")
+ assert block.call(3, 7) == 3
}
def incrementCallCount() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureUsingOuterVariablesTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureUsingOuterVariablesTest.groovy b/src/test/groovy/ClosureUsingOuterVariablesTest.groovy
index f10cccf..b1c4108 100644
--- a/src/test/groovy/ClosureUsingOuterVariablesTest.groovy
+++ b/src/test/groovy/ClosureUsingOuterVariablesTest.groovy
@@ -29,12 +29,9 @@ class ClosureUsingOuterVariablesTest extends GroovyTestCase {
def y = "hello"
def closure = { i ->
- println("x ${x}")
- println("y ${y}")
- println("i ${i}")
-
assert x == 123
assert y == 'hello'
+ assert i == 321
}
closure.call(321)
}
@@ -74,7 +71,6 @@ class ClosureUsingOuterVariablesTest extends GroovyTestCase {
def c = { b = a + it }
c(5)
- println(b)
assert b == a + 5
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureWithDefaultParamTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureWithDefaultParamTest.groovy b/src/test/groovy/ClosureWithDefaultParamTest.groovy
index 627e56e..dd293d6 100644
--- a/src/test/groovy/ClosureWithDefaultParamTest.groovy
+++ b/src/test/groovy/ClosureWithDefaultParamTest.groovy
@@ -91,9 +91,7 @@ class ClosureWithDefaultParamTest extends GroovyTestCase {
def keys = answer.collect {it.key }
def values = answer.collect {it.value }
- System.out.println("keys " + keys + " values " + values)
-
- // maps are in hash order so lets sort the results
+ // maps are in hash order so lets sort the results
keys.sort()
values.sort()
@@ -147,11 +145,7 @@ class ClosureWithDefaultParamTest extends GroovyTestCase {
void testEachLine() {
def file = new File("src/test/groovy/Bar.groovy")
- System.out.println("Contents of file: " + file)
-
- file.eachLine { println(it) }
-
- println("")
+ file.eachLine { assert it != null }
}
void testReadLines() {
@@ -161,17 +155,11 @@ class ClosureWithDefaultParamTest extends GroovyTestCase {
assert lines != null
assert lines.size() > 0
-
- System.out.println("File has number of lines: " + lines.size())
}
void testEachFile() {
def file = new File("src/test/groovy")
-
- System.out.println("Contents of dir: " + file)
-
- file.eachFile { println(it.getName()) }
-
- println("")
+
+ file.eachFile { assert it.getName() }
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ClosureWithEmptyParametersTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ClosureWithEmptyParametersTest.groovy b/src/test/groovy/ClosureWithEmptyParametersTest.groovy
index e306c73..c65a677 100644
--- a/src/test/groovy/ClosureWithEmptyParametersTest.groovy
+++ b/src/test/groovy/ClosureWithEmptyParametersTest.groovy
@@ -25,13 +25,9 @@ class ClosureWithEmptyParametersTest extends GroovyTestCase {
void testNoParams() {
- def block = {-> println "hey I'm a closure!" }
-
- println "About to call closure"
+ def block = {-> }
block.call()
-
- println "Done"
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/CompareEqualsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/CompareEqualsTest.groovy b/src/test/groovy/CompareEqualsTest.groovy
index 75a0fa4..ab9d056 100644
--- a/src/test/groovy/CompareEqualsTest.groovy
+++ b/src/test/groovy/CompareEqualsTest.groovy
@@ -33,12 +33,10 @@ class CompareEqualsTest extends GroovyTestCase {
class Xyz {
boolean equals(Xyz other) {
- println "${other.class} TRUE"
true
}
boolean equals(Object other) {
- println "${other.class} FALSE"
null
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/CompileOrderTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/CompileOrderTest.groovy b/src/test/groovy/CompileOrderTest.groovy
index 241824a..206158f 100644
--- a/src/test/groovy/CompileOrderTest.groovy
+++ b/src/test/groovy/CompileOrderTest.groovy
@@ -22,16 +22,13 @@ class CompileOrderTest extends GroovyTestCase {
public void testCompileOrder() {
def interfaceFile = File.createTempFile("TestOrderInterface", ".groovy", new File("target"))
def concreteFile = File.createTempFile("TestOrderConcrete", ".groovy", new File("target"))
-
def cl = new GroovyClassLoader(this.class.classLoader);
def currentDir = concreteFile.parentFile.absolutePath
- println currentDir
cl.addClasspath(currentDir)
cl.shouldRecompile = true
try {
// Create the interface
- println "a"
interfaceFile.deleteOnExit()
def interfaceName = interfaceFile.name - ".groovy"
interfaceFile.write "interface $interfaceName { }\n"
@@ -57,13 +54,11 @@ class CompileOrderTest extends GroovyTestCase {
def cl = new GroovyClassLoader(this.class.classLoader);
def currentDir = concreteFile.parentFile.absolutePath
- println currentDir
cl.addClasspath(currentDir)
cl.shouldRecompile = true
try {
// Create the interface
- println "a"
interfaceFile.deleteOnExit()
def interfaceName = interfaceFile.name - ".groovy"
interfaceFile.write "interface $interfaceName { }\n"
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/CompilerErrorTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/CompilerErrorTest.groovy b/src/test/groovy/CompilerErrorTest.groovy
index e8c6434..21b67be 100644
--- a/src/test/groovy/CompilerErrorTest.groovy
+++ b/src/test/groovy/CompilerErrorTest.groovy
@@ -23,12 +23,8 @@ class CompilerErrorTest extends GroovyTestCase {
void testBadMethodName() {
shouldFail {
- println "About to call shell script"
- println "Really am about to call shell script"
-
def shell = new GroovyShell()
def text = 'badMethod(); println "Called method"'
- println "About to test script ${text}"
shell.evaluate(text)
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/Constructor2Test.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/Constructor2Test.groovy b/src/test/groovy/Constructor2Test.groovy
index ffad35b..7fb042c 100644
--- a/src/test/groovy/Constructor2Test.groovy
+++ b/src/test/groovy/Constructor2Test.groovy
@@ -20,14 +20,11 @@ package groovy
class Constructor2Test extends GroovyTestCase {
- Constructor2Test() {
- println "Hey"
- }
+ Constructor2Test() { }
void testConstructor() {
def foo = new Constructor2Test()
assert foo != null
- println foo
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ConstructorTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ConstructorTest.groovy b/src/test/groovy/ConstructorTest.groovy
index 8403081..b22d0c3 100644
--- a/src/test/groovy/ConstructorTest.groovy
+++ b/src/test/groovy/ConstructorTest.groovy
@@ -20,14 +20,11 @@ package groovy
class ConstructorTest extends GroovyTestCase {
- public ConstructorTest() {
- println "Hey"
- }
+ public ConstructorTest() { }
public void testConstructor() {
def foo = new ConstructorTest()
assert foo != null
- println foo
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/CurlyBracketLayoutTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/CurlyBracketLayoutTest.groovy b/src/test/groovy/CurlyBracketLayoutTest.groovy
index c1e98c3..64d8745 100644
--- a/src/test/groovy/CurlyBracketLayoutTest.groovy
+++ b/src/test/groovy/CurlyBracketLayoutTest.groovy
@@ -26,7 +26,7 @@ class CurlyBracketLayoutTest extends GroovyTestCase
if (foo.contains("b"))
{
- println "Worked a treat. foo = $foo"
+ // expected
}
else
{
@@ -36,7 +36,7 @@ class CurlyBracketLayoutTest extends GroovyTestCase
def list = [1, 2, 3]
list.each
{
- println it
+ assert it >= 1 && it <= 3
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/DefaultParamClosureTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/DefaultParamClosureTest.groovy b/src/test/groovy/DefaultParamClosureTest.groovy
index 77e9b1d..fb90f23 100644
--- a/src/test/groovy/DefaultParamClosureTest.groovy
+++ b/src/test/groovy/DefaultParamClosureTest.groovy
@@ -23,7 +23,6 @@ class DefaultParamClosureTest extends GroovyTestCase {
void testDefaultParameters() {
// Default parameters working for closures
def doSomething = { a, b = 'defB', c = 'defC' ->
- println "Called with a: ${a}, b ${b}, c ${c}"
return a + "-" + b + "-" + c
}
@@ -42,7 +41,6 @@ class DefaultParamClosureTest extends GroovyTestCase {
void testDefaultTypedParameters() {
// Handle typed parameters
def doTypedSomething = { String a = 'defA', String b = 'defB', String c = 'defC' ->
- println "Called typed method with a: ${a}, b ${b}, c ${c}"
return a + "-" + b + "-" + c
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ExceptionInClosureTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ExceptionInClosureTest.groovy b/src/test/groovy/ExceptionInClosureTest.groovy
index 8d594ad..56caef0 100644
--- a/src/test/groovy/ExceptionInClosureTest.groovy
+++ b/src/test/groovy/ExceptionInClosureTest.groovy
@@ -34,8 +34,6 @@ class ExceptionInClosureTest extends GroovyTestCase {
fail("Should have thrown an exception by now")
}
catch (MissingMethodException e) {
- System.out.println("Caught: " + e)
-
assert e.method == "foo"
assert e.type == String
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ExpandoPropertyTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ExpandoPropertyTest.groovy b/src/test/groovy/ExpandoPropertyTest.groovy
index 26a0c13..fcd27a0 100644
--- a/src/test/groovy/ExpandoPropertyTest.groovy
+++ b/src/test/groovy/ExpandoPropertyTest.groovy
@@ -38,7 +38,7 @@ class ExpandoPropertyTest extends GroovyTestCase {
foo.cheese = "Cheddar"
foo.fullName = "Gromit"
foo.nameLength = { return fullName.length() }
- foo.multiParam = { a, b, c -> println("Called with ${a}, ${b}, ${c}"); return a + b + c }
+ foo.multiParam = { a, b, c -> return a + b + c }
assert foo.cheese == "Cheddar"
assert foo.fullName == "Gromit"
@@ -64,7 +64,6 @@ class ExpandoPropertyTest extends GroovyTestCase {
void testExpandoConstructorAndToString() {
def foo = new Expando(type: "sometype", value: 42)
- println foo
assert foo.toString() == "{type=sometype, value=42}"
assert "${foo}" == "{type=sometype, value=42}"
}
@@ -74,7 +73,6 @@ class ExpandoPropertyTest extends GroovyTestCase {
def foo = new Expando(type: "myfoo", value: 42, equals: equals)
def bar = new Expando(type: "mybar", value: 43, equals: equals)
def zap = new Expando(type: "myzap", value: 42, equals: equals)
- println(foo)
assert foo.equals(bar) == false
assert foo.equals(zap) == true
@@ -82,7 +80,6 @@ class ExpandoPropertyTest extends GroovyTestCase {
def list = []
list << foo
list << bar
- println list
assert list.contains(foo) == true
assert list.contains(bar) == true
@@ -90,16 +87,10 @@ class ExpandoPropertyTest extends GroovyTestCase {
assert list.indexOf(bar) == 1
assert list.indexOf(foo) == 0
- println "hashCode: " + foo.hashCode()
-
foo.hashCode = { return value }
- println("hashCode: " + foo.hashCode())
-
assert foo.hashCode() == foo.value
- println("toString: " + foo.toString())
foo.toString = { return "Type: ${type}, Value: ${value}" }
- println("toString: " + foo.toString())
assert foo.toString() == "Type: myfoo, Value: 42"
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ForLoopTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ForLoopTest.groovy b/src/test/groovy/ForLoopTest.groovy
index 777cdd8..84366de 100644
--- a/src/test/groovy/ForLoopTest.groovy
+++ b/src/test/groovy/ForLoopTest.groovy
@@ -91,8 +91,6 @@ class ForLoopTest extends gls.CompilableTestSupport {
void testArray() {
def array = (0..4).toArray()
- println "Class: ${array.getClass()} for array ${array}"
-
x = 0
for (i in array) {
@@ -105,8 +103,6 @@ class ForLoopTest extends gls.CompilableTestSupport {
void testIntArray() {
def array = TestSupport.getIntArray()
- println "Class: ${array.getClass()} for array ${array}"
-
x = 0
for (i in array) {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/GStringTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/GStringTest.groovy b/src/test/groovy/GStringTest.groovy
index 10d2488..5e58e14 100644
--- a/src/test/groovy/GStringTest.groovy
+++ b/src/test/groovy/GStringTest.groovy
@@ -46,10 +46,10 @@ class GStringTest extends GroovyTestCase {
check("hello $name how are you?", teststr)
check("hello ${name} how are you?", teststr)
- check("hello ${println "feep"; name} how are you?", teststr)
+ check("hello ${(name + ' ').trim()} how are you?", teststr)
check(/hello $name how are you?/, teststr)
check(/hello ${name} how are you?/, teststr)
- check(/hello ${println "feep"; name} how are you?/, teststr)
+ check(/hello ${(name + ' ').trim()} how are you?/, teststr)
}
void testWithVariableAtEnd() {
@@ -238,12 +238,12 @@ class GStringTest extends GroovyTestCase {
assertEquals(w.buffer.toString(), "5")
assertEquals(g4.toString(), "5")
try {
- println g5
+ w << g5
fail("should throw a GroovyRuntimeException")
} catch (GroovyRuntimeException e) {
}
try {
- println g5.toString()
+ g5.toString()
fail("should throw a GroovyRuntimeException")
} catch (GroovyRuntimeException e) {
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/GeneratorTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/GeneratorTest.groovy b/src/test/groovy/GeneratorTest.groovy
index 19bd304..ac76ac7 100644
--- a/src/test/groovy/GeneratorTest.groovy
+++ b/src/test/groovy/GeneratorTest.groovy
@@ -44,8 +44,8 @@ class GeneratorTest extends GroovyTestCase {
void testEach() {
def x = this.&sampleGenerator
-
- def value = x.each { println(it) }
+ def expected = ['A', 'B', 'C']
+ def value = x.each { assert it == expected.remove(0) }
}
void testMissingThisBug() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/GroovyClosureMethodsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/GroovyClosureMethodsTest.groovy b/src/test/groovy/GroovyClosureMethodsTest.groovy
index 937798b..256d1f6 100644
--- a/src/test/groovy/GroovyClosureMethodsTest.groovy
+++ b/src/test/groovy/GroovyClosureMethodsTest.groovy
@@ -43,14 +43,11 @@ class GroovyClosureMethodsTest extends GroovyTestCase {
oos.writeObject(it)
}
- println("Contents of file with multiple objects: " + file)
int c = 0
file.eachObject {
- print "${it} "
c++
}
assert list.size() == c
- println ""
//ensure to remove the created file
file.delete()
}
@@ -60,14 +57,11 @@ class GroovyClosureMethodsTest extends GroovyTestCase {
def oos = new ObjectOutputStream(new FileOutputStream(file))
oos.writeObject(file)
- println("Contents of file with one object: " + file)
int c = 0
file.eachObject {
- print "${it} "
c++
}
assert c == 1
- println ""
//ensure to remove the created file
file.delete()
}
@@ -76,14 +70,12 @@ class GroovyClosureMethodsTest extends GroovyTestCase {
def file = new File(filename)
def oos = new ObjectOutputStream(new FileOutputStream(file))
- println("Contents of empty file: " + file)
int c = 0
file.eachObject {
print "${it} "
c++
}
assert c == 0
- println ""
//ensure to remove the created file
file.delete()
}
@@ -95,14 +87,11 @@ class GroovyClosureMethodsTest extends GroovyTestCase {
oos.writeObject("foo")
oos.writeObject(null)
- println("Contents of null file: " + file)
int c = 0
file.eachObject {
- print "${it} "
c++
}
assert c == 3
- println ""
//ensure to remove the created file
file.delete()
}
@@ -110,39 +99,33 @@ class GroovyClosureMethodsTest extends GroovyTestCase {
void testEachDir() {
def dir = new File(dirname_source)
- println("Directories in: " + dir)
int c = 0
dir.eachDir {
- print "${it} "
c++
}
- println ""
assert c > 0
}
void testEachFileMatch() {
def file = new File(dirname_source)
- print "Files with the text Groovy: "
+ int c = 0
file.eachFileMatch(~"^Groovy.*") {
- print "${it} "
+ c++
}
- println ""
+ assert c > 0
- print "Files with the text Closure: "
+ c = 0
file.eachFileMatch(~"^Closure.*") {
- print "${it} "
+ c++
}
- println ""
+ assert c > 0
- print "This file is here: "
- int c = 0
+ c = 0
file.eachFileMatch(~"^GroovyClosureMethodsTest.groovy") {
- print "${it} "
c++
}
assert c == 1
- println ""
}
void testEachFileOnNonExistingDir() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/GroovyMethodsTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/GroovyMethodsTest.groovy b/src/test/groovy/GroovyMethodsTest.groovy
index 67ef50f..cf55750 100644
--- a/src/test/groovy/GroovyMethodsTest.groovy
+++ b/src/test/groovy/GroovyMethodsTest.groovy
@@ -433,15 +433,6 @@ class GroovyMethodsTest extends GroovyTestCase {
assert map.size() == 2
}
- void testDisplaySystemProperties() {
- println "System properties are..."
- def properties = System.properties
- def keys = properties.keySet().sort()
- for (k in keys) {
- println "${k} = ${properties[k]}"
- }
- }
-
void testInForLists() {
def list = ['a', 'b', 'c']
assert 'b' in list
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/IfPropertyTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/IfPropertyTest.groovy b/src/test/groovy/IfPropertyTest.groovy
index dbb10ac..820a305 100644
--- a/src/test/groovy/IfPropertyTest.groovy
+++ b/src/test/groovy/IfPropertyTest.groovy
@@ -24,17 +24,14 @@ class IfPropertyTest extends GroovyTestCase {
// This is because normal classes are not extensible, but scripts are extensible by default.
Object get(String key) {
- println("asking for def " + key)
return dummy
}
void set(Object key, Object value) {
- println("setting the def " + key + " to: " + value)
dummy = value
}
void testIfNullPropertySet() {
- def cheese = null
if (cheese == null) {
cheese = 1
}
@@ -45,7 +42,6 @@ class IfPropertyTest extends GroovyTestCase {
}
void testIfNullPropertySetRecheck() {
- def cheese = null
if (cheese == null) {
cheese = 1
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/IfTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/IfTest.groovy b/src/test/groovy/IfTest.groovy
index f74f2c2..c742260 100644
--- a/src/test/groovy/IfTest.groovy
+++ b/src/test/groovy/IfTest.groovy
@@ -24,7 +24,7 @@ class IfTest extends GroovyTestCase {
def x = 1
if (x) {
- println "${x} is true"
+ // expected
}
else {
fail("should not be false")
@@ -36,7 +36,7 @@ class IfTest extends GroovyTestCase {
fail("should not be true")
}
else {
- println "${x} is false"
+ // expected
}
}
@@ -45,7 +45,7 @@ class IfTest extends GroovyTestCase {
def x = "abc"
if (x) {
- println "${x} is true"
+ // expected
}
else {
fail("should not be false")
@@ -57,7 +57,7 @@ class IfTest extends GroovyTestCase {
fail("should not be true")
}
else {
- println "${x} is false"
+ // expected
}
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/LeftShiftTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/LeftShiftTest.groovy b/src/test/groovy/LeftShiftTest.groovy
index cae4533..fef784c 100644
--- a/src/test/groovy/LeftShiftTest.groovy
+++ b/src/test/groovy/LeftShiftTest.groovy
@@ -27,8 +27,6 @@ class LeftShiftTest extends GroovyTestCase {
def y = x << 2
- println "Value is $y"
-
assert y == 16
assert x << 2 == 16
@@ -40,8 +38,6 @@ class LeftShiftTest extends GroovyTestCase {
for (i in 1..10) {
list << i
}
-
- println "List is $list"
}
void testLeftShiftOnExpression() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/LoopBreakTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/LoopBreakTest.groovy b/src/test/groovy/LoopBreakTest.groovy
index bdfb61b..550c81f 100644
--- a/src/test/groovy/LoopBreakTest.groovy
+++ b/src/test/groovy/LoopBreakTest.groovy
@@ -30,8 +30,6 @@ class LoopBreakTest extends GroovyTestCase {
assert x < 10 , "Should never get here"
}
-
- println "worked: while completed with value ${x}"
}
/**
@@ -65,7 +63,5 @@ class LoopBreakTest extends GroovyTestCase {
}
assert x < 10 , "Should never get here"
}
-
- println "worked: for loop completed with value ${returnValue}"
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/MapConstructionTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/MapConstructionTest.groovy b/src/test/groovy/MapConstructionTest.groovy
index 5f047ba..23e3033 100644
--- a/src/test/groovy/MapConstructionTest.groovy
+++ b/src/test/groovy/MapConstructionTest.groovy
@@ -28,13 +28,10 @@ class MapConstructionTest extends GroovyTestCase {
void testMap() {
def m = [ 1 : 'abc', 2 : 'def', 3 : 'xyz' ]
- println(m)
-
def mtoo = [ 1 : [ "innerKey" : "innerValue" ], 2 : m ]
- println(mtoo)
-
assertMap(m)
+ assert mtoo[2][2] == 'def'
}
void testMapAsParameter() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/MethodCallTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/MethodCallTest.groovy b/src/test/groovy/MethodCallTest.groovy
index 5fa0d2f..b485b48 100644
--- a/src/test/groovy/MethodCallTest.groovy
+++ b/src/test/groovy/MethodCallTest.groovy
@@ -21,8 +21,7 @@ package groovy
class MethodCallTest extends GroovyTestCase {
void testMethodCall() {
- System.out.print("hello")
- println("world!")
+ assert Math.max(5, 7) == 7
}
void testObjectMethodCall() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/MethodCallWithoutParenthesisTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/MethodCallWithoutParenthesisTest.groovy b/src/test/groovy/MethodCallWithoutParenthesisTest.groovy
index 0a208aa..233d17c 100644
--- a/src/test/groovy/MethodCallWithoutParenthesisTest.groovy
+++ b/src/test/groovy/MethodCallWithoutParenthesisTest.groovy
@@ -39,7 +39,6 @@ class MethodCallWithoutParenthesisTest extends GroovyTestCase {
}
void methodWithOneParam(text) {
- println("Called method with parameter ${text}")
assert text == "hello"
flag = true
}
@@ -61,7 +60,6 @@ class MethodCallWithoutParenthesisTest extends GroovyTestCase {
}
def methodWithTwoParams(a, b) {
- println("Called method with parameters ${a} and ${b}")
return a + b
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/MinMaxTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/MinMaxTest.groovy b/src/test/groovy/MinMaxTest.groovy
index cd9152a..131ab39 100644
--- a/src/test/groovy/MinMaxTest.groovy
+++ b/src/test/groovy/MinMaxTest.groovy
@@ -42,12 +42,8 @@ class MinMaxTest extends GroovyTestCase {
def order = new OrderBy( { it.get('@cheese') } )
- println("People ${people}")
-
def p = people.min(order)
- println("Found ${p}")
-
assert p.get("@name") == "Joe" , "found person ${p}"
p = people.max(order)
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/MultilineStringTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/MultilineStringTest.groovy b/src/test/groovy/MultilineStringTest.groovy
index 9a0891a..f3ba72e 100644
--- a/src/test/groovy/MultilineStringTest.groovy
+++ b/src/test/groovy/MultilineStringTest.groovy
@@ -27,7 +27,6 @@ efg
hijk
"""
- println(s)
assert s != null
def idx = s.indexOf("i")
assert idx > 0
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/NewExpressionTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/NewExpressionTest.groovy b/src/test/groovy/NewExpressionTest.groovy
index 36a6a31..16a9b72 100644
--- a/src/test/groovy/NewExpressionTest.groovy
+++ b/src/test/groovy/NewExpressionTest.groovy
@@ -26,8 +26,6 @@ class NewExpressionTest extends GroovyTestCase {
def cheese = new String( "hey you hosers" )
assert cheese != null
-
- println(cheese)
}
void testNewBeanNoArgs() {
@@ -57,8 +55,6 @@ class NewExpressionTest extends GroovyTestCase {
void testNewInstanceWithFullyQualifiedNameNotImported() {
def bean = new java.io.File("Foo")
- println "Created $bean"
-
assert bean != null
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/SafeNavigationTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/SafeNavigationTest.groovy b/src/test/groovy/SafeNavigationTest.groovy
index ba81f73..d0dd7cf 100644
--- a/src/test/groovy/SafeNavigationTest.groovy
+++ b/src/test/groovy/SafeNavigationTest.groovy
@@ -29,7 +29,6 @@ class SafeNavigationTest extends GroovyTestCase {
void testNormalPropertyNavigation() {
def x = ['a':456, 'foo':['bar':123, 'x':456], 'z':99]
def y = x?.foo?.bar
- println("found y ${x?.foo?.bar}")
assert y == 123
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/SimplePostfixTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/SimplePostfixTest.groovy b/src/test/groovy/SimplePostfixTest.groovy
index 4102fef..781fcb7 100644
--- a/src/test/groovy/SimplePostfixTest.groovy
+++ b/src/test/groovy/SimplePostfixTest.groovy
@@ -23,8 +23,6 @@ class SimplePostfixTest extends GroovyTestCase {
void testPostfix() {
def x = 1
++x
- println(x)
-
assert x == 2
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/SingletonBugTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/SingletonBugTest.groovy b/src/test/groovy/SingletonBugTest.groovy
index 273354a..f06c20c 100644
--- a/src/test/groovy/SingletonBugTest.groovy
+++ b/src/test/groovy/SingletonBugTest.groovy
@@ -17,32 +17,24 @@
* under the License.
*/
package groovy
-// TODO: GROOVY-435
+// GROOVY-435
class SingletonBugTest extends GroovyTestCase {
public void testPrivate() {
def x = SingletonBugPrivate.getInstance()
def y = SingletonBugPrivate.getInstance()
- println "Get one private instance: $x"
- println "Get another private instance: $y"
assert x == y
- println(SingletonBugPrivateSecond.getInstanceSecond())
- println(SingletonBugPrivateSecond.doTestSecond())
- // shouldFail { println(SingletonBugPrivateSecond.getInstanceSecond()) }
- // shouldFail { println(SingletonBugPrivateSecond.doTestSecond()) }
+ SingletonBugPrivateSecond.getInstanceSecond() // shouldFail? - super class has single private constructor
+ SingletonBugPrivateSecond.doTestSecond() // shouldFail? - super class has single private constructor
}
public void testProtected() {
def x = SingletonBugProtected.getInstance()
def y = SingletonBugProtected.getInstance()
- println "Get one protected instance: $x"
- println "Get another protected instance: $y"
assert x == y
- println(SingletonBugProtectedSecond.getInstanceSecond())
- println(SingletonBugProtectedSecond.doTestSecond())
x = SingletonBugProtectedSecond.getInstanceSecond()
y = SingletonBugProtectedSecond.doTestSecond()
assert x != y
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/SpreadDotTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/SpreadDotTest.groovy b/src/test/groovy/SpreadDotTest.groovy
index 588b0a5..3edd010 100644
--- a/src/test/groovy/SpreadDotTest.groovy
+++ b/src/test/groovy/SpreadDotTest.groovy
@@ -35,27 +35,28 @@ public class SpreadDotTest extends GroovyTestCase {
def m2 = ["a":11, "b":22]
def m3 = ["a":111, "b":222]
def x = [m1,m2,m3]
- println x*.a
- println x*."a"
+ assert x*.a == [1, 11, 111]
+ assert x*."a" == [1, 11, 111]
assert x == [m1, m2, m3]
def m4 = null
x << m4
- println x*.a
- println x*."a"
+ assert x*.a == [1, 11, 111, null]
+ assert x*."a" == [1, 11, 111, null]
assert x == [m1, m2, m3, null]
+ Date checkDate = new Date()
def d = new SpreadDotDemo()
x << d
- println x*."a"
+ assert x*."a"[4] >= checkDate
assert x == [m1, m2, m3, null, d]
def y = new SpreadDotDemo2()
- println y."a"
- println y.a
+ assert y."a" == 'Attribute Get a'
+ assert y.a == 'Attribute Get a'
x << y
- println x*."a"
+ assert x*."a"[5] == 'Attribute Get a'
assert x == [m1, m2, m3, null, d, y]
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/StringBufferTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/StringBufferTest.groovy b/src/test/groovy/StringBufferTest.groovy
index 4ac6f3d..976a703 100644
--- a/src/test/groovy/StringBufferTest.groovy
+++ b/src/test/groovy/StringBufferTest.groovy
@@ -38,7 +38,6 @@ class StringBufferTest extends GroovyTestCase {
assert 'xx0123' == buf.toString(), 'border case left'
buf = new StringBuffer('0123')
buf[4..4] = 'xx'
- println buf.toString()
assert '0123xx' == buf.toString(), 'border case right'
// more weird Ranges already tested in ListTest
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ThrowTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ThrowTest.groovy b/src/test/groovy/ThrowTest.groovy
index ec6531d..b67c21c 100644
--- a/src/test/groovy/ThrowTest.groovy
+++ b/src/test/groovy/ThrowTest.groovy
@@ -26,7 +26,6 @@ class ThrowTest extends GroovyTestCase {
}
catch (Exception e) {
assert e.message == "abcd"
- println("Caught exception ${e}")
}
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/ToArrayBugTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/ToArrayBugTest.groovy b/src/test/groovy/ToArrayBugTest.groovy
index 48f4d1f..0e31c9f 100644
--- a/src/test/groovy/ToArrayBugTest.groovy
+++ b/src/test/groovy/ToArrayBugTest.groovy
@@ -37,8 +37,6 @@ class ToArrayBugTest extends GroovyTestCase {
}
protected def callArrayMethod(array) {
- System.out.println("Called method with ${array}")
-
def list = Arrays.asList(array)
assert list.size() == 4
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/TripleQuotedStringTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/TripleQuotedStringTest.groovy b/src/test/groovy/TripleQuotedStringTest.groovy
index d06a086..dec8a11 100644
--- a/src/test/groovy/TripleQuotedStringTest.groovy
+++ b/src/test/groovy/TripleQuotedStringTest.groovy
@@ -27,7 +27,6 @@ class TripleQuotedStringTest extends GroovyTestCase {
and some escaped \""" quoting and
an ending""".trim()
- println(s)
assert s != null
def idx = s.indexOf("quoting and")
assert idx > 0
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/TryCatchTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/TryCatchTest.groovy b/src/test/groovy/TryCatchTest.groovy
index 663e5d2..e3bcd7f 100644
--- a/src/test/groovy/TryCatchTest.groovy
+++ b/src/test/groovy/TryCatchTest.groovy
@@ -38,7 +38,6 @@ class TryCatchTest extends CompilableTestSupport {
afterTryCatch()
assert exceptionCalled, "should have invoked the catch clause"
assert finallyCalled, "should have invoked the finally clause"
- println("After try/catch")
}
void testStandaloneTryBlockShouldNotCompile() {
@@ -73,7 +72,6 @@ class TryCatchTest extends CompilableTestSupport {
}
assert !exceptionCalled, "should not invoked the catch clause"
assert finallyCalled, "should have invoked the finally clause"
- println "After try/catch"
}
void failingMethod() {
@@ -96,7 +94,6 @@ class TryCatchTest extends CompilableTestSupport {
void afterTryCatch() {
assert exceptionCalled, "should have invoked the catch clause"
assert finallyCalled, "should have invoked the finally clause"
- println("After try/catch")
}
protected void setUp() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/WhileLoopTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/WhileLoopTest.groovy b/src/test/groovy/WhileLoopTest.groovy
index 0c317c3..a63e6cc 100644
--- a/src/test/groovy/WhileLoopTest.groovy
+++ b/src/test/groovy/WhileLoopTest.groovy
@@ -22,7 +22,7 @@ class WhileLoopTest extends GroovyTestCase {
void testVerySimpleWhile() {
def val = doWhileMethod(0, 5)
- println(val)
+ assert val == 5
}
void testWhileWithEmptyBody() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy b/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
index 153df99..76f7eb7 100644
--- a/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
+++ b/src/test/groovy/bugs/AmbiguousListOrMethodTest.groovy
@@ -24,35 +24,26 @@ class AmbiguousListOrMethodTest extends GroovyTestCase {
def foo = [3, 2, 3]
def val = foo [0]
- println val
assert val == 3
}
void testUndefinedPropertyVersion() {
- try {
+ shouldFail(MissingPropertyException) {
def val = this.foo [0]
- println val
- }
- catch (MissingPropertyException e) {
- println "Worked! Caught missing property $e"
}
}
void testMethodCallVersion() {
def val = foo([0])
- println val
assert val == 1
}
def foo(int val) {
- println "Calling foo method with a int param of val"
- println val
return null
}
def foo(List myList) {
- println "Calling foo method with a list param of $myList"
return myList.size()
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/AsBoolBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/AsBoolBug.groovy b/src/test/groovy/bugs/AsBoolBug.groovy
index a77067c..d8f3f7e 100644
--- a/src/test/groovy/bugs/AsBoolBug.groovy
+++ b/src/test/groovy/bugs/AsBoolBug.groovy
@@ -29,19 +29,15 @@ public class AsBoolBug extends GroovyTestCase {
void testMapAsBool() {
def a = ["A":123]
- println ("$a : ${a as Boolean}")
assert a as Boolean == true
a = [:]
- println ("$a : ${a as Boolean}")
assert a as Boolean == false
}
void testListAsBool() {
def b = [123]
- println ("$b : ${b as Boolean}")
assert b as Boolean == true
b = []
- println ("$b : ${b as Boolean}")
assert b as Boolean == false
}
@@ -57,32 +53,19 @@ public class AsBoolBug extends GroovyTestCase {
// This is a test case against GROOVY-812
void testStringAsBool() {
def c = "false"
- println ("$c : ${c as Boolean}")
assert c as Boolean == true
assert c as Boolean == (c != null && c.length() > 0)
boolean z = c
- println ("$z")
assert z == true
- if (c)
- println "It is true!!"
- else
- println "It is false!!"
c = "123"
- println ("$c : ${c as Boolean}")
assert c as Boolean == true
assert c as Boolean == (c != null && c.length() > 0)
c = "False"
- println ("$c : ${c as Boolean}")
assert c as Boolean == true
assert c as Boolean == (c != null && c.length() > 0)
- if (c)
- println "It is true!!"
- else
- println "It is false!!"
z = c
- println ("$z")
assert z
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy b/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
index bbb3b15..8eaf28a 100644
--- a/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
+++ b/src/test/groovy/bugs/AssignmentInsideExpressionBug.groovy
@@ -25,11 +25,15 @@ class AssignmentInsideExpressionBug extends GroovyTestCase {
void testBug() {
def x
if ((x = someMethod()) != null) {
- println x
+ assert x == 'worked!'
+ } else {
+ fail('x should not be null')
}
def y
if ((y = getFoo()) > 5) {
- println "y is greater than 5"
+ assert y == 7
+ } else {
+ fail("y [${y}] should be greater than 5")
}
def a = 123, b = 123
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/BlockAsClosureBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/BlockAsClosureBug.groovy b/src/test/groovy/bugs/BlockAsClosureBug.groovy
index 1584dbb..41da92b 100644
--- a/src/test/groovy/bugs/BlockAsClosureBug.groovy
+++ b/src/test/groovy/bugs/BlockAsClosureBug.groovy
@@ -27,8 +27,6 @@ class BlockAsClosureBug extends GroovyTestCase {
c = 9
}
- println(c)
-
assert c == 9
}
@@ -47,8 +45,6 @@ class BlockAsClosureBug extends GroovyTestCase {
c = 9
}
- println(c)
-
assert c == 9
}
@@ -58,7 +54,6 @@ class BlockAsClosureBug extends GroovyTestCase {
block: {
c = 9
}
- println(c)
assert c == 9
return 5
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Bytecode2Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Bytecode2Bug.groovy b/src/test/groovy/bugs/Bytecode2Bug.groovy
index c5425fc..b6e27b6 100644
--- a/src/test/groovy/bugs/Bytecode2Bug.groovy
+++ b/src/test/groovy/bugs/Bytecode2Bug.groovy
@@ -44,9 +44,7 @@ class Bytecode2Bug extends GroovyTestCase {
assert m[2] == 2
assert m[3] == 3
assert m[4] == 4
-
- println("created: ${m}")
-
+
assert i == 5
}
@@ -61,8 +59,6 @@ class Bytecode2Bug extends GroovyTestCase {
assert m[3] == 3
assert m[4] == 4
- println("created: ${m}")
-
assert i == 5
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/ClosureVariableBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/ClosureVariableBug.groovy b/src/test/groovy/bugs/ClosureVariableBug.groovy
index cea2bd3..a2f8f82 100644
--- a/src/test/groovy/bugs/ClosureVariableBug.groovy
+++ b/src/test/groovy/bugs/ClosureVariableBug.groovy
@@ -38,8 +38,6 @@ class ClosureVariableBug extends GroovyTestCase {
assert foo.a != null
- println "Foo has a = ${foo.a}"
-
def value = foo.a()
assert value == 123
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/ConstructorBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/ConstructorBug.groovy b/src/test/groovy/bugs/ConstructorBug.groovy
index 602fcdc..0c58a2e 100644
--- a/src/test/groovy/bugs/ConstructorBug.groovy
+++ b/src/test/groovy/bugs/ConstructorBug.groovy
@@ -29,13 +29,9 @@ class ConstructorBug extends GroovyTestCase {
def type = new GroovyClassLoader().parseClass(new File("src/test/groovy/bugs/TestBase.groovy"))
assert type != null
- println "created type: ${type}"
-
type = new GroovyClassLoader().parseClass(new File("src/test/groovy/bugs/TestDerived.groovy"))
assert type != null
- println "created type: ${type} of type: ${type.class}"
-
def mytest = InvokerHelper.invokeConstructorOf(type, ["Hello"] as Object[])
assert mytest.foo == "Hello"
/** @todo fix bug
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/ConstructorThisCallBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/ConstructorThisCallBug.groovy b/src/test/groovy/bugs/ConstructorThisCallBug.groovy
index 971d682..fd70783 100644
--- a/src/test/groovy/bugs/ConstructorThisCallBug.groovy
+++ b/src/test/groovy/bugs/ConstructorThisCallBug.groovy
@@ -29,8 +29,7 @@ package groovy.bugs
public class ConstructorThisCallBug extends GroovyTestCase {
public void testCallA() {
- println "Testing for a class without call()"
- def a1 = new ConstructorCallA("foo")
+ def a1 = new ConstructorCallA("foo")
def a2 = new ConstructorCallA(9)
def a3 = new ConstructorCallA()
}
@@ -39,15 +38,12 @@ public class ConstructorThisCallBug extends GroovyTestCase {
public class ConstructorCallA {
public ConstructorCallA() {
this(19) // call another constructor
- println "(1) no argument consructor"
- }
+ }
public ConstructorCallA(String a) {
- println "(2) String value a = $a"
- }
+ }
public ConstructorCallA(int a) {
this("" + (a*a)) // call another constructor
- println "(3) int value a = $a"
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/ForLoopBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/ForLoopBug.groovy b/src/test/groovy/bugs/ForLoopBug.groovy
index 780ba52..00887a9 100644
--- a/src/test/groovy/bugs/ForLoopBug.groovy
+++ b/src/test/groovy/bugs/ForLoopBug.groovy
@@ -59,7 +59,6 @@ class ForLoopBug extends GroovyTestCase {
def lastIndex
for (i in a..b) {
- println i
lastIndex = i
}
a = lastIndex
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/GetterBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/GetterBug.groovy b/src/test/groovy/bugs/GetterBug.groovy
index 29f2631..013e516 100644
--- a/src/test/groovy/bugs/GetterBug.groovy
+++ b/src/test/groovy/bugs/GetterBug.groovy
@@ -37,12 +37,8 @@ class GetterBug extends GroovyTestCase {
}
void testTypedGetterAndSetter() {
- println "Running test"
-
def value = getFoo()
- println "Value is ${value}"
-
assert value == "James"
setFoo("Bob")
@@ -65,12 +61,8 @@ class GetterBug extends GroovyTestCase {
void testUntypedGetterAndSetter() {
- println "Running test"
-
def value = getBar()
- println "Value is ${value}"
-
assert value == "James"
setBar("Bob")
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy2350Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy2350Bug.groovy b/src/test/groovy/bugs/Groovy2350Bug.groovy
index 0e14482..50c466f 100644
--- a/src/test/groovy/bugs/Groovy2350Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2350Bug.groovy
@@ -23,7 +23,6 @@ class Groovy2350Bug extends GroovyTestCase{
void testNoArg () {
shouldFail (org.codehaus.groovy.runtime.metaclass.MethodSelectionException) {
def a = new DefaultNoArgCtor()
- println a
}
assertEquals "NULL", new DefaultNoArgCtor2().value
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy2365Bug.java
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy2365Bug.java b/src/test/groovy/bugs/Groovy2365Bug.java
index 07c0718..7e11ace 100644
--- a/src/test/groovy/bugs/Groovy2365Bug.java
+++ b/src/test/groovy/bugs/Groovy2365Bug.java
@@ -30,9 +30,7 @@ public class Groovy2365Bug extends Groovy2365Base {
String path = createData();
try {
- System.out.println("Test started");
for (int i = 0; i != 100; ++i ) {
- System.out.println("Iter " + i);
final GroovyClassLoader groovyLoader = new GroovyClassLoader ();
groovyLoader.addClasspath(path);
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy2490Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy2490Bug.groovy b/src/test/groovy/bugs/Groovy2490Bug.groovy
index c80f9ea..58179d3 100644
--- a/src/test/groovy/bugs/Groovy2490Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2490Bug.groovy
@@ -20,8 +20,6 @@ package groovy.bugs
class Groovy2490Bug extends GroovyTestCase {
void test () {
- System.out.println("One.foo = " + One.foo);
- System.out.println("Two.foo = " + Two.foo);
assertEquals One.foo, "hello"
assertEquals Two.foo, "goodbye"
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy2666Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy2666Bug.groovy b/src/test/groovy/bugs/Groovy2666Bug.groovy
index f91c12e..fa4c0da 100644
--- a/src/test/groovy/bugs/Groovy2666Bug.groovy
+++ b/src/test/groovy/bugs/Groovy2666Bug.groovy
@@ -31,7 +31,7 @@ class Groovy2666Bug extends GroovyTestCase{
try {
ex ()
} catch (org.codehaus.groovy.GroovyBugError e) {
- println "caught"
+ // expected
return
} catch (NullPointerException e) {
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3156And2621Bug.groovy b/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
index 5a03b4d..5f26e97 100644
--- a/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3156And2621Bug.groovy
@@ -44,7 +44,6 @@ class Groovy3156And2621Bug extends GroovyTestCase {
}
void convention(String arg) {
- println 'called'
}
void failingExecute() {
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy3335Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3335Bug.groovy b/src/test/groovy/bugs/Groovy3335Bug.groovy
index 69fb980..50604ac 100644
--- a/src/test/groovy/bugs/Groovy3335Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3335Bug.groovy
@@ -22,6 +22,6 @@ class Groovy3335Bug extends GroovyTestCase {
void testClassToString() {
// the following call was resulting in a MethodSelectionException
// because Integer class defines static toString(int) and toString(int, int) methods
- println Integer.class.toString()
+ assert Integer.class.toString()
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy3403Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3403Bug.groovy b/src/test/groovy/bugs/Groovy3403Bug.groovy
index f6137d9..c77d198 100644
--- a/src/test/groovy/bugs/Groovy3403Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3403Bug.groovy
@@ -50,7 +50,6 @@ class Groovy3403Bug extends GroovyTestCase {
class Main3403 {
static test(){
- println "original call made"
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy3405Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3405Bug.groovy b/src/test/groovy/bugs/Groovy3405Bug.groovy
index 6f6dfbb..769fcd8 100644
--- a/src/test/groovy/bugs/Groovy3405Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3405Bug.groovy
@@ -35,7 +35,5 @@ class Groovy3405Bug extends GroovyTestCase {
String.metaClass.'static'.testStaticOneParam = { first = "foo" -> return first }
assert "baz" == "".testStaticOneParam("baz")
assert "foo" == "".testStaticOneParam()
-
- println "Done"
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy3410Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3410Bug.groovy b/src/test/groovy/bugs/Groovy3410Bug.groovy
index 8a3609c..a16fd5c 100644
--- a/src/test/groovy/bugs/Groovy3410Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3410Bug.groovy
@@ -78,6 +78,5 @@ class Groovy3410Bug extends GroovyTestCase {
}
println new Groovy3405N5()
"""
- println "testClassVerificationErrorsWithBooleanExpUsingPrimitiveFields Done"
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy3770Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy3770Bug.groovy b/src/test/groovy/bugs/Groovy3770Bug.groovy
index 2effa42..fbdf8bb 100644
--- a/src/test/groovy/bugs/Groovy3770Bug.groovy
+++ b/src/test/groovy/bugs/Groovy3770Bug.groovy
@@ -49,7 +49,7 @@ class Groovy3770Bug extends GroovyTestCase {
void testCurriedClosuresShouldNotAffectParent() {
// GROOVY-3875
- def orig = { tmp -> println tmp }
+ def orig = { tmp -> assert tmp == 1 }
def curriedOrig = orig.curry(1)
assert orig != curriedOrig.getOwner()
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy4393Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy4393Bug.groovy b/src/test/groovy/bugs/Groovy4393Bug.groovy
index 535a868..30ff894 100644
--- a/src/test/groovy/bugs/Groovy4393Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4393Bug.groovy
@@ -23,9 +23,6 @@ import org.junit.Ignore
@Ignore('requires a specific configuration, see: https://issues.apache.org/jira/browse/GROOVY-4393 for details')
class Groovy4393Bug extends GroovyTestCase {
void testIfSourceFilesWithOtherExtensionsGotCompiledFine() {
-
- println Groovy4393BugV1
-
assert Groovy4393BugV1 != null
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy6041Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy6041Bug.groovy b/src/test/groovy/bugs/Groovy6041Bug.groovy
index 779d6cd..f91a0f2 100644
--- a/src/test/groovy/bugs/Groovy6041Bug.groovy
+++ b/src/test/groovy/bugs/Groovy6041Bug.groovy
@@ -48,6 +48,5 @@ class Groovy6041Bug extends StringSourcesStubTestCase {
@Override
void verifyStubs() {
def stubSource = stubJavaSourceFor('Tool')
- println stubSource
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy770_Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy770_Bug.groovy b/src/test/groovy/bugs/Groovy770_Bug.groovy
index 7ea579d..5995150 100644
--- a/src/test/groovy/bugs/Groovy770_Bug.groovy
+++ b/src/test/groovy/bugs/Groovy770_Bug.groovy
@@ -30,9 +30,6 @@ class Groovy770_Bug extends GroovyTestCase {
def l1 = [a, b]
def l2 = [c]
- println (l1)
- println (l2)
- println (l1 - l2)
assert l1 - l2 == l1
@@ -41,9 +38,6 @@ class Groovy770_Bug extends GroovyTestCase {
c = new CPair(sym:"y")
l1 = [a, b]
l2 = [c]
- println (l1)
- println (l2)
- println (l1 - l2)
assert l1 - l2 == [a]
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/Groovy872Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy872Bug.groovy b/src/test/groovy/bugs/Groovy872Bug.groovy
index 52e8676..b4f3c17 100644
--- a/src/test/groovy/bugs/Groovy872Bug.groovy
+++ b/src/test/groovy/bugs/Groovy872Bug.groovy
@@ -35,6 +35,5 @@ class MyCalendar {
void tryit ( ) {
def cal = new GregorianCalendar ( )
cal.set ( Calendar.DAY_OF_MONTH , 1 )
- println ( cal.get ( Calendar.DAY_OF_MONTH ) )
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/InterfaceImplBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/InterfaceImplBug.groovy b/src/test/groovy/bugs/InterfaceImplBug.groovy
index 367553d..217ff3b 100644
--- a/src/test/groovy/bugs/InterfaceImplBug.groovy
+++ b/src/test/groovy/bugs/InterfaceImplBug.groovy
@@ -31,7 +31,6 @@ class InterfaceImplBug extends GroovyTestCase implements FooHandler {
}
void handle(Reader reader){
- println("in handle method")
def called = true
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/InvokeNormalMethodFromBuilder_Groovy657Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/InvokeNormalMethodFromBuilder_Groovy657Bug.groovy b/src/test/groovy/bugs/InvokeNormalMethodFromBuilder_Groovy657Bug.groovy
index 5de6c12..3913148 100644
--- a/src/test/groovy/bugs/InvokeNormalMethodFromBuilder_Groovy657Bug.groovy
+++ b/src/test/groovy/bugs/InvokeNormalMethodFromBuilder_Groovy657Bug.groovy
@@ -47,11 +47,10 @@ class Builder extends BuilderSupport {
Object createNode(Object name, Object value) { return createNode(name, [:], value) }
Object createNode(Object name, Map attributes, Object value) {
- println "create ${name}"
return callOtherStaticallyTypedMethod()
}
- String callNormalMethod() { println "normalMethod"; return "first" }
- String callOtherStaticallyTypedMethod() { println "otherMethod"; return "second" }
+ String callNormalMethod() { return "first" }
+ String callOtherStaticallyTypedMethod() { return "second" }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/NestedClosure2Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/NestedClosure2Bug.groovy b/src/test/groovy/bugs/NestedClosure2Bug.groovy
index 1a0c838..3b2a386 100644
--- a/src/test/groovy/bugs/NestedClosure2Bug.groovy
+++ b/src/test/groovy/bugs/NestedClosure2Bug.groovy
@@ -40,19 +40,13 @@ class NestedClosure2Bug extends TestSupport {
def a = 123
def b = 456
def closure = {
- println b
def c = 999
return {
f = 2222111
- println f
-
- println c
def d = 678
return {
- println f
assert f == 2222111
- println d
return a
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/NestedClosureBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/NestedClosureBug.groovy b/src/test/groovy/bugs/NestedClosureBug.groovy
index efb292f..5721495 100644
--- a/src/test/groovy/bugs/NestedClosureBug.groovy
+++ b/src/test/groovy/bugs/NestedClosureBug.groovy
@@ -25,8 +25,7 @@ class NestedClosureBug extends GroovyTestCase {
void testBug() {
def a = 123
getValues().each {
- println it
- it.each {
+ it.each {
assert a == 123
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/POJOCallSiteBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/POJOCallSiteBug.groovy b/src/test/groovy/bugs/POJOCallSiteBug.groovy
index 18b9084..7a4483e 100644
--- a/src/test/groovy/bugs/POJOCallSiteBug.groovy
+++ b/src/test/groovy/bugs/POJOCallSiteBug.groovy
@@ -82,7 +82,6 @@ class POJOCallSiteBug extends GroovyTestCase {
Double[][] a = new Double[10][10]
for (def i = 0; i <= 9; i++ ) {
for (def j = 0; j <= 9; j++ ) {
- println("i=$i j=$j a[0][i]=$a[0][i]")
def o = a[0][i]
a[0][i] = o + 1
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/PropertyNameBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/PropertyNameBug.groovy b/src/test/groovy/bugs/PropertyNameBug.groovy
index fc5cd5f..339b97e 100644
--- a/src/test/groovy/bugs/PropertyNameBug.groovy
+++ b/src/test/groovy/bugs/PropertyNameBug.groovy
@@ -30,10 +30,6 @@ public class PropertyNameBug extends GroovyTestCase {
map.put("foo.bar", "FooBar")
map.put("foo.bar-bar", "FooBar-Bar")
map.put("foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!", "Any character")
-
- println("foo.bar1 = ${map.get("foo.bar1")}")
- println("foo.bar-bar = ${map.get("foo.bar-bar")}")
- println("Specical Character Test: ${map.get("foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!")}")
}
void testNonJavaIdentifierChacactersWithGroovySyntax() {
@@ -41,10 +37,6 @@ public class PropertyNameBug extends GroovyTestCase {
map."foo.bar" = "FooBar"
map."foo.bar-bar" = "FooBar-Bar"
map."foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!" = "Any character"
-
- println("foo.bar1 = ${map."foo.bar1"}")
- println("foo.bar-bar = ${map."foo.bar-bar"}")
- println("Specical Character Test: ${map."foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!"}")
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/RodsBug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/RodsBug.groovy b/src/test/groovy/bugs/RodsBug.groovy
index 90a0ff2..94a251e 100644
--- a/src/test/groovy/bugs/RodsBug.groovy
+++ b/src/test/groovy/bugs/RodsBug.groovy
@@ -39,7 +39,6 @@ class RodsBug extends GroovyTestCase {
if (x > 0) {
//String name = "Rod"
def name = "Rod"
- println(name)
}
}
http://git-wip-us.apache.org/repos/asf/groovy/blob/858a6fd2/src/test/groovy/bugs/RussellsOptionalParenTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/RussellsOptionalParenTest.groovy b/src/test/groovy/bugs/RussellsOptionalParenTest.groovy
index ef007b4..6f7c165 100644
--- a/src/test/groovy/bugs/RussellsOptionalParenTest.groovy
+++ b/src/test/groovy/bugs/RussellsOptionalParenTest.groovy
@@ -23,7 +23,7 @@ class RussellsOptionalParenTest extends GroovyTestCase {
void testMethodCallWithOneParam() {
def adob = new ArrayList()
adob.add "hello"
- println adob.get(0)
- println adob.size()
+ assert adob.get(0) == 'hello'
+ assert adob.size() == 1
}
}
\ No newline at end of file