diff --git a/mapping-io-extras/src/test/java/net/fabricmc/mappingio/extras/MappingTreeRemapperTest.java b/mapping-io-extras/src/test/java/net/fabricmc/mappingio/extras/MappingTreeRemapperTest.java index 743184ef..f5cdb0a2 100644 --- a/mapping-io-extras/src/test/java/net/fabricmc/mappingio/extras/MappingTreeRemapperTest.java +++ b/mapping-io-extras/src/test/java/net/fabricmc/mappingio/extras/MappingTreeRemapperTest.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test; import org.objectweb.asm.Type; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; import net.fabricmc.mappingio.tree.MappingTree; import net.fabricmc.mappingio.tree.MappingTree.ClassMapping; import net.fabricmc.mappingio.tree.MappingTree.FieldMapping; @@ -50,7 +50,7 @@ public class MappingTreeRemapperTest { @BeforeAll public static void setup() throws IOException { - mappingTree = TestHelper.acceptTestMappings(new MemoryMappingTree()); + mappingTree = TestUtil.acceptTestMappings(new MemoryMappingTree()); srcNs = mappingTree.getSrcNamespace(); dstNs = mappingTree.getDstNamespaces().get(0); diff --git a/src/main/java/net/fabricmc/mappingio/format/FeatureSet.java b/src/main/java/net/fabricmc/mappingio/format/FeatureSet.java index 3beec17d..4c3a78d8 100644 --- a/src/main/java/net/fabricmc/mappingio/format/FeatureSet.java +++ b/src/main/java/net/fabricmc/mappingio/format/FeatureSet.java @@ -40,19 +40,19 @@ default boolean supportsClasses() { } default boolean supportsFields() { - return FeatureSetHelper.isSupported(fields()); + return FeatureSetUtil.isSupported(fields()); } default boolean supportsMethods() { - return FeatureSetHelper.isSupported(methods()); + return FeatureSetUtil.isSupported(methods()); } default boolean supportsArgs() { - return FeatureSetHelper.isSupported(args()); + return FeatureSetUtil.isSupported(args()); } default boolean supportsVars() { - return FeatureSetHelper.isSupported(vars()); + return FeatureSetUtil.isSupported(vars()); } enum MetadataSupport { diff --git a/src/main/java/net/fabricmc/mappingio/format/FeatureSetHelper.java b/src/main/java/net/fabricmc/mappingio/format/FeatureSetUtil.java similarity index 96% rename from src/main/java/net/fabricmc/mappingio/format/FeatureSetHelper.java rename to src/main/java/net/fabricmc/mappingio/format/FeatureSetUtil.java index 27855f23..864fc737 100644 --- a/src/main/java/net/fabricmc/mappingio/format/FeatureSetHelper.java +++ b/src/main/java/net/fabricmc/mappingio/format/FeatureSetUtil.java @@ -21,8 +21,8 @@ import net.fabricmc.mappingio.format.FeatureSet.MemberSupport; // Only exists since Java 8 doesn't support private interface methods -final class FeatureSetHelper { - private FeatureSetHelper() { +final class FeatureSetUtil { + private FeatureSetUtil() { } static boolean isSupported(MemberSupport members) { diff --git a/src/test/java/net/fabricmc/mappingio/TestFileUpdater.java b/src/test/java/net/fabricmc/mappingio/TestFileUpdater.java index dc55b91a..3868c5f5 100644 --- a/src/test/java/net/fabricmc/mappingio/TestFileUpdater.java +++ b/src/test/java/net/fabricmc/mappingio/TestFileUpdater.java @@ -28,15 +28,15 @@ public static void main(String[] args) throws IOException { continue; } - Path defaultPath = TestHelper.MappingDirs.VALID.resolve(TestHelper.getFileName(format)); - Path holesPath = TestHelper.MappingDirs.VALID_WITH_HOLES.resolve(TestHelper.getFileName(format)); - Path repeatPath = TestHelper.MappingDirs.REPEATED_ELEMENTS.resolve(TestHelper.getFileName(format)); + Path defaultPath = TestUtil.MappingDirs.VALID.resolve(TestUtil.getFileName(format)); + Path holesPath = TestUtil.MappingDirs.VALID_WITH_HOLES.resolve(TestUtil.getFileName(format)); + Path repeatPath = TestUtil.MappingDirs.REPEATED_ELEMENTS.resolve(TestUtil.getFileName(format)); - TestHelper.acceptTestMappings(MappingWriter.create(defaultPath, format)); - TestHelper.acceptTestMappingsWithHoles(MappingWriter.create(holesPath, format)); + TestUtil.acceptTestMappings(MappingWriter.create(defaultPath, format)); + TestUtil.acceptTestMappingsWithHoles(MappingWriter.create(holesPath, format)); if (format != MappingFormat.ENIGMA_DIR) { - TestHelper.acceptTestMappingsWithRepeats( + TestUtil.acceptTestMappingsWithRepeats( MappingWriter.create(repeatPath, format), format != MappingFormat.ENIGMA_FILE, format != MappingFormat.ENIGMA_FILE); diff --git a/src/test/java/net/fabricmc/mappingio/TestHelper.java b/src/test/java/net/fabricmc/mappingio/TestUtil.java similarity index 99% rename from src/test/java/net/fabricmc/mappingio/TestHelper.java rename to src/test/java/net/fabricmc/mappingio/TestUtil.java index 29e78291..423cb936 100644 --- a/src/test/java/net/fabricmc/mappingio/TestHelper.java +++ b/src/test/java/net/fabricmc/mappingio/TestUtil.java @@ -35,10 +35,10 @@ import net.fabricmc.mappingio.tree.MappingTreeView; import net.fabricmc.mappingio.tree.MemoryMappingTree; -public final class TestHelper { +public final class TestUtil { public static Path getResource(String slashPrefixedResourcePath) { try { - return Paths.get(TestHelper.class.getResource(slashPrefixedResourcePath).toURI()); + return Paths.get(TestUtil.class.getResource(slashPrefixedResourcePath).toURI()); } catch (URISyntaxException e) { throw new RuntimeException(e); } diff --git a/src/test/java/net/fabricmc/mappingio/read/DetectionTest.java b/src/test/java/net/fabricmc/mappingio/read/DetectionTest.java index 477bfebe..7ea8c0c2 100644 --- a/src/test/java/net/fabricmc/mappingio/read/DetectionTest.java +++ b/src/test/java/net/fabricmc/mappingio/read/DetectionTest.java @@ -30,11 +30,11 @@ import net.fabricmc.mappingio.MappingReader; import net.fabricmc.mappingio.NopMappingVisitor; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; import net.fabricmc.mappingio.format.MappingFormat; public class DetectionTest { - private static final Path dir = TestHelper.MappingDirs.DETECTION; + private static final Path dir = TestUtil.MappingDirs.DETECTION; @Test public void enigmaFile() throws Exception { @@ -121,7 +121,7 @@ public void jobfFile() throws Exception { } private void check(MappingFormat format) throws Exception { - Path path = dir.resolve(TestHelper.getFileName(format)); + Path path = dir.resolve(TestUtil.getFileName(format)); assertEquals(format, MappingReader.detectFormat(path)); if (!format.hasSingleFile()) return; diff --git a/src/test/java/net/fabricmc/mappingio/read/ValidContentReadTest.java b/src/test/java/net/fabricmc/mappingio/read/ValidContentReadTest.java index 27b1121f..f56c01fb 100644 --- a/src/test/java/net/fabricmc/mappingio/read/ValidContentReadTest.java +++ b/src/test/java/net/fabricmc/mappingio/read/ValidContentReadTest.java @@ -23,7 +23,7 @@ import net.fabricmc.mappingio.MappingReader; import net.fabricmc.mappingio.SubsetAssertingVisitor; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; import net.fabricmc.mappingio.VisitOrderVerifyingVisitor; import net.fabricmc.mappingio.adapter.FlatAsRegularMappingVisitor; import net.fabricmc.mappingio.adapter.MappingSourceNsSwitch; @@ -145,9 +145,9 @@ public void jobfFile() throws Exception { } private void checkDefault(MappingFormat format) throws Exception { - Path path = TestHelper.MappingDirs.VALID.resolve(TestHelper.getFileName(format)); + Path path = TestUtil.MappingDirs.VALID.resolve(TestUtil.getFileName(format)); - VisitableMappingTree referenceTree = TestHelper.acceptTestMappings(new MemoryMappingTree()); + VisitableMappingTree referenceTree = TestUtil.acceptTestMappings(new MemoryMappingTree()); VisitableMappingTree tree = new MemoryMappingTree(); boolean allowConsecutiveDuplicateElementVisits = false; @@ -167,9 +167,9 @@ private void checkDefault(MappingFormat format) throws Exception { } private void checkRepeated(MappingFormat format, boolean allowConsecutiveDuplicateElementVisits) throws Exception { - Path path = TestHelper.MappingDirs.REPEATED_ELEMENTS.resolve(TestHelper.getFileName(format)); + Path path = TestUtil.MappingDirs.REPEATED_ELEMENTS.resolve(TestUtil.getFileName(format)); - VisitableMappingTree referenceTree = TestHelper.acceptTestMappingsWithRepeats(new MemoryMappingTree(), true, true); + VisitableMappingTree referenceTree = TestUtil.acceptTestMappingsWithRepeats(new MemoryMappingTree(), true, true); VisitableMappingTree tree = new MemoryMappingTree(); MappingReader.read(path, format, new VisitOrderVerifyingVisitor(tree, allowConsecutiveDuplicateElementVisits)); @@ -188,9 +188,9 @@ private void checkRepeated(MappingFormat format, boolean allowConsecutiveDuplica } private void checkHoles(MappingFormat format) throws Exception { - Path path = TestHelper.MappingDirs.VALID_WITH_HOLES.resolve(TestHelper.getFileName(format)); + Path path = TestUtil.MappingDirs.VALID_WITH_HOLES.resolve(TestUtil.getFileName(format)); - VisitableMappingTree referenceTree = TestHelper.acceptTestMappingsWithHoles(new MemoryMappingTree()); + VisitableMappingTree referenceTree = TestUtil.acceptTestMappingsWithHoles(new MemoryMappingTree()); VisitableMappingTree tree = new MemoryMappingTree(); boolean allowConsecutiveDuplicateElementVisits = false; diff --git a/src/test/java/net/fabricmc/mappingio/tree/MergeTest.java b/src/test/java/net/fabricmc/mappingio/tree/MergeTest.java index 5e080109..8ae83c74 100644 --- a/src/test/java/net/fabricmc/mappingio/tree/MergeTest.java +++ b/src/test/java/net/fabricmc/mappingio/tree/MergeTest.java @@ -32,7 +32,7 @@ import net.fabricmc.mappingio.MappingReader; import net.fabricmc.mappingio.MappingVisitor; import net.fabricmc.mappingio.SubsetAssertingVisitor; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; import net.fabricmc.mappingio.VisitOrderVerifyingVisitor; import net.fabricmc.mappingio.adapter.FlatAsRegularMappingVisitor; import net.fabricmc.mappingio.tree.MappingTree.ClassMapping; @@ -41,7 +41,7 @@ import net.fabricmc.mappingio.tree.MemoryMappingTree.FieldEntry; public class MergeTest { - private static final Path dir = TestHelper.MappingDirs.MERGING; + private static final Path dir = TestUtil.MappingDirs.MERGING; private static final String ns1 = "ns1"; private static final String ns2 = "ns2"; private static final String ns3 = "ns3"; diff --git a/src/test/java/net/fabricmc/mappingio/tree/MetadataTest.java b/src/test/java/net/fabricmc/mappingio/tree/MetadataTest.java index 8965a20a..4f1975a9 100644 --- a/src/test/java/net/fabricmc/mappingio/tree/MetadataTest.java +++ b/src/test/java/net/fabricmc/mappingio/tree/MetadataTest.java @@ -32,7 +32,7 @@ import net.fabricmc.mappingio.MappingFlag; import net.fabricmc.mappingio.NopMappingVisitor; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; public class MetadataTest { private static final Random random = new Random(); @@ -42,7 +42,7 @@ public class MetadataTest { @BeforeAll public static void setup() throws Exception { - tree = TestHelper.acceptTestMappings(new MemoryMappingTree()); + tree = TestUtil.acceptTestMappings(new MemoryMappingTree()); tree.getMetadata().clear(); for (int i = 0; i < 40; i++) { diff --git a/src/test/java/net/fabricmc/mappingio/tree/SetNamespacesTest.java b/src/test/java/net/fabricmc/mappingio/tree/SetNamespacesTest.java index 2a521677..dd379f2c 100644 --- a/src/test/java/net/fabricmc/mappingio/tree/SetNamespacesTest.java +++ b/src/test/java/net/fabricmc/mappingio/tree/SetNamespacesTest.java @@ -25,7 +25,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; public class SetNamespacesTest { private MemoryMappingTree tree; @@ -36,7 +36,7 @@ public class SetNamespacesTest { @BeforeEach public void setup() throws IOException { tree = new MemoryMappingTree(); - TestHelper.acceptTestMappings(tree); + TestUtil.acceptTestMappings(tree); srcNs = tree.getSrcNamespace(); dstNs0 = tree.getDstNamespaces().get(0); diff --git a/src/test/java/net/fabricmc/mappingio/visiting/VisitEndTest.java b/src/test/java/net/fabricmc/mappingio/visiting/VisitEndTest.java index 3574368c..7cf36caa 100644 --- a/src/test/java/net/fabricmc/mappingio/visiting/VisitEndTest.java +++ b/src/test/java/net/fabricmc/mappingio/visiting/VisitEndTest.java @@ -33,7 +33,7 @@ import net.fabricmc.mappingio.MappingReader; import net.fabricmc.mappingio.MappingVisitor; import net.fabricmc.mappingio.SubsetAssertingVisitor; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; import net.fabricmc.mappingio.VisitOrderVerifyingVisitor; import net.fabricmc.mappingio.adapter.FlatAsRegularMappingVisitor; import net.fabricmc.mappingio.format.MappingFormat; @@ -127,17 +127,17 @@ public void jobfFile() throws Exception { } private void check(MappingFormat format) throws Exception { - checkDir(TestHelper.MappingDirs.DETECTION, format); - checkDir(TestHelper.MappingDirs.VALID, format); - checkDir(TestHelper.MappingDirs.REPEATED_ELEMENTS, format); - checkDir(TestHelper.MappingDirs.VALID_WITH_HOLES, format); + checkDir(TestUtil.MappingDirs.DETECTION, format); + checkDir(TestUtil.MappingDirs.VALID, format); + checkDir(TestUtil.MappingDirs.REPEATED_ELEMENTS, format); + checkDir(TestUtil.MappingDirs.VALID_WITH_HOLES, format); } private void checkDir(Path dir, MappingFormat format) throws Exception { - Path path = dir.resolve(TestHelper.getFileName(format)); + Path path = dir.resolve(TestUtil.getFileName(format)); if (!Files.exists(path)) return; - MappingTreeView supTree = TestHelper.MappingDirs.getCorrespondingTree(dir); + MappingTreeView supTree = TestUtil.MappingDirs.getCorrespondingTree(dir); checkCompliance(format, path, 1, true, supTree); checkCompliance(format, path, 1, false, supTree); diff --git a/src/test/java/net/fabricmc/mappingio/write/WriteTest.java b/src/test/java/net/fabricmc/mappingio/write/WriteTest.java index 1da5f300..29aa63d9 100644 --- a/src/test/java/net/fabricmc/mappingio/write/WriteTest.java +++ b/src/test/java/net/fabricmc/mappingio/write/WriteTest.java @@ -31,7 +31,7 @@ import net.fabricmc.mappingio.MappingReader; import net.fabricmc.mappingio.MappingWriter; import net.fabricmc.mappingio.SubsetAssertingVisitor; -import net.fabricmc.mappingio.TestHelper; +import net.fabricmc.mappingio.TestUtil; import net.fabricmc.mappingio.adapter.FlatAsRegularMappingVisitor; import net.fabricmc.mappingio.adapter.ForwardingMappingVisitor; import net.fabricmc.mappingio.adapter.MappingNsCompleter; @@ -52,15 +52,15 @@ public class WriteTest { @BeforeAll public static void setup() throws Exception { - validTree = TestHelper.acceptTestMappings(new MemoryMappingTree()); + validTree = TestUtil.acceptTestMappings(new MemoryMappingTree()); treeNsAltMap.put(validTree.getDstNamespaces().get(0), validTree.getSrcNamespace()); treeNsAltMap.put(validTree.getDstNamespaces().get(1), validTree.getSrcNamespace()); - validWithRepeatsTree = TestHelper.acceptTestMappingsWithRepeats(new MemoryMappingTree(), true, true); + validWithRepeatsTree = TestUtil.acceptTestMappingsWithRepeats(new MemoryMappingTree(), true, true); treeWithRepeatsNsAltMap.put(validWithRepeatsTree.getDstNamespaces().get(0), validWithRepeatsTree.getSrcNamespace()); treeWithRepeatsNsAltMap.put(validWithRepeatsTree.getDstNamespaces().get(1), validWithRepeatsTree.getSrcNamespace()); - validWithHolesTree = TestHelper.acceptTestMappingsWithHoles(new MemoryMappingTree()); + validWithHolesTree = TestUtil.acceptTestMappingsWithHoles(new MemoryMappingTree()); treeWithHolesNsAltMap.put(validWithHolesTree.getDstNamespaces().get(0), validWithHolesTree.getSrcNamespace()); treeWithHolesNsAltMap.put(validWithHolesTree.getDstNamespaces().get(1), validWithHolesTree.getSrcNamespace()); } @@ -136,19 +136,19 @@ public void jobfFile() throws Exception { } private void check(MappingFormat format) throws Exception { - Path path = dir.resolve(TestHelper.getFileName(format)); - TestHelper.acceptTestMappings(MappingWriter.create(path, format)); + Path path = dir.resolve(TestUtil.getFileName(format)); + TestUtil.acceptTestMappings(MappingWriter.create(path, format)); readWithMio(validTree, path, format); readWithLorenz(path, format); readWithSrgUtils(validTree, format, treeNsAltMap); boolean isEnigma = format == MappingFormat.ENIGMA_FILE || format == MappingFormat.ENIGMA_DIR; - TestHelper.acceptTestMappingsWithRepeats(MappingWriter.create(path, format), !isEnigma, !isEnigma); + TestUtil.acceptTestMappingsWithRepeats(MappingWriter.create(path, format), !isEnigma, !isEnigma); readWithMio(validWithRepeatsTree, path, format); readWithLorenz(path, format); readWithSrgUtils(validWithRepeatsTree, format, treeWithRepeatsNsAltMap); - TestHelper.acceptTestMappingsWithHoles(MappingWriter.create(path, format)); + TestUtil.acceptTestMappingsWithHoles(MappingWriter.create(path, format)); readWithMio(validWithHolesTree, path, format); readWithLorenz(path, format); readWithSrgUtils(validWithHolesTree, format, treeWithHolesNsAltMap); @@ -163,13 +163,13 @@ private void readWithMio(MappingTreeView origTree, Path outputPath, MappingForma } private void readWithLorenz(Path path, MappingFormat format) throws Exception { - org.cadixdev.lorenz.io.MappingFormat lorenzFormat = TestHelper.toLorenzFormat(format); + org.cadixdev.lorenz.io.MappingFormat lorenzFormat = TestUtil.toLorenzFormat(format); if (lorenzFormat == null) return; lorenzFormat.read(path); } private void readWithSrgUtils(MappingTreeView tree, MappingFormat format, Map nsAltMap) throws Exception { - IMappingFile.Format srgUtilsFormat = TestHelper.toSrgUtilsFormat(format); + IMappingFile.Format srgUtilsFormat = TestUtil.toSrgUtilsFormat(format); if (srgUtilsFormat == null) return; // TODO: Remove once https://github.com/neoforged/SRGUtils/issues/7 is fixed @@ -189,7 +189,7 @@ public boolean visitElementContent(MappedElementKind targetKind) throws IOExcept }, nsAltMap)); - Path path = TestHelper.writeToDir(dstNsCompTree, dir, format); + Path path = TestUtil.writeToDir(dstNsCompTree, dir, format); INamedMappingFile.load(path.toFile()); } }