Search in sources :

Example 1 with JavaPluginLoader

use of org.bukkit.plugin.java.JavaPluginLoader in project AuthMeReloaded by AuthMe.

the class AuthMeInitializationTest method initAuthMe.

@Before
public void initAuthMe() throws IOException {
    dataFolder = temporaryFolder.newFolder();
    File settingsFile = new File(dataFolder, "config.yml");
    JavaPluginLoader pluginLoader = new JavaPluginLoader(server);
    Files.copy(TestHelper.getJarFile(TestHelper.PROJECT_ROOT + "config.test.yml"), settingsFile);
    // Mock / wire various Bukkit components
    given(server.getLogger()).willReturn(mock(Logger.class));
    ReflectionTestUtils.setField(Bukkit.class, null, "server", server);
    given(server.getPluginManager()).willReturn(pluginManager);
    // PluginDescriptionFile is final: need to create a sample one
    PluginDescriptionFile descriptionFile = new PluginDescriptionFile("AuthMe", "N/A", AuthMe.class.getCanonicalName());
    // Initialize AuthMe
    authMe = new AuthMe(pluginLoader, descriptionFile, dataFolder, null);
}
Also used : JavaPluginLoader(org.bukkit.plugin.java.JavaPluginLoader) PluginDescriptionFile(org.bukkit.plugin.PluginDescriptionFile) Logger(java.util.logging.Logger) File(java.io.File) PluginDescriptionFile(org.bukkit.plugin.PluginDescriptionFile) Before(org.junit.Before)

Aggregations

File (java.io.File)1 Logger (java.util.logging.Logger)1 PluginDescriptionFile (org.bukkit.plugin.PluginDescriptionFile)1 JavaPluginLoader (org.bukkit.plugin.java.JavaPluginLoader)1 Before (org.junit.Before)1