Rename SystemMethods to ReflectionTest.
This test started out as one thing, but ended up as something else.
Change-Id: Idf85693cf49acf0ed198a92c4f3c66db31214ac0
diff --git a/build/Android.common.mk b/build/Android.common.mk
index ac477a2..c6e7366 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -269,12 +269,12 @@
ProtoCompare \
ProtoCompare2 \
ReferenceMap \
+ ReflectionTest \
StackWalk \
StackWalk2 \
StaticLeafMethods \
Statics \
StaticsFromCode \
- SystemMethods \
ThreadStress \
Invoke \
XandY
diff --git a/build/Android.oattest.mk b/build/Android.oattest.mk
index da64a84..98ec45f 100644
--- a/build/Android.oattest.mk
+++ b/build/Android.oattest.mk
@@ -72,7 +72,7 @@
ART_TEST_OAT_TARGETS += test-art-target-oat-$(1)
endef
-# Delcare the simplest test first
+# Declare the simplest test first
$(eval $(call declare-test-test-target,HelloWorld,))
$(eval $(call declare-test-test-target,Fibonacci,10))
@@ -84,8 +84,8 @@
$(eval $(call declare-test-test-target,MemUsage,))
$(eval $(call declare-test-test-target,ParallelGC,))
$(eval $(call declare-test-test-target,ReferenceMap,))
+$(eval $(call declare-test-test-target,ReflectionTest,))
$(eval $(call declare-test-test-target,StackWalk,))
-$(eval $(call declare-test-test-target,SystemMethods,))
$(eval $(call declare-test-test-target,ThreadStress,))
# TODO: Enable when the StackWalk2 tests are passing
diff --git a/test/SystemMethods/SystemMethods.java b/test/ReflectionTest/ReflectionTest.java
similarity index 65%
rename from test/SystemMethods/SystemMethods.java
rename to test/ReflectionTest/ReflectionTest.java
index 7872a92..94c02aa 100644
--- a/test/SystemMethods/SystemMethods.java
+++ b/test/ReflectionTest/ReflectionTest.java
@@ -17,7 +17,7 @@
import java.lang.reflect.*;
import java.util.*;
-class SystemMethods {
+class ReflectionTest {
private static boolean z = true;
private static byte b = 8;
private static char c = 'x';
@@ -30,114 +30,114 @@
public static void testFieldReflection() throws Exception {
Field f;
- f = SystemMethods.class.getDeclaredField("z");
+ f = ReflectionTest.class.getDeclaredField("z");
System.out.println(f.getBoolean(null));
- f = SystemMethods.class.getDeclaredField("b");
+ f = ReflectionTest.class.getDeclaredField("b");
System.out.println(f.getByte(null));
- f = SystemMethods.class.getDeclaredField("c");
+ f = ReflectionTest.class.getDeclaredField("c");
System.out.println(f.getChar(null));
- f = SystemMethods.class.getDeclaredField("d");
+ f = ReflectionTest.class.getDeclaredField("d");
System.out.println(f.getDouble(null));
- f = SystemMethods.class.getDeclaredField("f");
+ f = ReflectionTest.class.getDeclaredField("f");
System.out.println(f.getFloat(null));
- f = SystemMethods.class.getDeclaredField("i");
+ f = ReflectionTest.class.getDeclaredField("i");
System.out.println(f.getInt(null));
- f = SystemMethods.class.getDeclaredField("j");
+ f = ReflectionTest.class.getDeclaredField("j");
System.out.println(f.getLong(null));
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
System.out.println(f.getShort(null));
- f = SystemMethods.class.getDeclaredField("z");
+ f = ReflectionTest.class.getDeclaredField("z");
f.setBoolean(null, false);
- f = SystemMethods.class.getDeclaredField("b");
+ f = ReflectionTest.class.getDeclaredField("b");
f.setByte(null, (byte) 7);
- f = SystemMethods.class.getDeclaredField("c");
+ f = ReflectionTest.class.getDeclaredField("c");
f.setChar(null, 'y');
- f = SystemMethods.class.getDeclaredField("d");
+ f = ReflectionTest.class.getDeclaredField("d");
f.setDouble(null, 2.7);
- f = SystemMethods.class.getDeclaredField("f");
+ f = ReflectionTest.class.getDeclaredField("f");
f.setFloat(null, 2.7f);
- f = SystemMethods.class.getDeclaredField("i");
+ f = ReflectionTest.class.getDeclaredField("i");
f.setInt(null, 31);
- f = SystemMethods.class.getDeclaredField("j");
+ f = ReflectionTest.class.getDeclaredField("j");
f.setLong(null, 63);
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
f.setShort(null, (short) 15);
- f = SystemMethods.class.getDeclaredField("z");
+ f = ReflectionTest.class.getDeclaredField("z");
System.out.println(f.getBoolean(null));
- f = SystemMethods.class.getDeclaredField("b");
+ f = ReflectionTest.class.getDeclaredField("b");
System.out.println(f.getByte(null));
- f = SystemMethods.class.getDeclaredField("c");
+ f = ReflectionTest.class.getDeclaredField("c");
System.out.println(f.getChar(null));
- f = SystemMethods.class.getDeclaredField("d");
+ f = ReflectionTest.class.getDeclaredField("d");
System.out.println(f.getDouble(null));
- f = SystemMethods.class.getDeclaredField("f");
+ f = ReflectionTest.class.getDeclaredField("f");
System.out.println(f.getFloat(null));
- f = SystemMethods.class.getDeclaredField("i");
+ f = ReflectionTest.class.getDeclaredField("i");
System.out.println(f.getInt(null));
- f = SystemMethods.class.getDeclaredField("j");
+ f = ReflectionTest.class.getDeclaredField("j");
System.out.println(f.getLong(null));
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
System.out.println(f.getShort(null));
- f = SystemMethods.class.getDeclaredField("z");
+ f = ReflectionTest.class.getDeclaredField("z");
f.set(null, Boolean.valueOf(true));
- f = SystemMethods.class.getDeclaredField("b");
+ f = ReflectionTest.class.getDeclaredField("b");
f.set(null, Byte.valueOf((byte) 6));
- f = SystemMethods.class.getDeclaredField("c");
+ f = ReflectionTest.class.getDeclaredField("c");
f.set(null, Character.valueOf('z'));
- f = SystemMethods.class.getDeclaredField("d");
+ f = ReflectionTest.class.getDeclaredField("d");
f.set(null, Double.valueOf(1.3));
- f = SystemMethods.class.getDeclaredField("f");
+ f = ReflectionTest.class.getDeclaredField("f");
f.set(null, Float.valueOf(1.3f));
- f = SystemMethods.class.getDeclaredField("i");
+ f = ReflectionTest.class.getDeclaredField("i");
f.set(null, Integer.valueOf(30));
- f = SystemMethods.class.getDeclaredField("j");
+ f = ReflectionTest.class.getDeclaredField("j");
f.set(null, Long.valueOf(62));
f.set(null, Integer.valueOf(62));
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
f.set(null, Short.valueOf((short) 14));
- f = SystemMethods.class.getDeclaredField("z");
+ f = ReflectionTest.class.getDeclaredField("z");
System.out.println(f.getBoolean(null));
- f = SystemMethods.class.getDeclaredField("b");
+ f = ReflectionTest.class.getDeclaredField("b");
System.out.println(f.getByte(null));
- f = SystemMethods.class.getDeclaredField("c");
+ f = ReflectionTest.class.getDeclaredField("c");
System.out.println(f.getChar(null));
- f = SystemMethods.class.getDeclaredField("d");
+ f = ReflectionTest.class.getDeclaredField("d");
System.out.println(f.getDouble(null));
- f = SystemMethods.class.getDeclaredField("f");
+ f = ReflectionTest.class.getDeclaredField("f");
System.out.println(f.getFloat(null));
- f = SystemMethods.class.getDeclaredField("i");
+ f = ReflectionTest.class.getDeclaredField("i");
System.out.println(f.getInt(null));
- f = SystemMethods.class.getDeclaredField("j");
+ f = ReflectionTest.class.getDeclaredField("j");
System.out.println(f.getLong(null));
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
System.out.println(f.getShort(null));
try {
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
f.set(null, Integer.valueOf(14));
} catch (Exception ex) {
ex.printStackTrace();
}
- f = SystemMethods.class.getDeclaredField("z");
+ f = ReflectionTest.class.getDeclaredField("z");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("b");
+ f = ReflectionTest.class.getDeclaredField("b");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("c");
+ f = ReflectionTest.class.getDeclaredField("c");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("d");
+ f = ReflectionTest.class.getDeclaredField("d");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("f");
+ f = ReflectionTest.class.getDeclaredField("f");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("i");
+ f = ReflectionTest.class.getDeclaredField("i");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("j");
+ f = ReflectionTest.class.getDeclaredField("j");
show(f.get(null));
- f = SystemMethods.class.getDeclaredField("s");
+ f = ReflectionTest.class.getDeclaredField("s");
show(f.get(null));
/*
@@ -161,10 +161,10 @@
System.out.println(Arrays.toString(String.class.getDeclaredFields()));
System.out.println(Arrays.toString(String.class.getDeclaredMethods()));
- System.out.println(Arrays.toString(SystemMethods.class.getInterfaces()));
+ System.out.println(Arrays.toString(ReflectionTest.class.getInterfaces()));
System.out.println(Arrays.toString(String.class.getInterfaces()));
- System.out.println(SystemMethods.class.getModifiers());
+ System.out.println(ReflectionTest.class.getModifiers());
System.out.println(String.class.getModifiers());
System.out.println(String.class.isAssignableFrom(Object.class));
@@ -175,37 +175,37 @@
Method m;
- m = SystemMethods.class.getDeclaredMethod("IV", int.class);
+ m = ReflectionTest.class.getDeclaredMethod("IV", int.class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, 4444));
System.out.println(Arrays.toString(m.getParameterTypes()));
- m = SystemMethods.class.getDeclaredMethod("IIV", int.class, int.class);
+ m = ReflectionTest.class.getDeclaredMethod("IIV", int.class, int.class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, 1111, 2222));
- m = SystemMethods.class.getDeclaredMethod("III", int.class, int.class);
+ m = ReflectionTest.class.getDeclaredMethod("III", int.class, int.class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, 1111, 2222));
- m = SystemMethods.class.getDeclaredMethod("sumArray", int[].class);
+ m = ReflectionTest.class.getDeclaredMethod("sumArray", int[].class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, new int[] { 1, 2, 3, 4 }));
- m = SystemMethods.class.getDeclaredMethod("concat", String[].class);
+ m = ReflectionTest.class.getDeclaredMethod("concat", String[].class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, (Object) new String[] { "h", "e", "l", "l", "o" }));
- m = SystemMethods.class.getDeclaredMethod("ZBCDFIJSV", boolean.class, byte.class, char.class, double.class, float.class, int.class, long.class, short.class);
+ m = ReflectionTest.class.getDeclaredMethod("ZBCDFIJSV", boolean.class, byte.class, char.class, double.class, float.class, int.class, long.class, short.class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, true, (byte) 0, '1', 2, 3, 4, 5, (short) 6));
- m = SystemMethods.class.getDeclaredMethod("ZBCDLFIJSV", boolean.class, byte.class, char.class, double.class, String.class, float.class, int.class, long.class, short.class);
+ m = ReflectionTest.class.getDeclaredMethod("ZBCDLFIJSV", boolean.class, byte.class, char.class, double.class, String.class, float.class, int.class, long.class, short.class);
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null, true, (byte) 0, '1', 2, "hello world", 3, 4, 5, (short) 6));
try {
- m = SystemMethods.class.getDeclaredMethod("thrower");
+ m = ReflectionTest.class.getDeclaredMethod("thrower");
System.out.println(Arrays.toString(m.getParameterTypes()));
show(m.invoke(null));
System.out.println("************* should have thrown!");