diff options
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestDeobfed.java')
| -rw-r--r-- | src/test/java/cuchaz/enigma/TestDeobfed.java | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/src/test/java/cuchaz/enigma/TestDeobfed.java b/src/test/java/cuchaz/enigma/TestDeobfed.java deleted file mode 100644 index d64a745..0000000 --- a/src/test/java/cuchaz/enigma/TestDeobfed.java +++ /dev/null | |||
| @@ -1,100 +0,0 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 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 | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | |||
| 12 | package cuchaz.enigma; | ||
| 13 | |||
| 14 | import cuchaz.enigma.analysis.ClassCache; | ||
| 15 | import cuchaz.enigma.analysis.index.JarIndex; | ||
| 16 | import cuchaz.enigma.network.EnigmaServer; | ||
| 17 | import cuchaz.enigma.source.Decompiler; | ||
| 18 | import cuchaz.enigma.source.Decompilers; | ||
| 19 | import cuchaz.enigma.source.SourceSettings; | ||
| 20 | import org.junit.BeforeClass; | ||
| 21 | import org.junit.Test; | ||
| 22 | |||
| 23 | import java.nio.file.Paths; | ||
| 24 | |||
| 25 | import static cuchaz.enigma.TestEntryFactory.newClass; | ||
| 26 | import static org.hamcrest.MatcherAssert.assertThat; | ||
| 27 | import static org.hamcrest.Matchers.containsInAnyOrder; | ||
| 28 | |||
| 29 | public class TestDeobfed { | ||
| 30 | |||
| 31 | private static Enigma enigma; | ||
| 32 | private static ClassCache classCache; | ||
| 33 | private static JarIndex index; | ||
| 34 | |||
| 35 | @BeforeClass | ||
| 36 | public static void beforeClass() throws Exception { | ||
| 37 | enigma = Enigma.create(); | ||
| 38 | |||
| 39 | classCache = ClassCache.of(Paths.get("build/test-deobf/translation.jar")); | ||
| 40 | index = classCache.index(ProgressListener.none()); | ||
| 41 | } | ||
| 42 | |||
| 43 | @Test | ||
| 44 | public void obfEntries() { | ||
| 45 | assertThat(index.getEntryIndex().getClasses(), containsInAnyOrder( | ||
| 46 | newClass("cuchaz/enigma/inputs/Keep"), | ||
| 47 | newClass("a"), | ||
| 48 | newClass("b"), | ||
| 49 | newClass("c"), | ||
| 50 | newClass("d"), | ||
| 51 | newClass("d$1"), | ||
| 52 | newClass("e"), | ||
| 53 | newClass("f"), | ||
| 54 | newClass("g"), | ||
| 55 | newClass("g$a"), | ||
| 56 | newClass("g$a$a"), | ||
| 57 | newClass("g$b"), | ||
| 58 | newClass("g$b$a"), | ||
| 59 | newClass("h"), | ||
| 60 | newClass("h$a"), | ||
| 61 | newClass("h$a$a"), | ||
| 62 | newClass("h$b"), | ||
| 63 | newClass("h$b$a"), | ||
| 64 | newClass("h$b$a$a"), | ||
| 65 | newClass("h$b$a$b"), | ||
| 66 | newClass("i"), | ||
| 67 | newClass("i$a"), | ||
| 68 | newClass("i$b") | ||
| 69 | )); | ||
| 70 | } | ||
| 71 | |||
| 72 | @Test | ||
| 73 | public void decompile() { | ||
| 74 | EnigmaProject project = new EnigmaProject(enigma, classCache, index, new byte[EnigmaServer.CHECKSUM_SIZE]); | ||
| 75 | Decompiler decompiler = Decompilers.PROCYON.create(project.getClassCache(), new SourceSettings(false, false)); | ||
| 76 | |||
| 77 | decompiler.getSource("a"); | ||
| 78 | decompiler.getSource("b"); | ||
| 79 | decompiler.getSource("c"); | ||
| 80 | decompiler.getSource("d"); | ||
| 81 | decompiler.getSource("d$1"); | ||
| 82 | decompiler.getSource("e"); | ||
| 83 | decompiler.getSource("f"); | ||
| 84 | decompiler.getSource("g"); | ||
| 85 | decompiler.getSource("g$a"); | ||
| 86 | decompiler.getSource("g$a$a"); | ||
| 87 | decompiler.getSource("g$b"); | ||
| 88 | decompiler.getSource("g$b$a"); | ||
| 89 | decompiler.getSource("h"); | ||
| 90 | decompiler.getSource("h$a"); | ||
| 91 | decompiler.getSource("h$a$a"); | ||
| 92 | decompiler.getSource("h$b"); | ||
| 93 | decompiler.getSource("h$b$a"); | ||
| 94 | decompiler.getSource("h$b$a$a"); | ||
| 95 | decompiler.getSource("h$b$a$b"); | ||
| 96 | decompiler.getSource("i"); | ||
| 97 | decompiler.getSource("i$a"); | ||
| 98 | decompiler.getSource("i$b"); | ||
| 99 | } | ||
| 100 | } | ||