diff options
author | Jean-Marie Henaff <jmhenaff@google.com> | 2015-03-13 09:08:11 +0100 |
---|---|---|
committer | Jean-Marie Henaff <jmhenaff@google.com> | 2015-03-18 09:02:16 +0100 |
commit | e2bcaa75590f91bb87f525e79ab149ae29869217 (patch) | |
tree | 5c695fb1a86b49bba811aff0cf496e6834a22f12 /jill/tests | |
parent | eacbc959140e90bb7d4db4285b88b9eccef82706 (diff) | |
download | toolchain_jill-e2bcaa75590f91bb87f525e79ab149ae29869217.zip toolchain_jill-e2bcaa75590f91bb87f525e79ab149ae29869217.tar.gz toolchain_jill-e2bcaa75590f91bb87f525e79ab149ae29869217.tar.bz2 |
Add jill-api project
Change-Id: I0552ee390655e89a593f58ef28ebe3ede8eda0bf
Diffstat (limited to 'jill/tests')
-rw-r--r-- | jill/tests/com/android/jill/Core.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/jill/tests/com/android/jill/Core.java b/jill/tests/com/android/jill/Core.java index f799084..eb254f8 100644 --- a/jill/tests/com/android/jill/Core.java +++ b/jill/tests/com/android/jill/Core.java @@ -18,19 +18,24 @@ package com.android.jill; import com.android.jack.test.TestsProperties; import com.android.jack.test.toolchain.AbstractTestTools; +import com.android.jill.api.JillProvider; +import com.android.jill.api.v01.Api01Config; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ServiceLoader; @Ignore("Tree") public class Core { @BeforeClass public static void setUpClass() { - Main.class.getClassLoader().setDefaultAssertionStatus(true); + Core.class.getClassLoader().setDefaultAssertionStatus(true); } @Test @@ -44,6 +49,27 @@ public class Core { } @Test + public void coreToJayceFromJarWithJillApi() throws Exception { + File jillPrebuilt = AbstractTestTools.getPrebuilt("jill"); + + ClassLoader classLoader = URLClassLoader.newInstance(new URL[] {jillPrebuilt.toURI().toURL()}, + Core.class.getClassLoader()); + + ServiceLoader<JillProvider> serviceLoader = ServiceLoader.load(JillProvider.class, classLoader); + JillProvider provider = serviceLoader.iterator().next(); + + Api01Config config = provider.createConfig(Api01Config.class); + + config.setInputJavaBinaryFile(new File(TestsProperties.getAndroidRootDir().getPath() + + "/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar")); + config.setVerbose(true); + config.setOutputJackFile(AbstractTestTools.createTempFile("jillTest", ".jack")); + + config.getTask().run(); + } + + + @Test public void coreToJayceFromFolder() throws Exception { Options options = new Options(); options.setBinaryFile(new File(TestsProperties.getAndroidRootDir().getPath() |