Cleanup usages of static imports and build script so that our build doesn't spam useless error like messages.

So that it is easier to see real errors.
Add compatibility checking to standard testing tasks.
This commit is contained in:
LexManos committed 2023-07-17 17:26:28 -07:00
1 parent e6bb7eecbd
commit ebb316a15c
28 files changed
+202 -258

No files matched your search

@@ -5,8 +5,6 @@
package net.minecraftforge.debug;
import static net.minecraftforge.debug.DataGeneratorTest.MODID;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -130,7 +128,7 @@ import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.TrapDoorBlock;
@SuppressWarnings("deprecation")
@Mod(MODID)
@Mod(DataGeneratorTest.MODID)
@Mod.EventBusSubscriber(bus = Bus.MOD)
public class DataGeneratorTest
{
@@ -28,8 +28,6 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import static net.minecraftforge.common.util.TextTable.column;
@Mod(LazyCapabilitiesOnItemsTest.MOD_ID)
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = LazyCapabilitiesOnItemsTest.MOD_ID)
public class LazyCapabilitiesOnItemsTest
@@ -146,8 +144,8 @@ public class LazyCapabilitiesOnItemsTest
bus.unregister(capAttachmentHandler);
TextTable table = new TextTable(Lists.newArrayList(
column("Test type", TextTable.Alignment.LEFT),
column("Total time", TextTable.Alignment.CENTER)
TextTable.column("Test type", TextTable.Alignment.LEFT),
TextTable.column("Total time", TextTable.Alignment.CENTER)
));
table.add("Lazy: Disabled / Caps: None", simpleNoCapsLazyDisabledElapsed + " ms.");
@@ -8,14 +8,13 @@ package net.minecraftforge.test;
import com.mojang.datafixers.util.Unit;
import net.minecraftforge.common.util.LazyOptional;
import org.apache.commons.lang3.mutable.MutableInt;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class LazyOptionalTest
{
@Test
@@ -49,8 +48,8 @@ public class LazyOptionalTest
{
thread.join();
}
assertEquals(threads.size(), successfulThreads.get());
assertEquals(1, supplierCalls.get());
Assertions.assertEquals(threads.size(), successfulThreads.get());
Assertions.assertEquals(1, supplierCalls.get());
}
@Test
@@ -62,6 +61,6 @@ public class LazyOptionalTest
});
badLazy.ifPresent(u -> {});
badLazy.ifPresent(u -> {});
assertEquals(1, supplierCalls.intValue());
Assertions.assertEquals(1, supplierCalls.intValue());
}
}