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)) { if (devBuild && parsedRemote.equals(parsedCurrent)) {
// They're using a dev build and this version has been released // 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 // The remote version has to be greater

Datei anzeigen

@ -29,7 +29,9 @@ public class UpdaterTest {
when(server.getUpdateFolder()).thenReturn(null); when(server.getUpdateFolder()).thenReturn(null);
plugin = mock(Plugin.class); 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.getLogger()).thenReturn(Logger.getLogger("ProtocolLib"));
when(plugin.getDataFolder()).thenReturn(null); when(plugin.getDataFolder()).thenReturn(null);
when(plugin.getServer()).thenReturn(server); when(plugin.getServer()).thenReturn(server);
@ -49,8 +51,7 @@ public class UpdaterTest {
} }
System.out.println("Determined remote Spigot version: " + remote); System.out.println("Determined remote Spigot version: " + remote);
System.out.println("Update available: " + updater.versionCheck(remote));
updater.versionCheck(remote);
} }
//@Test //@Test
@ -62,7 +63,6 @@ public class UpdaterTest {
String remote = updater.getLatestName(); String remote = updater.getLatestName();
System.out.println("Determined remote Bukkit Dev version: " + remote); System.out.println("Determined remote Bukkit Dev version: " + remote);
System.out.println("Update available: " + updater.versionCheck(remote));
updater.versionCheck(remote);
} }
} }