Handle package seal
Dieser Commit ist enthalten in:
Ursprung
20247747b5
Commit
270cdfca2f
@ -2,8 +2,7 @@ package com.comphenix.protocol.wrappers;
|
|||||||
|
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -20,7 +19,8 @@ public class WrappedServerPingTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() throws IOException {
|
public void test() {
|
||||||
|
try {
|
||||||
CompressedImage tux = CompressedImage.fromPng(Resources.getResource("tux.png").openStream());
|
CompressedImage tux = CompressedImage.fromPng(Resources.getResource("tux.png").openStream());
|
||||||
byte[] original = tux.getDataCopy();
|
byte[] original = tux.getDataCopy();
|
||||||
|
|
||||||
@ -41,6 +41,14 @@ public class WrappedServerPingTest {
|
|||||||
|
|
||||||
CompressedImage copy = CompressedImage.fromBase64Png(Base64Coder.encodeLines(tux.getData()));
|
CompressedImage copy = CompressedImage.fromBase64Png(Base64Coder.encodeLines(tux.getData()));
|
||||||
assertArrayEquals(copy.getData(), serverPing.getFavicon().getData());
|
assertArrayEquals(copy.getData(), serverPing.getFavicon().getData());
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
if (ex.getCause() instanceof SecurityException) {
|
||||||
|
// There was a global package seal for a while, but not anymore
|
||||||
|
System.err.println("Encountered a SecurityException, update your Spigot jar!");
|
||||||
|
} else {
|
||||||
|
ex.printStackTrace();
|
||||||
|
fail("Encountered an exception testing ServerPing");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren