IDEA-149077 Default decompiler is chosen for several classes instead of Fernflower - tests

This commit is contained in:
Egor.Ushakov
2017-05-10 17:02:31 +03:00
parent 1f0d42ba0d
commit adbf29f8ce
68 changed files with 20713 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,14 +58,24 @@ public class BulkDecompilationTest {
@Test
public void testJar() {
doTestJar("bulk");
}
@Test
public void testObfuscated() {
doTestJar("obfuscated");
}
private void doTestJar(String name) {
ConsoleDecompiler decompiler = fixture.getDecompiler();
decompiler.addSpace(new File(fixture.getTestDataDir(), "bulk.jar"), true);
String jarName = name + ".jar";
decompiler.addSpace(new File(fixture.getTestDataDir(), jarName), true);
decompiler.decompileContext();
File unpacked = new File(fixture.getTempDir(), "unpacked");
unpack(new File(fixture.getTargetDir(), "bulk.jar"), unpacked);
unpack(new File(fixture.getTargetDir(), jarName), unpacked);
assertFilesEqual(new File(fixture.getTestDataDir(), "bulk"), unpacked);
assertFilesEqual(new File(fixture.getTestDataDir(), name), unpacked);
}
private static void unpack(File archive, File targetDir) {