use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class VelocitySystemTest method velocityEnables.
@Test
void velocityEnables(@TempDir Path temp) throws Exception {
PlanSystem velocitySystem = new VelocityMockComponent(temp).getPlanSystem();
try {
PlanConfig config = velocitySystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "8.8.8.8");
DBSystem dbSystem = velocitySystem.getDatabaseSystem();
SQLiteDB db = dbSystem.getSqLiteFactory().usingDefaultFile();
db.setTransactionExecutorServiceProvider(MoreExecutors::newDirectExecutorService);
dbSystem.setActiveDatabase(db);
velocitySystem.enable();
assertTrue(velocitySystem.isEnabled());
} finally {
velocitySystem.disable();
}
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class BukkitSystemTest method bukkitSystemHasDefaultConfigValuesAfterEnable.
@Test
void bukkitSystemHasDefaultConfigValuesAfterEnable() throws IllegalAccessException {
try {
system.enable();
PlanConfig config = system.getConfigSystem().getConfig();
TestSettings.assertValidDefaultValuesForAllSettings(config, TestSettings.getServerSettings());
} finally {
system.disable();
}
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class JSErrorRegressionTest method setUpClass.
@BeforeAll
static void setUpClass(@TempDir Path tempDir) throws Exception {
component = new PluginMockComponent(tempDir);
planSystem = component.getPlanSystem();
PlanConfig config = planSystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "localhost:" + TEST_PORT_NUMBER);
config.set(PluginSettings.FRONTEND_BETA, true);
// Avoid accidentally DDoS:ing head image service during tests.
config.set(DisplaySettings.PLAYER_HEAD_IMG_URL, "http://localhost:" + TEST_PORT_NUMBER + "/${playerUUID}/img/Flaticon_circle.png");
planSystem.enable();
serverUUID = planSystem.getServerInfo().getServerUUID();
savePlayerData();
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class JksHttpsServerTest method setUpClass.
@BeforeAll
static void setUpClass(@TempDir Path tempDir) throws Exception {
File file = tempDir.resolve("PlanCert.jks").toFile();
TestResources.copyResourceIntoFile(file, "/PlanCert.jks");
String absolutePath = file.getAbsolutePath();
PluginMockComponent component = new PluginMockComponent(tempDir);
system = component.getPlanSystem();
PlanConfig config = system.getConfigSystem().getConfig();
config.set(WebserverSettings.CERTIFICATE_PATH, absolutePath);
config.set(WebserverSettings.CERTIFICATE_KEYPASS, "MnD3bU5HpmPXag0e");
config.set(WebserverSettings.CERTIFICATE_STOREPASS, "wDwwf663NLTm73gL");
config.set(WebserverSettings.CERTIFICATE_ALIAS, "DefaultPlanCert");
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
system.enable();
User user = new User("test", "console", null, PassEncryptUtil.createHash("testPass"), 0, Collections.emptyList());
system.getDatabaseSystem().getDatabase().executeTransaction(new RegisterWebUserTransaction(user));
}
use of com.djrapitops.plan.settings.config.PlanConfig in project Plan by plan-player-analytics.
the class Pkcs12HttpsServerTest method setUpClass.
@BeforeAll
static void setUpClass(@TempDir Path tempDir) throws Exception {
File file = tempDir.resolve("TestCert.p12").toFile();
File testCert = TestResources.getTestResourceFile("TestCert.p12", ConfigUpdater.class);
Files.copy(testCert.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
String absolutePath = file.getAbsolutePath();
PluginMockComponent component = new PluginMockComponent(tempDir);
system = component.getPlanSystem();
PlanConfig config = system.getConfigSystem().getConfig();
config.set(WebserverSettings.CERTIFICATE_PATH, absolutePath);
config.set(WebserverSettings.CERTIFICATE_KEYPASS, "test");
config.set(WebserverSettings.CERTIFICATE_STOREPASS, "test");
config.set(WebserverSettings.CERTIFICATE_ALIAS, "test");
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
system.enable();
User user = new User("test", "console", null, PassEncryptUtil.createHash("testPass"), 0, Collections.emptyList());
system.getDatabaseSystem().getDatabase().executeTransaction(new RegisterWebUserTransaction(user));
}
Aggregations