use of com.djrapitops.plan.settings.locale.Locale in project Plan by plan-player-analytics.
the class ShutdownSaveTest method setupShutdownSaveObject.
@BeforeEach
void setupShutdownSaveObject(@TempDir Path temporaryFolder) throws Exception {
PluginMockComponent pluginMockComponent = new PluginMockComponent(temporaryFolder);
PlanSystem system = pluginMockComponent.getPlanSystem();
database = system.getDatabaseSystem().getSqLiteFactory().usingFileCalled("test");
database.init();
sessionCache = system.getCacheSystem().getSessionCache();
storeNecessaryInformation();
placeSessionToCache();
DBSystem dbSystemMock = mock(DBSystem.class);
when(dbSystemMock.getDatabase()).thenReturn(database);
TestPluginLogger logger = new TestPluginLogger();
underTest = new ServerShutdownSave(new Locale(), dbSystemMock, logger, system.getErrorLogger()) {
@Override
protected boolean checkServerShuttingDownStatus() {
return shutdownStatus;
}
};
shutdownStatus = false;
}
use of com.djrapitops.plan.settings.locale.Locale in project Plan by plan-player-analytics.
the class ActivityIndexTest method localeIsUsedWhenGivenForGetGroups.
@Test
void localeIsUsedWhenGivenForGetGroups() {
Locale locale = createTestLocale();
String[] expected = new String[] { "A", "B", "C", "D", "E" };
String[] result = ActivityIndex.getGroups(locale);
assertArrayEquals(expected, result);
}
use of com.djrapitops.plan.settings.locale.Locale in project Plan by plan-player-analytics.
the class ActivityIndexTest method createTestLocale.
private Locale createTestLocale() {
Locale locale = new Locale();
locale.put(HtmlLang.INDEX_VERY_ACTIVE, new Message("A"));
locale.put(HtmlLang.INDEX_ACTIVE, new Message("B"));
locale.put(HtmlLang.INDEX_REGULAR, new Message("C"));
locale.put(HtmlLang.INDEX_IRREGULAR, new Message("D"));
locale.put(HtmlLang.INDEX_INACTIVE, new Message("E"));
return locale;
}
use of com.djrapitops.plan.settings.locale.Locale in project Plan by plan-player-analytics.
the class DatabaseTest method cleanDoesNotCleanActivePlayers.
@Test
default void cleanDoesNotCleanActivePlayers() {
saveUserOne();
saveTwoWorlds();
long sessionStart = System.currentTimeMillis();
ActiveSession session = new ActiveSession(playerUUID, serverUUID(), sessionStart, worlds[0], "SURVIVAL");
execute(DataStoreQueries.storeSession(session.toFinishedSession(sessionStart + 22345L)));
TestPluginLogger logger = new TestPluginLogger();
new DBCleanTask(config(), new Locale(), dbSystem(), new QuerySvc(config(), dbSystem(), serverInfo(), null), serverInfo(), logger, null).cleanOldPlayers(db());
Collection<BaseUser> found = db().query(BaseUserQueries.fetchServerBaseUsers(serverUUID()));
assertFalse(found.isEmpty(), "All users were deleted!! D:");
}
Aggregations