diff options
| author | 2025-09-11 17:35:30 +0100 | |
|---|---|---|
| committer | 2025-09-13 09:14:23 +0100 | |
| commit | f8c7b8497e9687e15123caca7d4fde54f5bf067a (patch) | |
| tree | 92a9da7756e0e18cb8925c1cc01e2a2edc10e60f /enigma/src/test/java | |
| parent | Add factory methods to the entry views (diff) | |
| download | enigma-fork-f8c7b8497e9687e15123caca7d4fde54f5bf067a.tar.gz enigma-fork-f8c7b8497e9687e15123caca7d4fde54f5bf067a.tar.xz enigma-fork-f8c7b8497e9687e15123caca7d4fde54f5bf067a.zip | |
Allow you to specify the libraries in the program args rather than always using the runtime classpath
Diffstat (limited to 'enigma/src/test/java')
3 files changed, 7 insertions, 7 deletions
diff --git a/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java b/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java index b19aa77..024f2bb 100644 --- a/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java +++ b/enigma/src/test/java/cuchaz/enigma/TestDeobfed.java | |||
| @@ -18,11 +18,11 @@ import static org.hamcrest.Matchers.containsInAnyOrder; | |||
| 18 | import java.nio.file.Files; | 18 | import java.nio.file.Files; |
| 19 | import java.nio.file.Path; | 19 | import java.nio.file.Path; |
| 20 | import java.nio.file.Paths; | 20 | import java.nio.file.Paths; |
| 21 | import java.util.List; | ||
| 21 | 22 | ||
| 22 | import org.junit.BeforeClass; | 23 | import org.junit.BeforeClass; |
| 23 | import org.junit.Test; | 24 | import org.junit.Test; |
| 24 | 25 | ||
| 25 | import cuchaz.enigma.classprovider.ClasspathClassProvider; | ||
| 26 | import cuchaz.enigma.source.Decompiler; | 26 | import cuchaz.enigma.source.Decompiler; |
| 27 | import cuchaz.enigma.source.Decompilers; | 27 | import cuchaz.enigma.source.Decompilers; |
| 28 | import cuchaz.enigma.source.SourceSettings; | 28 | import cuchaz.enigma.source.SourceSettings; |
| @@ -37,10 +37,10 @@ public class TestDeobfed { | |||
| 37 | Enigma enigma = Enigma.create(); | 37 | Enigma enigma = Enigma.create(); |
| 38 | 38 | ||
| 39 | Files.createDirectories(DEOBF.getParent()); | 39 | Files.createDirectories(DEOBF.getParent()); |
| 40 | EnigmaProject obfProject = enigma.openJar(OBF, new ClasspathClassProvider(), ProgressListener.none()); | 40 | EnigmaProject obfProject = enigma.openJar(OBF, List.of(), ProgressListener.none()); |
| 41 | obfProject.exportRemappedJar(ProgressListener.none()).write(DEOBF, ProgressListener.none()); | 41 | obfProject.exportRemappedJar(ProgressListener.none()).write(DEOBF, ProgressListener.none()); |
| 42 | 42 | ||
| 43 | deobfProject = enigma.openJar(DEOBF, new ClasspathClassProvider(), ProgressListener.none()); | 43 | deobfProject = enigma.openJar(DEOBF, List.of(), ProgressListener.none()); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | @Test | 46 | @Test |
diff --git a/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java b/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java index 587494e..4eb09f6 100644 --- a/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java +++ b/enigma/src/test/java/cuchaz/enigma/TestDeobfuscator.java | |||
| @@ -13,10 +13,10 @@ package cuchaz.enigma; | |||
| 13 | 13 | ||
| 14 | import java.io.IOException; | 14 | import java.io.IOException; |
| 15 | import java.nio.file.Paths; | 15 | import java.nio.file.Paths; |
| 16 | import java.util.List; | ||
| 16 | 17 | ||
| 17 | import org.junit.Test; | 18 | import org.junit.Test; |
| 18 | 19 | ||
| 19 | import cuchaz.enigma.classprovider.ClasspathClassProvider; | ||
| 20 | import cuchaz.enigma.source.Decompiler; | 20 | import cuchaz.enigma.source.Decompiler; |
| 21 | import cuchaz.enigma.source.Decompilers; | 21 | import cuchaz.enigma.source.Decompilers; |
| 22 | import cuchaz.enigma.source.SourceSettings; | 22 | import cuchaz.enigma.source.SourceSettings; |
| @@ -24,7 +24,7 @@ import cuchaz.enigma.source.SourceSettings; | |||
| 24 | public class TestDeobfuscator { | 24 | public class TestDeobfuscator { |
| 25 | private EnigmaProject openProject() throws IOException { | 25 | private EnigmaProject openProject() throws IOException { |
| 26 | Enigma enigma = Enigma.create(); | 26 | Enigma enigma = Enigma.create(); |
| 27 | return enigma.openJar(Paths.get("build/test-obf/loneClass.jar"), new ClasspathClassProvider(), ProgressListener.none()); | 27 | return enigma.openJar(Paths.get("build/test-obf/loneClass.jar"), List.of(), ProgressListener.none()); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | @Test | 30 | @Test |
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 659ac53..9164abe 100644 --- a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java +++ b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestTinyV2InnerClasses.java | |||
| @@ -13,11 +13,11 @@ package cuchaz.enigma.translation.mapping; | |||
| 13 | 13 | ||
| 14 | import java.nio.file.Path; | 14 | import java.nio.file.Path; |
| 15 | import java.nio.file.Paths; | 15 | import java.nio.file.Paths; |
| 16 | import java.util.List; | ||
| 16 | 17 | ||
| 17 | import cuchaz.enigma.Enigma; | 18 | import cuchaz.enigma.Enigma; |
| 18 | import cuchaz.enigma.EnigmaProject; | 19 | import cuchaz.enigma.EnigmaProject; |
| 19 | import cuchaz.enigma.ProgressListener; | 20 | import cuchaz.enigma.ProgressListener; |
| 20 | import cuchaz.enigma.classprovider.ClasspathClassProvider; | ||
| 21 | import cuchaz.enigma.translation.mapping.serde.enigma.EnigmaMappingsReader; | 21 | import cuchaz.enigma.translation.mapping.serde.enigma.EnigmaMappingsReader; |
| 22 | 22 | ||
| 23 | public final class TestTinyV2InnerClasses { | 23 | public final class TestTinyV2InnerClasses { |
| @@ -31,7 +31,7 @@ public final class TestTinyV2InnerClasses { | |||
| 31 | 31 | ||
| 32 | // @Test | 32 | // @Test |
| 33 | public void testMappings() throws Exception { | 33 | public void testMappings() throws Exception { |
| 34 | EnigmaProject project = Enigma.create().openJar(jar, new ClasspathClassProvider(), ProgressListener.none()); | 34 | EnigmaProject project = Enigma.create().openJar(jar, List.of(), ProgressListener.none()); |
| 35 | 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())); |
| 36 | } | 36 | } |
| 37 | } | 37 | } |