summaryrefslogtreecommitdiffstats
path: root/test/org/jetbrains/java/decompiler
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-04 14:30:28 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-04 14:33:34 +0400
commit1cea85e49ae7659e7124383b619730ba6053bb46 (patch)
tree9893c2ed765e9f1dfa887b7123dd034569e12549 /test/org/jetbrains/java/decompiler
parentf4f9e8be28142ebb4b85026eef6505055a31b68a (diff)
downloadfernflower-1cea85e49ae7659e7124383b619730ba6053bb46.tar
fernflower-1cea85e49ae7659e7124383b619730ba6053bb46.tar.gz
fernflower-1cea85e49ae7659e7124383b619730ba6053bb46.tar.lz
fernflower-1cea85e49ae7659e7124383b619730ba6053bb46.tar.xz
fernflower-1cea85e49ae7659e7124383b619730ba6053bb46.zip
java-decompiler: optimization (less string buffer allocations on generating text)
Diffstat (limited to 'test/org/jetbrains/java/decompiler')
-rw-r--r--test/org/jetbrains/java/decompiler/SingleClassesTest.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java
index f6146c9..9300d78 100644
--- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java
+++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java
@@ -28,11 +28,17 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class SingleClassesTest {
+ private File testDataDir;
private File tempDir;
private ConsoleDecompiler decompiler;
@Before
public void setUp() throws IOException {
+ testDataDir = new File("testData");
+ if (!isTestDataDir(testDataDir)) testDataDir = new File("community/plugins/java-decompiler/engine/testData");
+ if (!isTestDataDir(testDataDir)) testDataDir = new File("plugins/java-decompiler/engine/testData");
+ assertTrue(isTestDataDir(testDataDir));
+
//noinspection SSBasedInspection
tempDir = File.createTempFile("decompiler_test_", "_dir");
assertTrue(tempDir.delete());
@@ -52,6 +58,7 @@ public class SingleClassesTest {
decompiler = null;
delete(tempDir);
tempDir = null;
+ testDataDir = null;
}
@Test public void testClassFields() { doTest("TestClassFields"); }
@@ -69,13 +76,9 @@ public class SingleClassesTest {
private void doTest(final String testName) {
try {
- File testDataDir = new File("testData");
- if (!isTestDataDir(testDataDir)) testDataDir = new File("community/plugins/java-decompiler/engine/testData");
- if (!isTestDataDir(testDataDir)) testDataDir = new File("plugins/java-decompiler/engine/testData");
- assertTrue(isTestDataDir(testDataDir));
-
File classFile = new File(testDataDir, "/classes/pkg/" + testName + ".class");
assertTrue(classFile.isFile());
+
decompiler.addSpace(classFile, true);
File[] innerClasses = classFile.getParentFile().listFiles(new FilenameFilter() {
@Override