diff options
| author | 2023-11-28 09:00:33 +0000 | |
|---|---|---|
| committer | 2023-11-28 09:00:33 +0000 | |
| commit | 7622b753d2a99bd8f2bbb4568fd84ca9458ffba5 (patch) | |
| tree | e3a5a6d2006787f2668e47bca34fb46beb40250c /enigma/src/test/java | |
| parent | Update deps (#535) (diff) | |
| parent | Merge branch 'upstream' into mapping-io (diff) | |
| download | enigma-fork-7622b753d2a99bd8f2bbb4568fd84ca9458ffba5.tar.gz enigma-fork-7622b753d2a99bd8f2bbb4568fd84ca9458ffba5.tar.xz enigma-fork-7622b753d2a99bd8f2bbb4568fd84ca9458ffba5.zip | |
Merge pull request #463 from NebelNidas/mapping-io
Initial Mapping-IO support
Diffstat (limited to 'enigma/src/test/java')
| -rw-r--r-- | enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java index 681fd3f..25f11fb 100644 --- a/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java +++ b/enigma/src/test/java/cuchaz/enigma/translation/mapping/TestReadWriteCycle.java | |||
| @@ -4,6 +4,7 @@ import java.io.File; | |||
| 4 | import java.io.IOException; | 4 | import java.io.IOException; |
| 5 | 5 | ||
| 6 | import org.junit.Assert; | 6 | import org.junit.Assert; |
| 7 | import org.junit.BeforeClass; | ||
| 7 | import org.junit.Test; | 8 | import org.junit.Test; |
| 8 | 9 | ||
| 9 | import cuchaz.enigma.ProgressListener; | 10 | import cuchaz.enigma.ProgressListener; |
| @@ -62,7 +63,7 @@ public class TestReadWriteCycle { | |||
| 62 | mappingFormat.write(testMappings, tempFile.toPath(), ProgressListener.none(), parameters); | 63 | mappingFormat.write(testMappings, tempFile.toPath(), ProgressListener.none(), parameters); |
| 63 | Assert.assertTrue("Written file not created", tempFile.exists()); | 64 | Assert.assertTrue("Written file not created", tempFile.exists()); |
| 64 | 65 | ||
| 65 | EntryTree<EntryMapping> loadedMappings = mappingFormat.read(tempFile.toPath(), ProgressListener.none(), parameters); | 66 | EntryTree<EntryMapping> loadedMappings = mappingFormat.read(tempFile.toPath(), ProgressListener.none(), parameters, null); |
| 66 | 67 | ||
| 67 | Assert.assertTrue("Loaded mappings don't contain testClazz", loadedMappings.contains(testClazz.a)); | 68 | Assert.assertTrue("Loaded mappings don't contain testClazz", loadedMappings.contains(testClazz.a)); |
| 68 | Assert.assertTrue("Loaded mappings don't contain testField1", loadedMappings.contains(testField1.a)); | 69 | Assert.assertTrue("Loaded mappings don't contain testField1", loadedMappings.contains(testField1.a)); |
| @@ -87,6 +88,11 @@ public class TestReadWriteCycle { | |||
| 87 | tempFile.delete(); | 88 | tempFile.delete(); |
| 88 | } | 89 | } |
| 89 | 90 | ||
| 91 | @BeforeClass | ||
| 92 | public static void setup() { | ||
| 93 | System.getProperties().setProperty("enigma.use_mappingio", "false"); | ||
| 94 | } | ||
| 95 | |||
| 90 | @Test | 96 | @Test |
| 91 | public void testEnigmaFile() throws IOException, MappingParseException { | 97 | public void testEnigmaFile() throws IOException, MappingParseException { |
| 92 | testReadWriteCycle(MappingFormat.ENIGMA_FILE, true, ".enigma"); | 98 | testReadWriteCycle(MappingFormat.ENIGMA_FILE, true, ".enigma"); |