summaryrefslogtreecommitdiffstats
path: root/junit/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-05-13 12:36:25 -0700
committerElliott Hughes <enh@google.com>2010-05-13 12:49:12 -0700
commitf33eae7e84eb6d3b0f4e86b59605bb3de73009f3 (patch)
treef6cb62c04ce2669d2fa4715fbab86d38c8fca06d /junit/src
parentd21d78fd49a2d798218e8c8aefbddb26a0e71bbb (diff)
downloadlibcore-f33eae7e84eb6d3b0f4e86b59605bb3de73009f3.zip
libcore-f33eae7e84eb6d3b0f4e86b59605bb3de73009f3.tar.gz
libcore-f33eae7e84eb6d3b0f4e86b59605bb3de73009f3.tar.bz2
Remove all trailing whitespace from the dalvik team-maintained parts of libcore.
Gentlemen, you may now set your editors to "strip trailing whitespace"... Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
Diffstat (limited to 'junit/src')
-rw-r--r--junit/src/main/java/junit/extensions/ActiveTestSuite.java16
-rw-r--r--junit/src/main/java/junit/framework/Assert.java4
-rw-r--r--junit/src/main/java/junit/framework/ComparisonFailure.java16
-rw-r--r--junit/src/main/java/junit/framework/TestFailure.java2
-rw-r--r--junit/src/main/java/junit/framework/TestListener.java4
-rw-r--r--junit/src/main/java/junit/framework/TestResult.java4
-rw-r--r--junit/src/main/java/junit/framework/TestSuite.java26
7 files changed, 36 insertions, 36 deletions
diff --git a/junit/src/main/java/junit/extensions/ActiveTestSuite.java b/junit/src/main/java/junit/extensions/ActiveTestSuite.java
index 073e6f3..8b62853 100644
--- a/junit/src/main/java/junit/extensions/ActiveTestSuite.java
+++ b/junit/src/main/java/junit/extensions/ActiveTestSuite.java
@@ -7,36 +7,36 @@ import junit.framework.*;
* test in a separate thread and waits until all
* threads have terminated.
* -- Aarhus Radisson Scandinavian Center 11th floor
- */
+ */
public class ActiveTestSuite extends TestSuite {
private volatile int fActiveTestDeathCount;
public ActiveTestSuite() {
}
-
+
public ActiveTestSuite(Class theClass) {
super(theClass);
}
-
+
public ActiveTestSuite(String name) {
super (name);
}
-
+
public ActiveTestSuite(Class theClass, String name) {
super(theClass, name);
}
-
+
public void run(TestResult result) {
fActiveTestDeathCount= 0;
super.run(result);
waitUntilFinished();
}
-
+
public void runTest(final Test test, final TestResult result) {
Thread t= new Thread() {
public void run() {
try {
- // inlined due to limitation in VA/Java
+ // inlined due to limitation in VA/Java
//ActiveTestSuite.super.runTest(test, result);
test.run(result);
} finally {
@@ -56,7 +56,7 @@ public class ActiveTestSuite extends TestSuite {
}
}
}
-
+
synchronized public void runFinished(Test test) {
fActiveTestDeathCount++;
notifyAll();
diff --git a/junit/src/main/java/junit/framework/Assert.java b/junit/src/main/java/junit/framework/Assert.java
index c1bc7b2..364e646 100644
--- a/junit/src/main/java/junit/framework/Assert.java
+++ b/junit/src/main/java/junit/framework/Assert.java
@@ -71,7 +71,7 @@ public class Assert {
assertEquals(null, expected, actual);
}
/**
- * Asserts that two Strings are equal.
+ * Asserts that two Strings are equal.
*/
static public void assertEquals(String message, String expected, String actual) {
if (expected == null && actual == null)
@@ -81,7 +81,7 @@ public class Assert {
throw new ComparisonFailure(message, expected, actual);
}
/**
- * Asserts that two Strings are equal.
+ * Asserts that two Strings are equal.
*/
static public void assertEquals(String expected, String actual) {
assertEquals(null, expected, actual);
diff --git a/junit/src/main/java/junit/framework/ComparisonFailure.java b/junit/src/main/java/junit/framework/ComparisonFailure.java
index a0ad176..0cb2cee 100644
--- a/junit/src/main/java/junit/framework/ComparisonFailure.java
+++ b/junit/src/main/java/junit/framework/ComparisonFailure.java
@@ -2,7 +2,7 @@ package junit.framework;
/**
* Thrown when an assert equals for Strings failed.
- *
+ *
* Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com
*/
public class ComparisonFailure extends AssertionFailedError {
@@ -20,19 +20,19 @@ public class ComparisonFailure extends AssertionFailedError {
fExpected= expected;
fActual= actual;
}
-
+
/**
* Returns "..." in place of common prefix and "..." in
* place of common suffix between expected and actual.
- *
+ *
* @see java.lang.Throwable#getMessage()
*/
public String getMessage() {
if (fExpected == null || fActual == null)
return Assert.format(super.getMessage(), fExpected, fActual);
-
+
int end= Math.min(fExpected.length(), fActual.length());
-
+
int i= 0;
for(; i < end; i++) {
if (fExpected.charAt(i) != fActual.charAt(i))
@@ -45,7 +45,7 @@ public class ComparisonFailure extends AssertionFailedError {
break;
}
String actual, expected;
-
+
// equal strings
if (j < i && k < i) {
expected= fExpected;
@@ -57,12 +57,12 @@ public class ComparisonFailure extends AssertionFailedError {
expected= "..."+expected;
actual= "..."+actual;
}
-
+
if (j < fExpected.length()-1)
expected= expected+"...";
if (k < fActual.length()-1)
actual= actual+"...";
- }
+ }
return Assert.format(super.getMessage(), expected, actual);
}
}
diff --git a/junit/src/main/java/junit/framework/TestFailure.java b/junit/src/main/java/junit/framework/TestFailure.java
index ace2dbe..45614a3 100644
--- a/junit/src/main/java/junit/framework/TestFailure.java
+++ b/junit/src/main/java/junit/framework/TestFailure.java
@@ -12,7 +12,7 @@ import java.io.StringWriter;
public class TestFailure extends Object {
protected Test fFailedTest;
protected Throwable fThrownException;
-
+
/**
* Constructs a TestFailure with the given test and exception.
diff --git a/junit/src/main/java/junit/framework/TestListener.java b/junit/src/main/java/junit/framework/TestListener.java
index 3ef3e33..41c6ccf 100644
--- a/junit/src/main/java/junit/framework/TestListener.java
+++ b/junit/src/main/java/junit/framework/TestListener.java
@@ -11,11 +11,11 @@ public interface TestListener {
/**
* A failure occurred.
*/
- public void addFailure(Test test, AssertionFailedError t);
+ public void addFailure(Test test, AssertionFailedError t);
/**
* A test ended.
*/
- public void endTest(Test test);
+ public void endTest(Test test);
/**
* A test started.
*/
diff --git a/junit/src/main/java/junit/framework/TestResult.java b/junit/src/main/java/junit/framework/TestResult.java
index 153a77b..bcca1de 100644
--- a/junit/src/main/java/junit/framework/TestResult.java
+++ b/junit/src/main/java/junit/framework/TestResult.java
@@ -18,7 +18,7 @@ public class TestResult extends Object {
protected Vector fListeners;
protected int fRunTests;
private boolean fStop;
-
+
public TestResult() {
fFailures= new Vector();
fErrors= new Vector();
@@ -122,7 +122,7 @@ public class TestResult extends Object {
public void runProtected(final Test test, Protectable p) {
try {
p.protect();
- }
+ }
catch (AssertionFailedError e) {
addFailure(test, e);
}
diff --git a/junit/src/main/java/junit/framework/TestSuite.java b/junit/src/main/java/junit/framework/TestSuite.java
index bf23198..d2df2b7 100644
--- a/junit/src/main/java/junit/framework/TestSuite.java
+++ b/junit/src/main/java/junit/framework/TestSuite.java
@@ -37,7 +37,7 @@ public class TestSuite implements Test {
*/
public TestSuite() {
}
-
+
/**
* Constructs a TestSuite from the given class with the given name.
* @see TestSuite#TestSuite(Class)
@@ -46,7 +46,7 @@ public class TestSuite implements Test {
this(theClass);
setName(name);
}
-
+
/**
* Constructs a TestSuite from the given class. Adds all the methods
* starting with "test" as test cases to the suite.
@@ -79,14 +79,14 @@ public class TestSuite implements Test {
if (fTests.size() == 0)
addTest(warning("No tests found in "+theClass.getName()));
}
-
+
/**
* Constructs an empty TestSuite.
*/
public TestSuite(String name) {
setName(name);
}
-
+
/**
* Adds a test to the suite.
*/
@@ -154,7 +154,7 @@ public class TestSuite implements Test {
return stringWriter.toString();
}
-
+
/**
* Counts the number of test cases that will be run by this test.
*/
@@ -166,7 +166,7 @@ public class TestSuite implements Test {
}
return count;
}
-
+
/**
* Gets a constructor which takes a single String as
* its argument or a no arg constructor.
@@ -174,7 +174,7 @@ public class TestSuite implements Test {
public static Constructor getTestConstructor(Class theClass) throws NoSuchMethodException {
Class[] args= { String.class };
try {
- return theClass.getConstructor(args);
+ return theClass.getConstructor(args);
} catch (NoSuchMethodException e) {
// fall through
}
@@ -184,14 +184,14 @@ public class TestSuite implements Test {
private boolean isPublicTestMethod(Method m) {
return isTestMethod(m) && Modifier.isPublic(m.getModifiers());
}
-
+
private boolean isTestMethod(Method m) {
String name= m.getName();
Class[] parameters= m.getParameterTypes();
Class returnType= m.getReturnType();
return parameters.length == 0 && name.startsWith("test") && returnType.equals(Void.TYPE);
}
-
+
/**
* Runs the tests and collects their result in a TestResult.
*/
@@ -214,21 +214,21 @@ public class TestSuite implements Test {
public Test testAt(int index) {
return (Test)fTests.elementAt(index);
}
-
+
/**
* Returns the number of tests in this suite
*/
public int testCount() {
return fTests.size();
}
-
+
/**
* Returns the tests as an enumeration
*/
public Enumeration tests() {
return fTests.elements();
}
-
+
/**
*/
public String toString() {
@@ -236,7 +236,7 @@ public class TestSuite implements Test {
return getName();
return super.toString();
}
-
+
/**
* Sets the name of the suite.
* @param name The name to set