use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.
the class SessionQueriesTest method removeEverythingRemovesWorldNames.
@Test
default void removeEverythingRemovesWorldNames() {
prepareForSessionSave();
db().executeTransaction(new RemoveEverythingTransaction());
assertTrue(db().query(LargeFetchQueries.fetchAllWorldNames()).isEmpty());
}
use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.
the class TPSQueriesTest method removeEverythingRemovesTPS.
@Test
default void removeEverythingRemovesTPS() {
tpsIsStored();
db().executeTransaction(new RemoveEverythingTransaction());
assertTrue(db().query(TPSQueries.fetchTPSDataOfAllServersBut(0, System.currentTimeMillis(), ServerUUID.randomUUID())).isEmpty());
}
use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.
the class UserInfoQueriesTest method removeEverythingRemovesUserInfo.
@Test
default void removeEverythingRemovesUserInfo() {
playerIsRegisteredToBothTables();
db().executeTransaction(new RemoveEverythingTransaction());
assertTrue(db().query(UserInfoQueries.fetchAllUserInformation()).isEmpty());
}
use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.
the class DatabaseCommands method performClear.
private void performClear(CMDSender sender, DBType fromDB) {
try {
Database fromDatabase = dbSystem.getActiveDatabaseByType(fromDB);
fromDatabase.init();
sender.send(locale.getString(CommandLang.DB_REMOVAL, fromDB.getName()));
fromDatabase.executeTransaction(new RemoveEverythingTransaction()).get();
queryService.dataCleared();
sender.send(locale.getString(CommandLang.PROGRESS_SUCCESS));
// Reload plugin to register the server into the database
// Otherwise errors will start.
statusCommands.onReload(sender);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (DBOpException | ExecutionException e) {
sender.send(locale.getString(CommandLang.PROGRESS_FAIL, e.getMessage()));
errorLogger.error(e, ErrorContext.builder().related(sender, fromDB.getName()).build());
}
}
use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.
the class MySQLTest method setUp.
@BeforeEach
void setUp() {
TestErrorLogger.throwErrors(true);
db().executeTransaction(new RemoveEverythingTransaction());
db().executeTransaction(new StoreServerInformationTransaction(new Server(serverUUID(), TestConstants.SERVER_NAME, "", TestConstants.VERSION)));
assertEquals(serverUUID(), ((SQLDB) db()).getServerUUIDSupplier().get());
}
Aggregations