Added a built-in update checker. See http://wiki.bukkit.org/Bukkit.yml#auto-updater for new bukkit.yml options.
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
fa9de7d0b7
commit
6ea3041bf5
7 changed files with 316 additions and 0 deletions
|
@ -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"));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue