You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/10/01 04:27:13 UTC
svn commit: r1003360 -
/commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestClosureUtils.java
Author: sebb
Date: Fri Oct 1 02:27:12 2010
New Revision: 1003360
URL: http://svn.apache.org/viewvc?rev=1003360&view=rev
Log:
revert change of StringBuilder => StringBuffer because only the latter has setLength()
Modified:
commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestClosureUtils.java
Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestClosureUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestClosureUtils.java?rev=1003360&r1=1003359&r2=1003360&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestClosureUtils.java (original)
+++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestClosureUtils.java Fri Oct 1 02:27:12 2010
@@ -22,9 +22,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
+import junit.framework.TestCase;
import org.apache.commons.collections.functors.EqualPredicate;
import org.apache.commons.collections.functors.ExceptionClosure;
@@ -40,7 +38,7 @@ import org.apache.commons.collections.fu
*
* @author Stephen Colebourne
*/
-public class TestClosureUtils extends junit.framework.TestCase {
+public class TestClosureUtils extends TestCase {
private static final Object cString = "Hello";
@@ -51,35 +49,6 @@ public class TestClosureUtils extends ju
super(name);
}
- /**
- * Main.
- * @param args
- */
- public static void main(String[] args) {
- TestRunner.run(suite());
- }
-
- /**
- * Return class as a test suite.
- */
- public static Test suite() {
- return new TestSuite(TestClosureUtils.class);
- }
-
- /**
- * Set up instance variables required by this test case.
- */
- @Override
- public void setUp() {
- }
-
- /**
- * Tear down instance variables required by this test case.
- */
- @Override
- public void tearDown() {
- }
-
static class MockClosure<T> implements Closure<T> {
int count = 0;
@@ -134,10 +103,10 @@ public class TestClosureUtils extends ju
//------------------------------------------------------------------
public void testInvokeClosure() {
- StringBuilder buf = new StringBuilder("Hello");
+ StringBuffer buf = new StringBuffer("Hello"); // Only StringBuffer has setLength() method
ClosureUtils.invokerClosure("reverse").execute(buf);
assertEquals("olleH", buf.toString());
- buf = new StringBuilder("Hello");
+ buf = new StringBuffer("Hello");
ClosureUtils.invokerClosure("setLength", new Class[] {Integer.TYPE}, new Object[] {new Integer(2)}).execute(buf);
assertEquals("He", buf.toString());
}