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:
Nassim Jahnke
2023-09-24 17:16:58 +10:00
parent 63a40050bd
commit 358877e2e2
40 changed files with 292 additions and 295 deletions

View File

@@ -7281,7 +7281,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package io.papermc.paper.plugin;
+
+import io.papermc.paper.plugin.entrypoint.dependency.MetaDependencyTree;
+import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+
@@ -7351,9 +7351,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy;
+import io.papermc.paper.plugin.entrypoint.strategy.ProviderConfiguration;
+import io.papermc.paper.plugin.provider.PluginProvider;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
@@ -7434,7 +7434,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ setup("RedFire", new String[]{"BrightBlueGrass", "BigPaper"}, new String[]{"BlueFire", "GreenGlass", "BigGrass"}, EMPTY);
+ }
+
+ @Before
+ @BeforeEach
+ public void loadProviders() {
+ AtomicInteger currentLoad = new AtomicInteger();
+ ModernPluginLoadingStrategy<PaperTestPlugin> modernPluginLoadingStrategy = new ModernPluginLoadingStrategy<>(new ProviderConfiguration<>() {
@@ -7458,16 +7458,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ for (PluginProvider<PaperTestPlugin> provider : REGISTERED_PROVIDERS) {
+ TestPluginMeta pluginMeta = (TestPluginMeta) provider.getMeta();
+ String identifier = pluginMeta.getName();
+ Assert.assertTrue("Provider wasn't loaded! (%s)".formatted(identifier), LOAD_ORDER.containsKey(identifier));
+ Assertions.assertTrue(LOAD_ORDER.containsKey(identifier), "Provider wasn't loaded! (%s)".formatted(identifier));
+
+ int index = LOAD_ORDER.get(identifier);
+
+ // Hard dependencies should be loaded BEFORE
+ for (String hardDependency : pluginMeta.getPluginDependencies()) {
+ Assert.assertTrue("Plugin (%s) is missing hard dependency (%s)".formatted(identifier, hardDependency), LOAD_ORDER.containsKey(hardDependency));
+ Assertions.assertTrue(LOAD_ORDER.containsKey(hardDependency), "Plugin (%s) is missing hard dependency (%s)".formatted(identifier, hardDependency));
+
+ int dependencyIndex = LOAD_ORDER.get(hardDependency);
+ Assert.assertTrue("Plugin (%s) was not loaded BEFORE soft dependency. (%s)".formatted(identifier, hardDependency), index > dependencyIndex);
+ Assertions.assertTrue(index > dependencyIndex, "Plugin (%s) was not loaded BEFORE soft dependency. (%s)".formatted(identifier, hardDependency));
+ }
+
+ for (String softDependency : pluginMeta.getPluginSoftDependencies()) {
@@ -7477,7 +7477,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ int dependencyIndex = LOAD_ORDER.get(softDependency);
+
+ Assert.assertTrue("Plugin (%s) was not loaded BEFORE soft dependency. (%s)".formatted(identifier, softDependency), index > dependencyIndex);
+ Assertions.assertTrue(index > dependencyIndex, "Plugin (%s) was not loaded BEFORE soft dependency. (%s)".formatted(identifier, softDependency));
+ }
+
+ for (String loadBefore : pluginMeta.getLoadBeforePlugins()) {
@@ -7486,7 +7486,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ int dependencyIndex = LOAD_ORDER.get(loadBefore);
+ Assert.assertTrue("Plugin (%s) was NOT loaded BEFORE loadbefore dependency. (%s)".formatted(identifier, loadBefore), index < dependencyIndex);
+ Assertions.assertTrue(index < dependencyIndex, "Plugin (%s) was NOT loaded BEFORE loadbefore dependency. (%s)".formatted(identifier, loadBefore));
+ }
+ }
+ }
@@ -7504,8 +7504,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.permissions.Permission;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.support.AbstractTestingBase;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.*;
@@ -7566,7 +7566,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue()));
+ }
+
+ @After
+ @AfterEach
+ public void tearDown() {
+ pm.clearPlugins();
+ assertThat(pm.getPermissions(), is(empty()));
@@ -7581,8 +7581,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package io.papermc.paper.plugin;
+
+import io.papermc.paper.plugin.provider.configuration.PaperPluginMeta;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class PluginNamingTest {
+ private static final String TEST_NAME = "Test_Plugin";
@@ -7598,12 +7598,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Test
+ public void testName() {
+ Assert.assertEquals(TEST_NAME, this.pluginMeta.getName());
+ Assertions.assertEquals(TEST_NAME, this.pluginMeta.getName());
+ }
+
+ @Test
+ public void testDisplayName() {
+ Assert.assertEquals(TEST_NAME + " v" + TEST_VERSION, this.pluginMeta.getDisplayName());
+ Assertions.assertEquals(TEST_NAME + " v" + TEST_VERSION, this.pluginMeta.getDisplayName());
+ }
+}
diff --git a/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java b/src/test/java/io/papermc/paper/plugin/SyntheticEventTest.java
@@ -7619,8 +7619,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.Event;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class SyntheticEventTest {
+
@@ -7635,7 +7635,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ paperPluginManager.registerEvents(impl, paperTestPlugin);
+ paperPluginManager.callEvent(event);
+
+ Assert.assertEquals(1, impl.callCount);
+ Assertions.assertEquals(1, impl.callCount);
+ }
+
+ public abstract static class Base<E extends Event> implements Listener {