|
1 | 1 | package org.quiltmc.enigma.translation.mapping;
|
2 | 2 |
|
3 | 3 | import org.junit.jupiter.api.Assertions;
|
4 |
| -import org.junit.jupiter.api.BeforeAll; |
| 4 | +import org.junit.jupiter.api.BeforeEach; |
5 | 5 | import org.junit.jupiter.api.Test;
|
6 | 6 | import org.quiltmc.enigma.TestEntryFactory;
|
7 | 7 | import org.quiltmc.enigma.TestUtil;
|
@@ -31,38 +31,35 @@ public class TestMethodOverrideParamJavadoc {
|
31 | 31 | private static Enigma enigma;
|
32 | 32 | private static EnigmaProject project;
|
33 | 33 |
|
34 |
| - @BeforeAll |
35 |
| - static void setupEnigma() throws IOException { |
| 34 | + @BeforeEach |
| 35 | + void setupEnigma() throws IOException { |
36 | 36 | enigma = Enigma.create();
|
37 | 37 | project = enigma.openJar(JAR, new ClasspathClassProvider(), ProgressListener.createEmpty());
|
38 | 38 | }
|
39 | 39 |
|
40 | 40 | void test(ReadWriteService readWriteService, String tmpNameSuffix) throws IOException, MappingParseException {
|
41 |
| - var remapper = project.getRemapper(); |
42 |
| - |
43 | 41 | ClassEntry inheritor = TestEntryFactory.newClass("a");
|
44 | 42 | MethodEntry method = TestEntryFactory.newMethod(inheritor, "a", "(D)D");
|
45 | 43 | LocalVariableEntry param = TestEntryFactory.newParameter(method, 1);
|
46 | 44 |
|
47 |
| - EntryMapping mapping = remapper.getMapping(param); |
| 45 | + EntryMapping mapping = project.getRemapper().getMapping(param); |
48 | 46 | Assertions.assertNull(mapping.javadoc());
|
49 | 47 |
|
50 |
| - remapper.putMapping(TestUtil.newVC(), param, mapping.withJavadoc("gaming")); |
| 48 | + project.getRemapper().putMapping(TestUtil.newVC(), param, mapping.withJavadoc("gaming")); |
51 | 49 |
|
52 |
| - EntryMapping withJavadoc = remapper.getMapping(param); |
| 50 | + EntryMapping withJavadoc = project.getRemapper().getMapping(param); |
53 | 51 | Assertions.assertEquals("gaming", withJavadoc.javadoc());
|
54 | 52 |
|
55 | 53 | File tempFile = File.createTempFile("testMethodOverrideParamJavadoc", tmpNameSuffix);
|
56 | 54 | tempFile.delete(); //remove the auto created file
|
57 | 55 |
|
58 |
| - readWriteService.write(remapper.getMappings(), tempFile.toPath(), ProgressListener.createEmpty(), PARAMETERS); |
| 56 | + readWriteService.write(project.getRemapper().getMappings(), tempFile.toPath(), ProgressListener.createEmpty(), PARAMETERS); |
59 | 57 | Assertions.assertTrue(tempFile.exists(), "Written file not created");
|
60 | 58 | EntryTree<EntryMapping> loadedMappings = readWriteService.read(tempFile.toPath(), ProgressListener.createEmpty());
|
61 | 59 |
|
62 | 60 | project.setMappings(loadedMappings, ProgressListener.createEmpty());
|
63 |
| - remapper = project.getRemapper(); |
64 | 61 |
|
65 |
| - EntryMapping newMapping = remapper.getMapping(param); |
| 62 | + EntryMapping newMapping = project.getRemapper().getMapping(param); |
66 | 63 | Assertions.assertEquals("gaming", newMapping.javadoc());
|
67 | 64 | }
|
68 | 65 |
|
|
0 commit comments