Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: fb23cbb3 Define surefire plugin version d022084a Define ordering for MetadataStoreTest 99a7f6f0 PR-910: Match generic max absorption attribute name style with the rest c7390d71 PR-909: Update tests to JUnit 5 CraftBukkit Changes: f0661c351 PR-1230: Move unstructured PDC NBT serialisation to SNBT 452fcb599 PR-1256: Update tests to JUnit 5
This commit is contained in:
@@ -78,21 +78,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import io.github.classgraph.ScanResult;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.List;
|
||||
+import java.util.stream.Stream;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.junit.Test;
|
||||
+import org.junit.runner.RunWith;
|
||||
+import org.junit.runners.Parameterized;
|
||||
+import org.junit.jupiter.params.ParameterizedTest;
|
||||
+import org.junit.jupiter.params.provider.MethodSource;
|
||||
+
|
||||
+import static org.junit.Assert.fail;
|
||||
+import static org.junit.jupiter.api.Assertions.fail;
|
||||
+
|
||||
+@RunWith(Parameterized.class)
|
||||
+public class EntitySetItemSlotSilentOverrideTest extends AbstractTestingBase {
|
||||
+
|
||||
+ @Parameterized.Parameter
|
||||
+ public ClassInfo overridesSetItemSlot;
|
||||
+
|
||||
+ @Parameterized.Parameters(name = "{0}")
|
||||
+ public static Iterable<ClassInfo> parameters() {
|
||||
+ @MethodSource("parameters")
|
||||
+ public static Stream<ClassInfo> parameters() {
|
||||
+ final List<ClassInfo> classInfo = new ArrayList<>();
|
||||
+ try (ScanResult scanResult = new ClassGraph()
|
||||
+ .enableClassInfo()
|
||||
@@ -107,12 +103,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return classInfo;
|
||||
+ return classInfo.stream();
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
+ public void checkSetItemSlotSilentOverrides() {
|
||||
+ final MethodInfoList setItemSlot = this.overridesSetItemSlot.getDeclaredMethodInfo("setItemSlot");
|
||||
+ @ParameterizedTest
|
||||
+ @MethodSource("parameters")
|
||||
+ public void checkSetItemSlotSilentOverrides(ClassInfo overridesSetItemSlot) {
|
||||
+ final MethodInfoList setItemSlot = overridesSetItemSlot.getDeclaredMethodInfo("setItemSlot");
|
||||
+ for (final MethodInfo methodInfo : setItemSlot) {
|
||||
+ for (final MethodParameterInfo methodParameterInfo : methodInfo.getParameterInfo()) {
|
||||
+ if ("boolean".equals(methodParameterInfo.getTypeDescriptor().toStringWithSimpleNames())) {
|
||||
@@ -120,6 +117,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ fail(this.overridesSetItemSlot.getName() + " needs to override setItemSlot with the boolean silent parameter as well");
|
||||
+ fail(overridesSetItemSlot.getName() + " needs to override setItemSlot with the boolean silent parameter as well");
|
||||
+ }
|
||||
+}
|
||||
|
||||
Reference in New Issue
Block a user