summaryrefslogtreecommitdiff
path: root/enigma/src/test/java/cuchaz
diff options
context:
space:
mode:
Diffstat (limited to 'enigma/src/test/java/cuchaz')
-rw-r--r--enigma/src/test/java/cuchaz/enigma/PackageVisibilityIndexTest.java10
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TestDeobfed.java27
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java5
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TestInnerClasses.java13
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TestJarIndexConstructorReferences.java10
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TestJarIndexInheritanceTree.java13
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java9
-rw-r--r--enigma/src/test/java/cuchaz/enigma/TokenChecker.java9
-rw-r--r--enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java3
9 files changed, 57 insertions, 42 deletions
diff --git a/enigma/src/test/java/cuchaz/enigma/PackageVisibilityIndexTest.java b/enigma/src/test/java/cuchaz/enigma/PackageVisibilityIndexTest.java
index 1dc9748..1251535 100644
--- a/enigma/src/test/java/cuchaz/enigma/PackageVisibilityIndexTest.java
+++ b/enigma/src/test/java/cuchaz/enigma/PackageVisibilityIndexTest.java
@@ -11,12 +11,13 @@
11 11
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import cuchaz.enigma.analysis.ClassCache;
15import cuchaz.enigma.analysis.index.JarIndex; 14import cuchaz.enigma.analysis.index.JarIndex;
16import cuchaz.enigma.analysis.index.PackageVisibilityIndex; 15import cuchaz.enigma.analysis.index.PackageVisibilityIndex;
16import cuchaz.enigma.classprovider.JarClassProvider;
17import cuchaz.enigma.translation.representation.entry.ClassEntry; 17import cuchaz.enigma.translation.representation.entry.ClassEntry;
18import org.junit.Test; 18import org.junit.Test;
19 19
20import java.nio.file.Path;
20import java.nio.file.Paths; 21import java.nio.file.Paths;
21 22
22import static cuchaz.enigma.TestEntryFactory.newClass; 23import static cuchaz.enigma.TestEntryFactory.newClass;
@@ -25,7 +26,7 @@ import static org.hamcrest.Matchers.contains;
25import static org.hamcrest.Matchers.containsInAnyOrder; 26import static org.hamcrest.Matchers.containsInAnyOrder;
26 27
27public class PackageVisibilityIndexTest { 28public class PackageVisibilityIndexTest {
28 29 public static final Path JAR = Paths.get("build/test-obf/packageAccess.jar");
29 private static final ClassEntry KEEP = newClass("cuchaz/enigma/inputs/Keep"); 30 private static final ClassEntry KEEP = newClass("cuchaz/enigma/inputs/Keep");
30 private static final ClassEntry BASE = newClass("a"); 31 private static final ClassEntry BASE = newClass("a");
31 private static final ClassEntry SAME_PACKAGE_CHILD = newClass("b"); 32 private static final ClassEntry SAME_PACKAGE_CHILD = newClass("b");
@@ -35,8 +36,9 @@ public class PackageVisibilityIndexTest {
35 private final JarIndex jarIndex; 36 private final JarIndex jarIndex;
36 37
37 public PackageVisibilityIndexTest() throws Exception { 38 public PackageVisibilityIndexTest() throws Exception {
38 ClassCache classCache = ClassCache.of(Paths.get("build/test-obf/packageAccess.jar")); 39 JarClassProvider jcp = new JarClassProvider(JAR);
39 jarIndex = classCache.index(ProgressListener.none()); 40 jarIndex = JarIndex.empty();
41 jarIndex.indexJar(jcp.getClassNames(), jcp, ProgressListener.none());
40 } 42 }
41 43
42 @Test 44 @Test
diff --git a/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java b/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java
index 494d959..6daa293 100644
--- a/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java
+++ b/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java
@@ -11,8 +11,7 @@
11 11
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import cuchaz.enigma.analysis.ClassCache; 14import cuchaz.enigma.classprovider.ClasspathClassProvider;
15import cuchaz.enigma.analysis.index.JarIndex;
16import cuchaz.enigma.source.Decompiler; 15import cuchaz.enigma.source.Decompiler;
17import cuchaz.enigma.source.Decompilers; 16import cuchaz.enigma.source.Decompilers;
18import cuchaz.enigma.source.SourceSettings; 17import cuchaz.enigma.source.SourceSettings;
@@ -28,27 +27,24 @@ import static org.hamcrest.MatcherAssert.assertThat;
28import static org.hamcrest.Matchers.containsInAnyOrder; 27import static org.hamcrest.Matchers.containsInAnyOrder;
29 28
30public class TestDeobfed { 29public class TestDeobfed {
31 private static Enigma enigma; 30 public static final Path OBF = Paths.get("build/test-obf/translation.jar");
32 private static ClassCache classCache; 31 public static final Path DEOBF = Paths.get("build/test-deobf/translation.jar");
33 private static JarIndex index; 32 private static EnigmaProject deobfProject;
34 33
35 @BeforeClass 34 @BeforeClass
36 public static void beforeClass() throws Exception { 35 public static void beforeClass() throws Exception {
37 enigma = Enigma.create(); 36 Enigma enigma = Enigma.create();
38 37
39 Path obf = Paths.get("build/test-obf/translation.jar"); 38 Files.createDirectories(DEOBF.getParent());
40 Path deobf = Paths.get("build/test-deobf/translation.jar"); 39 EnigmaProject obfProject = enigma.openJar(OBF, new ClasspathClassProvider(), ProgressListener.none());
41 Files.createDirectories(deobf.getParent()); 40 obfProject.exportRemappedJar(ProgressListener.none()).write(DEOBF, ProgressListener.none());
42 EnigmaProject project = enigma.openJar(obf, ProgressListener.none());
43 project.exportRemappedJar(ProgressListener.none()).write(deobf, ProgressListener.none());
44 41
45 classCache = ClassCache.of(deobf); 42 deobfProject = enigma.openJar(DEOBF, new ClasspathClassProvider(), ProgressListener.none());
46 index = classCache.index(ProgressListener.none());
47 } 43 }
48 44
49 @Test 45 @Test
50 public void obfEntries() { 46 public void obfEntries() {
51 assertThat(index.getEntryIndex().getClasses(), containsInAnyOrder( 47 assertThat(deobfProject.getJarIndex().getEntryIndex().getClasses(), containsInAnyOrder(
52 newClass("cuchaz/enigma/inputs/Keep"), 48 newClass("cuchaz/enigma/inputs/Keep"),
53 newClass("a"), 49 newClass("a"),
54 newClass("b"), 50 newClass("b"),
@@ -77,8 +73,7 @@ public class TestDeobfed {
77 73
78 @Test 74 @Test
79 public void decompile() { 75 public void decompile() {
80 EnigmaProject project = new EnigmaProject(enigma, classCache, index, new byte[20]); 76 Decompiler decompiler = Decompilers.PROCYON.create(deobfProject.getClassProvider(), new SourceSettings(false, false));
81 Decompiler decompiler = Decompilers.PROCYON.create(project.getClassCache(), new SourceSettings(false, false));
82 77
83 decompiler.getSource("a"); 78 decompiler.getSource("a");
84 decompiler.getSource("b"); 79 decompiler.getSource("b");
diff --git a/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java b/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java
index 6619d26..ae42235 100644
--- a/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java
+++ b/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java
@@ -11,6 +11,7 @@
11 11
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import cuchaz.enigma.classprovider.ClasspathClassProvider;
14import cuchaz.enigma.source.Decompiler; 15import cuchaz.enigma.source.Decompiler;
15import cuchaz.enigma.source.Decompilers; 16import cuchaz.enigma.source.Decompilers;
16import cuchaz.enigma.source.SourceSettings; 17import cuchaz.enigma.source.SourceSettings;
@@ -22,7 +23,7 @@ import java.nio.file.Paths;
22public class TestDeobfuscator { 23public class TestDeobfuscator {
23 private EnigmaProject openProject() throws IOException { 24 private EnigmaProject openProject() throws IOException {
24 Enigma enigma = Enigma.create(); 25 Enigma enigma = Enigma.create();
25 return enigma.openJar(Paths.get("build/test-obf/loneClass.jar"), ProgressListener.none()); 26 return enigma.openJar(Paths.get("build/test-obf/loneClass.jar"), new ClasspathClassProvider(), ProgressListener.none());
26 } 27 }
27 28
28 @Test 29 @Test
@@ -34,7 +35,7 @@ public class TestDeobfuscator {
34 @Test 35 @Test
35 public void decompileClass() throws Exception { 36 public void decompileClass() throws Exception {
36 EnigmaProject project = openProject(); 37 EnigmaProject project = openProject();
37 Decompiler decompiler = Decompilers.PROCYON.create(project.getClassCache(), new SourceSettings(false, false)); 38 Decompiler decompiler = Decompilers.PROCYON.create(project.getClassProvider(), new SourceSettings(false, false));
38 39
39 decompiler.getSource("a").asString(); 40 decompiler.getSource("a").asString();
40 } 41 }
diff --git a/enigma/src/test/java/cuchaz/enigma/TestInnerClasses.java b/enigma/src/test/java/cuchaz/enigma/TestInnerClasses.java
index 85c72f8..6b60994 100644
--- a/enigma/src/test/java/cuchaz/enigma/TestInnerClasses.java
+++ b/enigma/src/test/java/cuchaz/enigma/TestInnerClasses.java
@@ -11,14 +11,16 @@
11 11
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import cuchaz.enigma.analysis.ClassCache;
15import cuchaz.enigma.analysis.index.JarIndex; 14import cuchaz.enigma.analysis.index.JarIndex;
15import cuchaz.enigma.classprovider.CachingClassProvider;
16import cuchaz.enigma.classprovider.JarClassProvider;
16import cuchaz.enigma.source.Decompiler; 17import cuchaz.enigma.source.Decompiler;
17import cuchaz.enigma.source.Decompilers; 18import cuchaz.enigma.source.Decompilers;
18import cuchaz.enigma.source.SourceSettings; 19import cuchaz.enigma.source.SourceSettings;
19import cuchaz.enigma.translation.representation.entry.ClassEntry; 20import cuchaz.enigma.translation.representation.entry.ClassEntry;
20import org.junit.Test; 21import org.junit.Test;
21 22
23import java.nio.file.Path;
22import java.nio.file.Paths; 24import java.nio.file.Paths;
23 25
24import static cuchaz.enigma.TestEntryFactory.newClass; 26import static cuchaz.enigma.TestEntryFactory.newClass;
@@ -35,13 +37,16 @@ public class TestInnerClasses {
35 private static final ClassEntry ClassTreeLevel1 = newClass("f$a"); 37 private static final ClassEntry ClassTreeLevel1 = newClass("f$a");
36 private static final ClassEntry ClassTreeLevel2 = newClass("f$a$a"); 38 private static final ClassEntry ClassTreeLevel2 = newClass("f$a$a");
37 private static final ClassEntry ClassTreeLevel3 = newClass("f$a$a$a"); 39 private static final ClassEntry ClassTreeLevel3 = newClass("f$a$a$a");
40 public static final Path JAR = Paths.get("build/test-obf/innerClasses.jar");
38 private final JarIndex index; 41 private final JarIndex index;
39 private final Decompiler decompiler; 42 private final Decompiler decompiler;
40 43
41 public TestInnerClasses() throws Exception { 44 public TestInnerClasses() throws Exception {
42 ClassCache classCache = ClassCache.of(Paths.get("build/test-obf/innerClasses.jar")); 45 JarClassProvider jcp = new JarClassProvider(JAR);
43 index = classCache.index(ProgressListener.none()); 46 CachingClassProvider classProvider = new CachingClassProvider(jcp);
44 decompiler = Decompilers.PROCYON.create(classCache, new SourceSettings(false, false)); 47 index = JarIndex.empty();
48 index.indexJar(jcp.getClassNames(), classProvider, ProgressListener.none());
49 decompiler = Decompilers.PROCYON.create(classProvider, new SourceSettings(false, false));
45 } 50 }
46 51
47 @Test 52 @Test
diff --git a/enigma/src/test/java/cuchaz/enigma/TestJarIndexConstructorReferences.java b/enigma/src/test/java/cuchaz/enigma/TestJarIndexConstructorReferences.java
index 48975c8..0790193 100644
--- a/enigma/src/test/java/cuchaz/enigma/TestJarIndexConstructorReferences.java
+++ b/enigma/src/test/java/cuchaz/enigma/TestJarIndexConstructorReferences.java
@@ -11,14 +11,16 @@
11 11
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import cuchaz.enigma.analysis.ClassCache;
15import cuchaz.enigma.analysis.EntryReference; 14import cuchaz.enigma.analysis.EntryReference;
16import cuchaz.enigma.analysis.index.JarIndex; 15import cuchaz.enigma.analysis.index.JarIndex;
16import cuchaz.enigma.classprovider.CachingClassProvider;
17import cuchaz.enigma.classprovider.JarClassProvider;
17import cuchaz.enigma.translation.representation.entry.ClassEntry; 18import cuchaz.enigma.translation.representation.entry.ClassEntry;
18import cuchaz.enigma.translation.representation.entry.MethodDefEntry; 19import cuchaz.enigma.translation.representation.entry.MethodDefEntry;
19import cuchaz.enigma.translation.representation.entry.MethodEntry; 20import cuchaz.enigma.translation.representation.entry.MethodEntry;
20import org.junit.Test; 21import org.junit.Test;
21 22
23import java.nio.file.Path;
22import java.nio.file.Paths; 24import java.nio.file.Paths;
23import java.util.Collection; 25import java.util.Collection;
24 26
@@ -28,6 +30,7 @@ import static org.hamcrest.Matchers.*;
28 30
29public class TestJarIndexConstructorReferences { 31public class TestJarIndexConstructorReferences {
30 32
33 public static final Path JAR = Paths.get("build/test-obf/constructors.jar");
31 private JarIndex index; 34 private JarIndex index;
32 35
33 private ClassEntry baseClass = newClass("a"); 36 private ClassEntry baseClass = newClass("a");
@@ -37,8 +40,9 @@ public class TestJarIndexConstructorReferences {
37 private ClassEntry callerClass = newClass("b"); 40 private ClassEntry callerClass = newClass("b");
38 41
39 public TestJarIndexConstructorReferences() throws Exception { 42 public TestJarIndexConstructorReferences() throws Exception {
40 ClassCache classCache = ClassCache.of(Paths.get("build/test-obf/constructors.jar")); 43 JarClassProvider jcp = new JarClassProvider(JAR);
41 index = classCache.index(ProgressListener.none()); 44 index = JarIndex.empty();
45 index.indexJar(jcp.getClassNames(), new CachingClassProvider(jcp), ProgressListener.none());
42 } 46 }
43 47
44 @Test 48 @Test
diff --git a/enigma/src/test/java/cuchaz/enigma/TestJarIndexInheritanceTree.java b/enigma/src/test/java/cuchaz/enigma/TestJarIndexInheritanceTree.java
index 76e379c..a9045f9 100644
--- a/enigma/src/test/java/cuchaz/enigma/TestJarIndexInheritanceTree.java
+++ b/enigma/src/test/java/cuchaz/enigma/TestJarIndexInheritanceTree.java
@@ -11,11 +11,12 @@
11 11
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import cuchaz.enigma.analysis.ClassCache;
15import cuchaz.enigma.analysis.EntryReference; 14import cuchaz.enigma.analysis.EntryReference;
16import cuchaz.enigma.analysis.index.EntryIndex; 15import cuchaz.enigma.analysis.index.EntryIndex;
17import cuchaz.enigma.analysis.index.InheritanceIndex; 16import cuchaz.enigma.analysis.index.InheritanceIndex;
18import cuchaz.enigma.analysis.index.JarIndex; 17import cuchaz.enigma.analysis.index.JarIndex;
18import cuchaz.enigma.classprovider.CachingClassProvider;
19import cuchaz.enigma.classprovider.JarClassProvider;
19import cuchaz.enigma.translation.mapping.EntryResolver; 20import cuchaz.enigma.translation.mapping.EntryResolver;
20import cuchaz.enigma.translation.mapping.IndexEntryResolver; 21import cuchaz.enigma.translation.mapping.IndexEntryResolver;
21import cuchaz.enigma.translation.representation.AccessFlags; 22import cuchaz.enigma.translation.representation.AccessFlags;
@@ -26,6 +27,7 @@ import cuchaz.enigma.translation.representation.entry.MethodEntry;
26import org.junit.Test; 27import org.junit.Test;
27import org.objectweb.asm.Opcodes; 28import org.objectweb.asm.Opcodes;
28 29
30import java.nio.file.Path;
29import java.nio.file.Paths; 31import java.nio.file.Paths;
30import java.util.Collection; 32import java.util.Collection;
31 33
@@ -35,6 +37,7 @@ import static org.hamcrest.Matchers.*;
35 37
36public class TestJarIndexInheritanceTree { 38public class TestJarIndexInheritanceTree {
37 39
40 public static final Path JAR = Paths.get("build/test-obf/inheritanceTree.jar");
38 private JarIndex index; 41 private JarIndex index;
39 42
40 private ClassEntry baseClass = newClass("a"); 43 private ClassEntry baseClass = newClass("a");
@@ -44,10 +47,10 @@ public class TestJarIndexInheritanceTree {
44 private FieldEntry nameField = newField(baseClass, "a", "Ljava/lang/String;"); 47 private FieldEntry nameField = newField(baseClass, "a", "Ljava/lang/String;");
45 private FieldEntry numThingsField = newField(subClassB, "a", "I"); 48 private FieldEntry numThingsField = newField(subClassB, "a", "I");
46 49
47 public TestJarIndexInheritanceTree() 50 public TestJarIndexInheritanceTree() throws Exception {
48 throws Exception { 51 JarClassProvider jcp = new JarClassProvider(JAR);
49 ClassCache classCache = ClassCache.of(Paths.get("build/test-obf/inheritanceTree.jar")); 52 index = JarIndex.empty();
50 index = classCache.index(ProgressListener.none()); 53 index.indexJar(jcp.getClassNames(), new CachingClassProvider(jcp), ProgressListener.none());
51 } 54 }
52 55
53 @Test 56 @Test
diff --git a/enigma/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java b/enigma/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java
index 103c366..6e3755c 100644
--- a/enigma/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java
+++ b/enigma/src/test/java/cuchaz/enigma/TestJarIndexLoneClass.java
@@ -15,6 +15,8 @@ import cuchaz.enigma.analysis.*;
15import cuchaz.enigma.analysis.index.EntryIndex; 15import cuchaz.enigma.analysis.index.EntryIndex;
16import cuchaz.enigma.analysis.index.InheritanceIndex; 16import cuchaz.enigma.analysis.index.InheritanceIndex;
17import cuchaz.enigma.analysis.index.JarIndex; 17import cuchaz.enigma.analysis.index.JarIndex;
18import cuchaz.enigma.classprovider.CachingClassProvider;
19import cuchaz.enigma.classprovider.JarClassProvider;
18import cuchaz.enigma.translation.VoidTranslator; 20import cuchaz.enigma.translation.VoidTranslator;
19import cuchaz.enigma.translation.representation.AccessFlags; 21import cuchaz.enigma.translation.representation.AccessFlags;
20import cuchaz.enigma.translation.representation.entry.ClassEntry; 22import cuchaz.enigma.translation.representation.entry.ClassEntry;
@@ -23,6 +25,7 @@ import cuchaz.enigma.translation.representation.entry.MethodDefEntry;
23import cuchaz.enigma.translation.representation.entry.MethodEntry; 25import cuchaz.enigma.translation.representation.entry.MethodEntry;
24import org.junit.Test; 26import org.junit.Test;
25 27
28import java.nio.file.Path;
26import java.nio.file.Paths; 29import java.nio.file.Paths;
27import java.util.Collection; 30import java.util.Collection;
28import java.util.List; 31import java.util.List;
@@ -33,11 +36,13 @@ import static org.hamcrest.Matchers.*;
33 36
34public class TestJarIndexLoneClass { 37public class TestJarIndexLoneClass {
35 38
39 public static final Path JAR = Paths.get("build/test-obf/loneClass.jar");
36 private JarIndex index; 40 private JarIndex index;
37 41
38 public TestJarIndexLoneClass() throws Exception { 42 public TestJarIndexLoneClass() throws Exception {
39 ClassCache classCache = ClassCache.of(Paths.get("build/test-obf/loneClass.jar")); 43 JarClassProvider jcp = new JarClassProvider(JAR);
40 index = classCache.index(ProgressListener.none()); 44 index = JarIndex.empty();
45 index.indexJar(jcp.getClassNames(), new CachingClassProvider(jcp), ProgressListener.none());
41 } 46 }
42 47
43 @Test 48 @Test
diff --git a/enigma/src/test/java/cuchaz/enigma/TokenChecker.java b/enigma/src/test/java/cuchaz/enigma/TokenChecker.java
index 96fc6da..feef272 100644
--- a/enigma/src/test/java/cuchaz/enigma/TokenChecker.java
+++ b/enigma/src/test/java/cuchaz/enigma/TokenChecker.java
@@ -12,11 +12,10 @@
12package cuchaz.enigma; 12package cuchaz.enigma;
13 13
14import com.google.common.collect.Lists; 14import com.google.common.collect.Lists;
15import cuchaz.enigma.analysis.ClassCache;
16import cuchaz.enigma.analysis.EntryReference; 15import cuchaz.enigma.analysis.EntryReference;
17import cuchaz.enigma.source.SourceIndex; 16import cuchaz.enigma.classprovider.CachingClassProvider;
17import cuchaz.enigma.classprovider.JarClassProvider;
18import cuchaz.enigma.source.*; 18import cuchaz.enigma.source.*;
19import cuchaz.enigma.source.Token;
20import cuchaz.enigma.translation.representation.entry.Entry; 19import cuchaz.enigma.translation.representation.entry.Entry;
21 20
22import java.io.IOException; 21import java.io.IOException;
@@ -28,8 +27,8 @@ public class TokenChecker {
28 private final Decompiler decompiler; 27 private final Decompiler decompiler;
29 28
30 protected TokenChecker(Path path) throws IOException { 29 protected TokenChecker(Path path) throws IOException {
31 ClassCache classCache = ClassCache.of(path); 30 CachingClassProvider classProvider = new CachingClassProvider(new JarClassProvider(path));
32 decompiler = Decompilers.PROCYON.create(classCache, new SourceSettings(false, false)); 31 decompiler = Decompilers.PROCYON.create(classProvider, new SourceSettings(false, false));
33 } 32 }
34 33
35 protected String getDeclarationToken(Entry<?> entry) { 34 protected String getDeclarationToken(Entry<?> entry) {
diff --git a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java
index 65941e5..60c70b7 100644
--- a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java
+++ b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java
@@ -14,6 +14,7 @@ package cuchaz.enigma.translation.mapping;
14import cuchaz.enigma.Enigma; 14import cuchaz.enigma.Enigma;
15import cuchaz.enigma.EnigmaProject; 15import cuchaz.enigma.EnigmaProject;
16import cuchaz.enigma.ProgressListener; 16import cuchaz.enigma.ProgressListener;
17import cuchaz.enigma.classprovider.ClasspathClassProvider;
17import cuchaz.enigma.translation.mapping.serde.enigma.EnigmaMappingsReader; 18import cuchaz.enigma.translation.mapping.serde.enigma.EnigmaMappingsReader;
18 19
19import java.nio.file.Path; 20import java.nio.file.Path;
@@ -30,7 +31,7 @@ public final class TestTinyV2InnerClasses {
30 31
31// @Test 32// @Test
32 public void testMappings() throws Exception { 33 public void testMappings() throws Exception {
33 EnigmaProject project = Enigma.create().openJar(jar, ProgressListener.none()); 34 EnigmaProject project = Enigma.create().openJar(jar, new ClasspathClassProvider(), ProgressListener.none());
34 project.setMappings(EnigmaMappingsReader.DIRECTORY.read(mappings, ProgressListener.none(), project.getEnigma().getProfile().getMappingSaveParameters())); 35 project.setMappings(EnigmaMappingsReader.DIRECTORY.read(mappings, ProgressListener.none(), project.getEnigma().getProfile().getMappingSaveParameters()));
35 36
36 } 37 }