1.1 --- a/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/ReflectionTest.java Tue Jan 08 16:32:11 2013 +0100
1.2 +++ b/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/ReflectionTest.java Mon Jan 14 18:21:48 2013 +0100
1.3 @@ -90,6 +90,35 @@
1.4 return (Integer)plus.invoke(null, 2, 3);
1.5 }
1.6
1.7 + @Compare public String classGetNameForByte() {
1.8 + return byte.class.getName();
1.9 + }
1.10 + @Compare public String classGetNameForBaseObject() {
1.11 + return newObject().getClass().getName();
1.12 + }
1.13 + @Compare public String classGetNameForJavaObject() {
1.14 + return new Object().getClass().getName();
1.15 + }
1.16 + @Compare public String classGetNameForObjectArray() {
1.17 + return (new Object[3]).getClass().getName();
1.18 + }
1.19 + @Compare public String classGetNameForSimpleIntArray() {
1.20 + return (new int[3]).getClass().getName();
1.21 + }
1.22 + @Compare public boolean sameClassGetNameForSimpleCharArray() {
1.23 + return (new char[3]).getClass() == (new char[34]).getClass();
1.24 + }
1.25 + @Compare public String classGetNameForMultiIntArray() {
1.26 + return (new int[3][4][5][6][7][8][9]).getClass().getName();
1.27 + }
1.28 + @Compare public String classGetNameForMultiStringArray() {
1.29 + return (new String[3][4][5][6][7][8][9]).getClass().getName();
1.30 + }
1.31 +
1.32 + @Compare public boolean isArray() {
1.33 + return new Object[0].getClass().isArray();
1.34 + }
1.35 +
1.36 @JavaScriptBody(args = { "arr", "len" }, body="var a = arr.slice(0, len); a.sort(); return a;")
1.37 private static String[] sort(String[] arr, int len) {
1.38 List<String> list = Arrays.asList(arr).subList(0, len);
1.39 @@ -97,6 +126,11 @@
1.40 return list.toArray(new String[0]);
1.41 }
1.42
1.43 + @JavaScriptBody(args = {}, body = "return new Object();")
1.44 + private static Object newObject() {
1.45 + return new Object();
1.46 + }
1.47 +
1.48 @Factory
1.49 public static Object[] create() {
1.50 return VMTest.create(ReflectionTest.class);