Revert "Revert "Implement RetransformClasses""
This reverts commit 52a2db50b76f2b981d21d5508c3d9e8ab4c5fe93.
Reason for revert: Issue with RedefineClasses was resolved.
Test: ART_TEST_JNI_FORCECOPY=true mma -j40 test-art-host
Change-Id: I06f198df4fb40c48647b358d241710329e0812e9
diff --git a/test/921-hello-failure/src/Main.java b/test/921-hello-failure/src/Main.java
index 1fe2599..43d6e9e 100644
--- a/test/921-hello-failure/src/Main.java
+++ b/test/921-hello-failure/src/Main.java
@@ -25,6 +25,7 @@
MissingInterface.doTest(new Transform2());
ReorderInterface.doTest(new Transform2());
MultiRedef.doTest(new Transform(), new Transform2());
+ MultiRetrans.doTest(new Transform(), new Transform2());
}
// Transforms the class. This throws an exception if something goes wrong.
@@ -47,7 +48,20 @@
dex_files.toArray(new byte[0][]));
}
+ public static void addMultiTransformationResults(CommonClassDefinition... defs) throws Exception {
+ for (CommonClassDefinition d : defs) {
+ addCommonTransformationResult(d.target.getCanonicalName(),
+ d.class_file_bytes,
+ d.dex_file_bytes);
+ }
+ }
+
public static native void doCommonMultiClassRedefinition(Class<?>[] targets,
byte[][] classfiles,
byte[][] dexfiles) throws Exception;
+ public static native void doCommonClassRetransformation(Class<?>... target) throws Exception;
+ public static native void enableCommonRetransformation(boolean enable);
+ public static native void addCommonTransformationResult(String target_name,
+ byte[] class_bytes,
+ byte[] dex_bytes);
}