summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-01 18:54:33 +0400
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>2014-09-01 18:54:33 +0400
commite629738a46ca5e82ad93939f3de7c05c37512323 (patch)
treee50253688a2b7eae45c3534985938178e54440d2 /test
parentd5fe121d1d320085d3d80e4267f0bbcfd320a333 (diff)
downloadfernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar.gz
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar.lz
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.tar.xz
fernflower-e629738a46ca5e82ad93939f3de7c05c37512323.zip
java-decompiler: tests moved
Diffstat (limited to 'test')
-rw-r--r--test/org/jetbrains/java/decompiler/SingleClassesTest.java30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/org/jetbrains/java/decompiler/SingleClassesTest.java b/test/org/jetbrains/java/decompiler/SingleClassesTest.java
index fc8b1c2..291c0e7 100644
--- a/test/org/jetbrains/java/decompiler/SingleClassesTest.java
+++ b/test/org/jetbrains/java/decompiler/SingleClassesTest.java
@@ -37,15 +37,11 @@ public class SingleClassesTest {
assertTrue(tempDir.delete());
assertTrue(tempDir.mkdirs());
decompiler = new ConsoleDecompiler(new HashMap<String, Object>() {{
- boolean win = System.getProperty("os.name", "").startsWith("Windows");
put(IFernflowerPreferences.LOG_LEVEL, "warn");
- put(IFernflowerPreferences.RENAME_ENTITIES, "1");
- put(IFernflowerPreferences.HIDE_DEFAULT_CONSTRUCTOR, "1");
- put(IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES, "0");
- put(IFernflowerPreferences.IDEA_NOT_NULL_ANNOTATION, "1");
- put(IFernflowerPreferences.LAMBDA_TO_ANONYMOUS_CLASS, "0");
- put(IFernflowerPreferences.USE_DEBUG_VAR_NAMES, "0");
- put(IFernflowerPreferences.NEW_LINE_SEPARATOR, (win ? "0" : "1"));
+ put(IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES, "1");
+ put(IFernflowerPreferences.REMOVE_SYNTHETIC, "1");
+ put(IFernflowerPreferences.REMOVE_BRIDGE, "1");
+ put(IFernflowerPreferences.LITERALS_AS_IS, "1");
}});
}
@@ -62,8 +58,14 @@ public class SingleClassesTest {
@Test public void testClassSwitch() { doTest("TestClassSwitch"); }
@Test public void testClassTypes() { doTest("TestClassTypes"); }
@Test public void testClassVar() { doTest("TestClassVar"); }
+ @Test public void testDeprecations() { doTest("TestDeprecations"); }
+ @Test public void testExtendsList() { doTest("TestExtendsList"); }
+ @Test public void testMethodParameters() { doTest("TestMethodParameters"); }
+ @Test public void testCodeConstructs() { doTest("TestCodeConstructs"); }
+ @Test public void testConstants() { doTest("TestConstants"); }
+ //@Test public void testEnum() { doTest("TestEnum"); }
- private void doTest(String testName) {
+ private void doTest(final String testName) {
try {
File testDataDir = new File("testData");
if (!isTestDataDir(testDataDir)) testDataDir = new File("community/plugins/java-decompiler/engine/testData");
@@ -73,6 +75,16 @@ public class SingleClassesTest {
File classFile = new File(testDataDir, "/classes/pkg/" + testName + ".class");
assertTrue(classFile.isFile());
decompiler.addSpace(classFile, true);
+ File[] innerClasses = classFile.getParentFile().listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.matches(testName + "\\$.+\\.class");
+ }
+ });
+ for (File inner : innerClasses) {
+ decompiler.addSpace(inner, true);
+ }
+
decompiler.decompileContext(tempDir);
File decompiledFile = new File(tempDir, testName + ".java");