|
|
@ -49,16 +49,26 @@ public abstract class SingleClassesTestBase { |
|
|
|
return Collections.emptyMap(); |
|
|
|
return Collections.emptyMap(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void doTest(String testFile) { |
|
|
|
protected void doTest(String testFile, String... companionFiles) { |
|
|
|
|
|
|
|
ConsoleDecompiler decompiler = fixture.getDecompiler(); |
|
|
|
|
|
|
|
|
|
|
|
File classFile = new File(fixture.getTestDataDir(), "/classes/" + testFile + ".class"); |
|
|
|
File classFile = new File(fixture.getTestDataDir(), "/classes/" + testFile + ".class"); |
|
|
|
assertTrue(classFile.isFile()); |
|
|
|
assertTrue(classFile.isFile()); |
|
|
|
String testName = classFile.getName().substring(0, classFile.getName().length() - 6); |
|
|
|
for (File file : collectClasses(classFile)) { |
|
|
|
|
|
|
|
decompiler.addSpace(file, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ConsoleDecompiler decompiler = fixture.getDecompiler(); |
|
|
|
for (String companionFile : companionFiles) { |
|
|
|
|
|
|
|
File companionClassFile = new File(fixture.getTestDataDir(), "/classes/" + companionFile + ".class"); |
|
|
|
|
|
|
|
assertTrue(companionClassFile.isFile()); |
|
|
|
|
|
|
|
for (File file : collectClasses(companionClassFile)) { |
|
|
|
|
|
|
|
decompiler.addSpace(file, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (File file : collectClasses(classFile)) decompiler.addSpace(file, true); |
|
|
|
|
|
|
|
decompiler.decompileContext(); |
|
|
|
decompiler.decompileContext(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String testName = classFile.getName().substring(0, classFile.getName().length() - 6); |
|
|
|
File decompiledFile = new File(fixture.getTargetDir(), testName + ".java"); |
|
|
|
File decompiledFile = new File(fixture.getTargetDir(), testName + ".java"); |
|
|
|
assertTrue(decompiledFile.isFile()); |
|
|
|
assertTrue(decompiledFile.isFile()); |
|
|
|
File referenceFile = new File(fixture.getTestDataDir(), "results/" + testName + ".dec"); |
|
|
|
File referenceFile = new File(fixture.getTestDataDir(), "results/" + testName + ".dec"); |
|
|
|