diff options
author | Yohann Roussel <yroussel@google.com> | 2014-10-15 18:29:19 +0200 |
---|---|---|
committer | Yohann Roussel <yroussel@google.com> | 2014-10-23 18:42:29 +0200 |
commit | bbdc1ce8c3f27adecd162dc7c56747b215227f2f (patch) | |
tree | 49ba347d88d46dbfccdf8ddeae391b20dd4bb19f /jack-tests/tests/com | |
parent | 0e1306677780d4feb4b9e0c8e749d95539f96183 (diff) | |
download | toolchain_jack-bbdc1ce8c3f27adecd162dc7c56747b215227f2f.zip toolchain_jack-bbdc1ce8c3f27adecd162dc7c56747b215227f2f.tar.gz toolchain_jack-bbdc1ce8c3f27adecd162dc7c56747b215227f2f.tar.bz2 |
Fix annotation/test006
Non public method Class.getSignatureAttribute was removed: removed
the tests depending on it.
Change-Id: I32f67c2f1a9c915d6320ea772dfa6e79c1891e64
Diffstat (limited to 'jack-tests/tests/com')
-rw-r--r-- | jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java index 60309bb..21a8cae 100644 --- a/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java +++ b/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java @@ -261,52 +261,20 @@ public class Tests { Method meth; try { - meth = ReflectAnnotationsTest2.class.getMethod("foo", (Class[]) null); - Assert.assertNull(getSignature(meth)); - - Field field; - field = ReflectAnnotationsTest2.class.getField("consInnerNamed"); - Assert.assertNull(getSignature(field)); - meth = ReflectAnnotationsTest2.class.getMethod("getGeneric", (Class[]) null); - Assert.assertEquals("()Lcom/android/jack/annotation/test006/jack/ReflectAnnotationsTest2$Generic2<Ljava/lang/String;>;", getSignature(meth)); Class<?>[] exceptions = meth.getExceptionTypes(); Assert.assertTrue(exceptions.length == 2); List<Class<?>> exceptionsList = Arrays.asList(exceptions); Assert.assertTrue(exceptionsList.contains(OutOfMemoryError.class)); Assert.assertTrue(exceptionsList.contains(AssertionError.class)); - field = ReflectAnnotationsTest2.class.getField("genField"); - Assert.assertEquals("Ljava/util/List<Ljava/lang/String;>;", getSignature(field)); - } catch (SecurityException e) { System.out.println(e.getMessage()); } catch (NoSuchMethodException e) { System.out.println(e.getMessage()); - } catch (NoSuchFieldException e) { - System.out.println(e.getMessage()); } } - private static String getSignature(Object obj) { - Method method; - try { - Class<? extends Object> c = obj.getClass(); - method = c.getDeclaredMethod("getSignatureAttribute"); - method.setAccessible(true); - } catch (Exception ex) { - throw new RuntimeException(ex); - } - - try { - return (String) method.invoke(obj); - } catch (IllegalAccessException ex) { - throw new RuntimeException(ex); - } catch (InvocationTargetException ex) { - throw new RuntimeException(ex); - } - } - private static String stringifyTypeArray(Type[] types) { StringBuilder stb = new StringBuilder(); boolean first = true; |