Merge "Remove core-junit/core-junit-static and revert to JUnit 4.10" am: 50db5f5810 am: 38d1882ee2 am: e0df57581a
am: 87fef242a9

Change-Id: Icf0ccba66c16e4c6bee5d47529f00a27e2a0aece
diff --git a/Android.mk b/Android.mk
index 35fe46b..043a8ba 100644
--- a/Android.mk
+++ b/Android.mk
@@ -16,9 +16,6 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# include definition of core-junit-files
-include $(LOCAL_PATH)/Common.mk
-
 # build a junit jar
 # ----------------------
 include $(CLEAR_VARS)
@@ -56,33 +53,6 @@
 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
 endif # HOST_OS == linux
 
-# ----------------------------------
-# build a core-junit target jar that is built into Android system image
-
-# TODO: remove extensions once core-tests is no longer dependent on it
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
-LOCAL_SRC_FILES += $(core-junit-files)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core-oj core-libart
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := core-junit
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
-include $(BUILD_JAVA_LIBRARY)
-
-# ----------------------------------
-# build a core-junit-static target jar that is embedded into legacy-test
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src/junit/extensions)
-LOCAL_SRC_FILES += $(core-junit-files)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core-oj core-libart
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := core-junit-static
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/Common.mk
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
 #-------------------------------------------------------
 # build a junit4-target jar as an alias for junit
 
diff --git a/Common.mk b/Common.mk
deleted file mode 100644
index 426cb07..0000000
--- a/Common.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- mode: makefile -*-
-# List of junit files include in documentation.
-# Shared with frameworks/base.
-# based off libcore/Docs.mk
-# Exports:
-#   core-junit-files, junit_to_document.
-#   They are lists of .java files relative to external/junit/.
-
-ifndef junit4_common_include_once
-
-# List of source to build into the core-junit library
-#
-core-junit-files := \
-src/junit/framework/Assert.java \
-src/junit/framework/AssertionFailedError.java \
-src/junit/framework/ComparisonCompactor.java \
-src/junit/framework/ComparisonFailure.java \
-src/junit/framework/Protectable.java \
-src/junit/framework/Test.java \
-src/junit/framework/TestCase.java \
-src/junit/framework/TestFailure.java \
-src/junit/framework/TestListener.java \
-src/junit/framework/TestResult.java \
-src/junit/framework/TestSuite.java
-
-# List of junit javadoc source files for Android public API
-#
-junit_to_document := \
- $(core-junit-files)
-
-junit4_common_include_once := 1
-endif  # junit4_common_include_once
diff --git a/src/junit/extensions/package.html b/src/junit/extensions/package.html
deleted file mode 100644
index 6b4be72..0000000
--- a/src/junit/extensions/package.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<HTML>
-<BODY>
-Utility classes supporting the junit test framework.
-{@hide} - Not needed for 1.0 SDK 
-</BODY>
-</HTML>
diff --git a/src/junit/framework/ComparisonCompactor.java b/src/junit/framework/ComparisonCompactor.java
index e540f03..bbc3ba1 100644
--- a/src/junit/framework/ComparisonCompactor.java
+++ b/src/junit/framework/ComparisonCompactor.java
@@ -1,9 +1,5 @@
 package junit.framework;
 
-// android-changed add @hide
-/**
- * @hide not needed for public API
- */
 public class ComparisonCompactor {
 
 	private static final String ELLIPSIS= "...";
@@ -23,17 +19,14 @@
 	}
 
 	public String compact(String message) {
-		if (fExpected == null || fActual == null || areStringsEqual()) {
-			// android-changed use local method instead of Assert.format, since
-			// the later is not part of Android API till API 16
-			return format(message, fExpected, fActual);
-		}
+		if (fExpected == null || fActual == null || areStringsEqual())
+			return Assert.format(message, fExpected, fActual);
+
 		findCommonPrefix();
 		findCommonSuffix();
 		String expected= compactString(fExpected);
 		String actual= compactString(fActual);
-		// android-changed use local format method
-		return format(message, expected, actual);
+		return Assert.format(message, expected, actual);
 	}
 
 	private String compactString(String source) {
@@ -76,12 +69,4 @@
 	private boolean areStringsEqual() {
 		return fExpected.equals(fActual);
 	}
-
-	// android-changed copy of Assert.format for reasons described above
-	private static String format(String message, Object expected, Object actual) {
-        	String formatted= "";
-        	if (message != null && message.length() > 0)
-            		formatted= message+" ";
-        	return formatted+"expected:<"+expected+"> but was:<"+actual+">";
-	}
 }
diff --git a/src/junit/framework/TestResult.java b/src/junit/framework/TestResult.java
index 3052e94..5768e9a 100644
--- a/src/junit/framework/TestResult.java
+++ b/src/junit/framework/TestResult.java
@@ -4,7 +4,6 @@
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
-import java.util.Vector;
 
 /**
  * A <code>TestResult</code> collects the results of executing
@@ -16,20 +15,16 @@
  * @see Test
  */
 public class TestResult extends Object {
-	// BEGIN android-changed changed types from List<> to Vector<> for API compatibility
-	protected Vector<TestFailure> fFailures;
-	protected Vector<TestFailure> fErrors;
-	protected Vector<TestListener> fListeners;
-	// END android-changed
+	protected List<TestFailure> fFailures;
+	protected List<TestFailure> fErrors;
+	protected List<TestListener> fListeners;
 	protected int fRunTests;
 	private boolean fStop;
 	
 	public TestResult() {
-		// BEGIN android-changed to Vector
-		fFailures= new Vector<TestFailure>();
-		fErrors= new Vector<TestFailure>();
-		fListeners= new Vector<TestListener>();
-		// END android-changed
+		fFailures= new ArrayList<TestFailure>();
+		fErrors= new ArrayList<TestFailure>();
+		fListeners= new ArrayList<TestListener>();
 		fRunTests= 0;
 		fStop= false;
 	}
@@ -171,4 +166,4 @@
 	public synchronized boolean wasSuccessful() {
 		return failureCount() == 0 && errorCount() == 0;
 	}
-}
+}
\ No newline at end of file
diff --git a/src/junit/framework/package.html b/src/junit/framework/package.html
deleted file mode 100644
index 770d470..0000000
--- a/src/junit/framework/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<HTML>
-<BODY>
-The junit test framework.
-</BODY>
-</HTML>
diff --git a/src/org/junit/experimental/theories/internal/package.html b/src/org/junit/experimental/theories/internal/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/experimental/theories/internal/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/builders/package.html b/src/org/junit/internal/builders/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/builders/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/matchers/package.html b/src/org/junit/internal/matchers/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/matchers/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/package.html b/src/org/junit/internal/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/requests/package-info.java b/src/org/junit/internal/requests/package-info.java
index 493f21a..66d2928 100644
--- a/src/org/junit/internal/requests/package-info.java
+++ b/src/org/junit/internal/requests/package-info.java
@@ -2,6 +2,5 @@
  * Provides implementations of {@link org.junit.runner.Request}.
  *
  * @since 4.0
- * @hide
  */
-package org.junit.internal.requests;
+package org.junit.internal.requests;
\ No newline at end of file
diff --git a/src/org/junit/internal/requests/package.html b/src/org/junit/internal/requests/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/requests/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/runners/model/package.html b/src/org/junit/internal/runners/model/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/runners/model/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/runners/package-info.java b/src/org/junit/internal/runners/package-info.java
index 8ee0e61..5ab7e7b 100644
--- a/src/org/junit/internal/runners/package-info.java
+++ b/src/org/junit/internal/runners/package-info.java
@@ -2,6 +2,5 @@
  * Provides implementations of {@link org.junit.runner.Runner}
  *
  * @since 4.0
- * @hide
  */
-package org.junit.internal.runners;
+package org.junit.internal.runners;
\ No newline at end of file
diff --git a/src/org/junit/internal/runners/package.html b/src/org/junit/internal/runners/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/runners/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/runners/rules/package.html b/src/org/junit/internal/runners/rules/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/runners/rules/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>
diff --git a/src/org/junit/internal/runners/statements/package.html b/src/org/junit/internal/runners/statements/package.html
deleted file mode 100644
index 1c9bf9d..0000000
--- a/src/org/junit/internal/runners/statements/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-    {@hide}
-</body>
-</html>