diff options
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestDeobfuscator.java')
| -rw-r--r-- | src/test/java/cuchaz/enigma/TestDeobfuscator.java | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/test/java/cuchaz/enigma/TestDeobfuscator.java b/src/test/java/cuchaz/enigma/TestDeobfuscator.java index 8c97ff3..62a5286 100644 --- a/src/test/java/cuchaz/enigma/TestDeobfuscator.java +++ b/src/test/java/cuchaz/enigma/TestDeobfuscator.java | |||
| @@ -4,40 +4,39 @@ | |||
| 4 | * are made available under the terms of the GNU Lesser General Public | 4 | * are made available under the terms of the GNU Lesser General Public |
| 5 | * License v3.0 which accompanies this distribution, and is available at | 5 | * License v3.0 which accompanies this distribution, and is available at |
| 6 | * http://www.gnu.org/licenses/lgpl.html | 6 | * http://www.gnu.org/licenses/lgpl.html |
| 7 | * | 7 | * |
| 8 | * Contributors: | 8 | * Contributors: |
| 9 | * Jeff Martin - initial API and implementation | 9 | * Jeff Martin - initial API and implementation |
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | |||
| 11 | package cuchaz.enigma; | 12 | package cuchaz.enigma; |
| 12 | 13 | ||
| 13 | import static org.junit.Assert.*; | 14 | import com.google.common.collect.Lists; |
| 15 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 16 | import org.junit.Test; | ||
| 14 | 17 | ||
| 15 | import java.io.IOException; | 18 | import java.io.IOException; |
| 16 | import java.util.List; | 19 | import java.util.List; |
| 17 | import java.util.jar.JarFile; | 20 | import java.util.jar.JarFile; |
| 18 | 21 | ||
| 19 | import org.junit.Test; | 22 | import static org.junit.Assert.assertEquals; |
| 20 | |||
| 21 | import com.google.common.collect.Lists; | ||
| 22 | |||
| 23 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 24 | 23 | ||
| 25 | public class TestDeobfuscator { | 24 | public class TestDeobfuscator { |
| 26 | 25 | ||
| 27 | private Deobfuscator getDeobfuscator() | 26 | private Deobfuscator getDeobfuscator() |
| 28 | throws IOException { | 27 | throws IOException { |
| 29 | return new Deobfuscator(new JarFile("build/test-obf/loneClass.jar")); | 28 | return new Deobfuscator(new JarFile("build/test-obf/loneClass.jar")); |
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | @Test | 31 | @Test |
| 33 | public void loadJar() | 32 | public void loadJar() |
| 34 | throws Exception { | 33 | throws Exception { |
| 35 | getDeobfuscator(); | 34 | getDeobfuscator(); |
| 36 | } | 35 | } |
| 37 | 36 | ||
| 38 | @Test | 37 | @Test |
| 39 | public void getClasses() | 38 | public void getClasses() |
| 40 | throws Exception { | 39 | throws Exception { |
| 41 | Deobfuscator deobfuscator = getDeobfuscator(); | 40 | Deobfuscator deobfuscator = getDeobfuscator(); |
| 42 | List<ClassEntry> obfClasses = Lists.newArrayList(); | 41 | List<ClassEntry> obfClasses = Lists.newArrayList(); |
| 43 | List<ClassEntry> deobfClasses = Lists.newArrayList(); | 42 | List<ClassEntry> deobfClasses = Lists.newArrayList(); |
| @@ -47,10 +46,10 @@ public class TestDeobfuscator { | |||
| 47 | assertEquals(1, deobfClasses.size()); | 46 | assertEquals(1, deobfClasses.size()); |
| 48 | assertEquals("cuchaz/enigma/inputs/Keep", deobfClasses.get(0).getName()); | 47 | assertEquals("cuchaz/enigma/inputs/Keep", deobfClasses.get(0).getName()); |
| 49 | } | 48 | } |
| 50 | 49 | ||
| 51 | @Test | 50 | @Test |
| 52 | public void decompileClass() | 51 | public void decompileClass() |
| 53 | throws Exception { | 52 | throws Exception { |
| 54 | Deobfuscator deobfuscator = getDeobfuscator(); | 53 | Deobfuscator deobfuscator = getDeobfuscator(); |
| 55 | deobfuscator.getSource(deobfuscator.getSourceTree("a")); | 54 | deobfuscator.getSource(deobfuscator.getSourceTree("a")); |
| 56 | } | 55 | } |