예제 #1
0
  protected void doTest(String testFile) {
    try {
      File classFile = new File(fixture.getTestDataDir(), "/classes/" + testFile + ".class");
      assertTrue(classFile.isFile());
      String testName = classFile.getName().substring(0, classFile.getName().length() - 6);

      ConsoleDecompiler decompiler = fixture.getDecompiler();

      for (File file : collectClasses(classFile)) decompiler.addSpace(file, true);
      decompiler.decompileContext();

      File decompiledFile = new File(fixture.getTargetDir(), testName + ".java");
      assertTrue(decompiledFile.isFile());
      File referenceFile = new File(fixture.getTestDataDir(), "results/" + testName + ".dec");
      assertTrue(referenceFile.isFile());
      compareContent(decompiledFile, referenceFile);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
예제 #2
0
 @After
 public void tearDown() {
   fixture.tearDown();
   fixture = null;
 }
예제 #3
0
 @Before
 public void setUp() throws IOException {
   fixture = new DecompilerTestFixture();
   fixture.setUp(getDecompilerOptions());
 }