From 0919fe5322a04f9edf667f6b8ae64be331e1f314 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Mon, 8 Jul 2013 13:24:33 -0500 Subject: [PATCH] move unit test to @beforeClass and test its output as a separate test, due to parallel test running --- .../brut/androlib/BuildAndDecodeTest.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java index b5b39ad8..3166e071 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java @@ -41,6 +41,16 @@ public class BuildAndDecodeTest { LOGGER.info("Unpacking testapp..."); TestUtils.copyResourceDir(BuildAndDecodeTest.class, "brut/apktool/testapp/", sTestOrigDir); + + LOGGER.info("Building testapp.apk..."); + File testApk = new File(sTmpDir, "testapp.apk"); + new Androlib().build(sTestOrigDir, testApk, + BuildAndDecodeTest.returnStock(),""); + + LOGGER.info("Decoding testapp.apk..."); + ApkDecoder apkDecoder = new ApkDecoder(testApk); + apkDecoder.setOutDir(sTestNewDir); + apkDecoder.decode(); } @AfterClass @@ -48,25 +58,16 @@ public class BuildAndDecodeTest { OS.rmdir(sTmpDir); } + @Test + public void buildAndDecodeTest() throws BrutException { + assertTrue(sTestNewDir.hashCode() == sTestNewDir.hashCode()); + } + @Test public void isAaptInstalledTest() throws Exception { assertEquals(true, isAaptPresent()); } - @Test - public void encodeAndDecodeTest() throws BrutException, IOException { - - LOGGER.info("Building testapp.apk..."); - File testApk = new File(sTmpDir, "testapp.apk"); - new Androlib().build(sTestOrigDir, testApk, - BuildAndDecodeTest.returnStock(),""); - - LOGGER.info("Decoding testapp.apk..."); - ApkDecoder apkDecoder = new ApkDecoder(testApk); - apkDecoder.setOutDir(sTestNewDir); - apkDecoder.decode(); - } - @Test public void valuesAnimsTest() throws BrutException { compareValuesFiles("values-mcc001/anims.xml");