use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class ConfigSettingKeyTest method createConfig.
private PlanConfig createConfig(File configFile) throws IOException {
PlanConfig config = new PlanConfig(configFile, null, null, new TestPluginLogger());
config.save();
return config;
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class ConfigUpdaterTest method proxyMoveChangesDoNotLeaveNewEmptyValues.
@Test
void proxyMoveChangesDoNotLeaveNewEmptyValues() throws IOException {
Path configPath = tempDir.resolve("oldconfig.yml");
Files.copy(oldBungeeConfig.toPath(), configPath, StandardCopyOption.REPLACE_EXISTING);
PlanConfig config = new PlanConfig(configPath.toFile(), null, null, new TestPluginLogger());
ConfigChange[] changes = UNDER_TEST.configEnhancementPatch();
assertMoveChangesAreAppliedProperly(config, changes);
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class ConfigUpdaterTest method serverConfigIsPatchedCorrectly.
@Test
void serverConfigIsPatchedCorrectly() throws IOException, IllegalAccessException {
Path configPath = tempDir.resolve("oldconfig.yml");
Files.copy(oldConfig.toPath(), configPath, StandardCopyOption.REPLACE_EXISTING);
PlanConfig config = new PlanConfig(configPath.toFile(), null, null, new TestPluginLogger());
UNDER_TEST.applyConfigUpdate(config);
// Ensure that added settings are present
copyMissingFrom(config, newConfig);
TestSettings.assertValidDefaultValuesForAllSettings(config, TestSettings.getServerSettings());
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BungeeSystemTest method testEnableNoMySQL.
@Test
void testEnableNoMySQL() {
PlanSystem bungeeSystem = component.getPlanSystem();
try {
PlanConfig config = bungeeSystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "8.8.8.8");
assertThrows(EnableException.class, bungeeSystem::enable);
} finally {
bungeeSystem.disable();
}
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BungeeSystemTest method bungeeDoesNotEnableWithDefaultIP.
@Test
void bungeeDoesNotEnableWithDefaultIP() {
PlanSystem bungeeSystem = component.getPlanSystem();
try {
PlanConfig config = bungeeSystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "0.0.0.0");
DBSystem dbSystem = bungeeSystem.getDatabaseSystem();
SQLiteDB db = dbSystem.getSqLiteFactory().usingDefaultFile();
db.setTransactionExecutorServiceProvider(MoreExecutors::newDirectExecutorService);
dbSystem.setActiveDatabase(db);
EnableException thrown = assertThrows(EnableException.class, bungeeSystem::enable);
assertEquals("IP setting still 0.0.0.0 - Configure Alternative_IP/IP that connects to the Proxy server.", thrown.getMessage());
} finally {
bungeeSystem.disable();
}
}
Aggregations