refactor: remove deprecations from test suite (#3269)

This commit is contained in:
Connor Tumbleson 2023-08-13 14:25:32 -04:00 committed by GitHub
parent e99ed1ccbb
commit 225c9089d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5 additions and 15 deletions

View File

@ -77,13 +77,13 @@ public class SkipAssetTest extends BaseTest {
checkFileDoesExist("assets" + File.separator + "ranges" + File.separator + "ranges.kotlin_builtins");
}
private void checkFileDoesNotExist(String path) throws BrutException {
private void checkFileDoesNotExist(String path) {
File f = new File(sTestOrigDir, path);
assertFalse(f.isFile());
}
private void checkFileDoesExist(String path) throws BrutException {
private void checkFileDoesExist(String path) {
File f = new File(sTestOrigDir, path);
assertTrue(f.isFile());

View File

@ -22,7 +22,6 @@ import brut.androlib.Config;
import brut.common.BrutException;
import brut.directory.ExtFile;
import brut.util.OS;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@ -34,10 +33,7 @@ import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
public class BuildAndDecodeTest extends BaseTest {

View File

@ -59,7 +59,7 @@ public class AndResGuardTest extends BaseTest {
}
@Test
public void checkifAndResDecodeRemapsRFolderInRawMode() throws BrutException, IOException {
public void checkIfAndResDecodeRemapsRFolderInRawMode() throws BrutException, IOException {
Config config = Config.getDefaultConfig();
config.forceDelete = true;

View File

@ -16,7 +16,6 @@
*/
package brut.androlib.decode;
import brut.androlib.ApkDecoder;
import brut.androlib.BaseTest;
import brut.androlib.Config;
import brut.androlib.TestUtils;
@ -32,9 +31,7 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertTrue;
public class DecodeArrayTest extends BaseTest {
@ -54,7 +51,6 @@ public class DecodeArrayTest extends BaseTest {
public void decodeStringArray() throws BrutException {
ExtFile apkFile = new ExtFile(sTmpDir, "issue1994.apk");
ApkInfo apkInfo = new ApkInfo(apkFile);
//ApkDecoder apkDecoder = new ApkDecoder(apkFile);
ResourcesDecoder resourcesDecoder = new ResourcesDecoder(Config.getDefaultConfig(), apkInfo);
resourcesDecoder.loadMainPkg();

View File

@ -67,6 +67,6 @@ public class DecodeKotlinTest extends BaseTest {
public void kotlinDecodeTest() throws IOException {
File kotlinActivity = new File(sTestNewDir, "smali/org/example/kotlin/mixed/KotlinActivity.smali");
assertTrue(FileUtils.readFileToString(kotlinActivity).contains("KotlinActivity.kt"));
assertTrue(FileUtils.readFileToString(kotlinActivity, "UTF-8").contains("KotlinActivity.kt"));
}
}

View File

@ -26,7 +26,6 @@ import org.junit.*;
import java.io.File;
import java.io.IOException;
public class DuplicateDexTest extends BaseTest {
@Before

View File

@ -58,7 +58,6 @@ public class ExternalEntityTest extends BaseTest {
@Test
public void doctypeTest() throws IOException {
String expected = TestUtils.replaceNewlines("<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<manifest android:versionCode=\"1\" android:versionName=\"1.0\" android:compileSdkVersion=\"23\" android:compileSdkVersionCodename=\"6.0-2438415\" " +
"hardwareAccelerated=\"true\" package=\"com.ibotpeaches.doctype\" platformBuildVersionCode=\"24\" platformBuildVersionName=\"6.0-2456767\" " +