summaryrefslogtreecommitdiff
path: root/src/test/java/cuchaz/enigma/TestDeobfuscator.java
diff options
context:
space:
mode:
authorGravatar Thog2017-03-08 08:17:04 +0100
committerGravatar Thog2017-03-08 08:17:04 +0100
commit6e464ea251cab63c776ece0b2a356f1498ffa294 (patch)
tree5ed30c03f5ac4cd2d6877874f5ede576049954f7 /src/test/java/cuchaz/enigma/TestDeobfuscator.java
parentDrop unix case style and implement hashCode when equals is overrided (diff)
downloadenigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.tar.gz
enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.tar.xz
enigma-fork-6e464ea251cab63c776ece0b2a356f1498ffa294.zip
Follow Fabric guidelines
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestDeobfuscator.java')
-rw-r--r--src/test/java/cuchaz/enigma/TestDeobfuscator.java29
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
11package cuchaz.enigma; 12package cuchaz.enigma;
12 13
13import static org.junit.Assert.*; 14import com.google.common.collect.Lists;
15import cuchaz.enigma.mapping.ClassEntry;
16import org.junit.Test;
14 17
15import java.io.IOException; 18import java.io.IOException;
16import java.util.List; 19import java.util.List;
17import java.util.jar.JarFile; 20import java.util.jar.JarFile;
18 21
19import org.junit.Test; 22import static org.junit.Assert.assertEquals;
20
21import com.google.common.collect.Lists;
22
23import cuchaz.enigma.mapping.ClassEntry;
24 23
25public class TestDeobfuscator { 24public 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 }