summaryrefslogtreecommitdiffstats
path: root/luni/src/test/etc/loading-test-jar
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2011-01-16 14:49:35 -0800
committerDan Bornstein <danfuzz@android.com>2011-01-16 14:51:47 -0800
commitbe4921ea9ecbb378c80f0d318c46fd5a7d1f05e7 (patch)
tree74fb7023a3fa5399ac9057e3bed7b60ae47b5d43 /luni/src/test/etc/loading-test-jar
parent1c4757f1439ed6209a7aba6ca2d8e99fd28c9612 (diff)
downloadlibcore-be4921ea9ecbb378c80f0d318c46fd5a7d1f05e7.zip
libcore-be4921ea9ecbb378c80f0d318c46fd5a7d1f05e7.tar.gz
libcore-be4921ea9ecbb378c80f0d318c46fd5a7d1f05e7.tar.bz2
Add a clarification about this file's place in the universe.
Change-Id: I409c3a1ef98aa04a14f9d88ad961f726f1582184
Diffstat (limited to 'luni/src/test/etc/loading-test-jar')
-rw-r--r--luni/src/test/etc/loading-test-jar/Test2.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/luni/src/test/etc/loading-test-jar/Test2.java b/luni/src/test/etc/loading-test-jar/Test2.java
index 8241001..cfeaefc 100644
--- a/luni/src/test/etc/loading-test-jar/Test2.java
+++ b/luni/src/test/etc/loading-test-jar/Test2.java
@@ -27,8 +27,19 @@ import java.io.InputStream;
* {@code DexClassLoaderTest}.
*/
public class Test2 {
+ /*
+ * The following are all simple utility methods which, under
+ * normal circumstances, would be part of other libraries
+ * (specifically, JUnit and the Android libcore support library).
+ *
+ * However, this file gets compiled as an independent unit without
+ * any dependencies. We could theoretically add dependencies on other
+ * libraries, but that would make things much more complicated and
+ * fragile, and for very little benefit.
+ */
+
/**
- * Simple sameness checker, to avoid pulling in JUnit as a dependency.
+ * Simple sameness assertion checker.
*/
public static void assertSame(Object expected, Object actual) {
if (expected != actual) {
@@ -38,7 +49,7 @@ public class Test2 {
}
/**
- * Simple sameness checker, to avoid pulling in JUnit as a dependency.
+ * Simple sameness assertion checker.
*/
public static void assertSame(int expected, int actual) {
if (expected != actual) {
@@ -48,10 +59,10 @@ public class Test2 {
}
/**
- * Stream reader, to avoid pulling in libcore as a dependency.
- * This is a copy of the same-named method in {@code libcore.base.Streams}.
+ * Fully read the contents of the given stream.
*/
public static byte[] readFully(InputStream in) throws IOException {
+ // This is a copy of the same-named method in libcore.base.Streams.
byte[] buffer = new byte[1024];
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
while (true) {
@@ -63,6 +74,10 @@ public class Test2 {
}
}
+ /*
+ * Test methods, per se
+ */
+
/**
* Test that an instance of a sibling class can be constructed.
*/