Remove legacy jar hint

This commit is contained in:
Gabriele C 2017-06-22 23:57:04 +02:00
parent e8b3bb5d9d
commit e6e023a032
3 changed files with 0 additions and 35 deletions

View File

@ -205,7 +205,6 @@ public class AuthMe extends JavaPlugin {
if(!SystemUtils.isJavaVersionAtLeast(1.8f)) { if(!SystemUtils.isJavaVersionAtLeast(1.8f)) {
throw new IllegalStateException("You need Java 1.8 or above to run this plugin!"); throw new IllegalStateException("You need Java 1.8 or above to run this plugin!");
} }
OnStartupTasks.verifyIfLegacyJarIsNeeded();
// Create plugin folder // Create plugin folder
getDataFolder().mkdir(); getDataFolder().mkdir();

View File

@ -116,24 +116,6 @@ public class OnStartupTasks {
}, 1, TICKS_PER_MINUTE * settings.getProperty(EmailSettings.DELAY_RECALL)); }, 1, TICKS_PER_MINUTE * settings.getProperty(EmailSettings.DELAY_RECALL));
} }
/**
* Displays a hint to use the legacy AuthMe JAR if AuthMe could not be started
* because Gson or newer Guava classes were not found.
*/
public static void verifyIfLegacyJarIsNeeded() {
try {
Class<?>[] classes = {
com.google.common.base.MoreObjects.class, // < 1.12 Minecraft
com.google.gson.Gson.class // < 1.7 Minecraft
};
} catch (NoClassDefFoundError e) {
ConsoleLogger.warning("YOU MUST DOWNLOAD THE LEGACY JAR TO USE AUTHME ON YOUR SERVER");
ConsoleLogger.warning("Get authme-legacy.jar from http://ci.xephi.fr/job/AuthMeReloaded/");
ConsoleLogger.warning("Reason: could not load class '" + e.getMessage() + "'");
throw e;
}
}
/** /**
* Returns whether the hash algorithm is deprecated and won't be able * Returns whether the hash algorithm is deprecated and won't be able
* to be actively used anymore in 5.4. * to be actively used anymore in 5.4.

View File

@ -1,32 +1,16 @@
package fr.xephi.authme.initialization; package fr.xephi.authme.initialization;
import fr.xephi.authme.TestHelper;
import fr.xephi.authme.security.HashAlgorithm; import fr.xephi.authme.security.HashAlgorithm;
import org.junit.Test; import org.junit.Test;
import java.util.logging.Logger;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.verifyZeroInteractions;
/** /**
* Test for {@link OnStartupTasks}. * Test for {@link OnStartupTasks}.
*/ */
public class OnStartupTasksTest { public class OnStartupTasksTest {
@Test
public void shouldNotDisplayLegacyHintForWrongCause() {
// given
Logger logger = TestHelper.setupLogger();
// when
OnStartupTasks.verifyIfLegacyJarIsNeeded();
// then
verifyZeroInteractions(logger);
}
@Test @Test
public void shouldCheckIfHashIsDeprecatedIn54() { public void shouldCheckIfHashIsDeprecatedIn54() {
// given / when / then // given / when / then