Archiviert
13
0

Fix false update notifications with beta releases

Fixes #173
Dieser Commit ist enthalten in:
Dan Mulloy 2016-03-12 15:51:12 -05:00
Ursprung 513a83c4b0
Commit 286a642739
2 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -93,7 +93,7 @@ public abstract class Updater {
if (devBuild && parsedRemote.equals(parsedCurrent)) {
// They're using a dev build and this version has been released
return true;
return !remoteVersion.contains("-BETA") && !remoteVersion.contains("-SNAPSHOT");
}
// The remote version has to be greater

Datei anzeigen

@ -29,7 +29,9 @@ public class UpdaterTest {
when(server.getUpdateFolder()).thenReturn(null);
plugin = mock(Plugin.class);
when(plugin.getDescription()).thenReturn(new PluginDescriptionFile("ProtocolLib", System.getProperty("projectVersion"), null));
String version = System.getProperty("projectVersion");
if (version == null) version = "3.7.0-BETA";
when(plugin.getDescription()).thenReturn(new PluginDescriptionFile("ProtocolLib", version, null));
when(plugin.getLogger()).thenReturn(Logger.getLogger("ProtocolLib"));
when(plugin.getDataFolder()).thenReturn(null);
when(plugin.getServer()).thenReturn(server);
@ -49,8 +51,7 @@ public class UpdaterTest {
}
System.out.println("Determined remote Spigot version: " + remote);
updater.versionCheck(remote);
System.out.println("Update available: " + updater.versionCheck(remote));
}
//@Test
@ -62,7 +63,6 @@ public class UpdaterTest {
String remote = updater.getLatestName();
System.out.println("Determined remote Bukkit Dev version: " + remote);
updater.versionCheck(remote);
System.out.println("Update available: " + updater.versionCheck(remote));
}
}