summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/bukkit
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-02-16 22:31:40 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-02-16 22:32:17 +0000
commit236cfed61631352e9394632d80409cac62f31cc3 (patch)
tree6660acf4f2f9af685e2922b180a98268553c9f1c /src/test/java/org/bukkit
parent64264f61b886f50d6b32c2d1df389c09f6253029 (diff)
downloadcraftbukkit-236cfed61631352e9394632d80409cac62f31cc3.tar
craftbukkit-236cfed61631352e9394632d80409cac62f31cc3.tar.gz
craftbukkit-236cfed61631352e9394632d80409cac62f31cc3.tar.lz
craftbukkit-236cfed61631352e9394632d80409cac62f31cc3.tar.xz
craftbukkit-236cfed61631352e9394632d80409cac62f31cc3.zip
Added a built-in update checker. See http://wiki.bukkit.org/Bukkit.yml#auto-updater for new bukkit.yml options.
Diffstat (limited to 'src/test/java/org/bukkit')
-rw-r--r--src/test/java/org/bukkit/craftbukkit/updater/BukkitDLUpdaterServiceTest.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/craftbukkit/updater/BukkitDLUpdaterServiceTest.java b/src/test/java/org/bukkit/craftbukkit/updater/BukkitDLUpdaterServiceTest.java
new file mode 100644
index 00000000..701de3a3
--- /dev/null
+++ b/src/test/java/org/bukkit/craftbukkit/updater/BukkitDLUpdaterServiceTest.java
@@ -0,0 +1,30 @@
+package org.bukkit.craftbukkit.updater;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+
+public class BukkitDLUpdaterServiceTest {
+ @Test(expected=IOException.class)
+ public void testHostNotFound() throws UnsupportedEncodingException, IOException {
+ BukkitDLUpdaterService service = new BukkitDLUpdaterService("404.example.org");
+
+ service.fetchArtifact("rb");
+ }
+
+ @Test(expected=FileNotFoundException.class)
+ public void testArtifactNotFound() throws UnsupportedEncodingException, IOException {
+ BukkitDLUpdaterService service = new BukkitDLUpdaterService("dl.bukkit.org");
+
+ service.fetchArtifact("meep");
+ }
+
+ @Test
+ public void testArtifactExists() throws UnsupportedEncodingException, IOException {
+ BukkitDLUpdaterService service = new BukkitDLUpdaterService("dl.bukkit.org");
+
+ assertNotNull(service.fetchArtifact("latest-dev"));
+ }
+}