use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.
the class SessionQueriesTest method removeEverythingRemovesSessions.
@Test
default void removeEverythingRemovesSessions() {
sessionsAreStoredWithAllData();
db().executeTransaction(new RemoveEverythingTransaction());
assertTrue(db().query(SessionQueries.fetchAllSessions()).isEmpty());
assertEquals(0L, db().query(WorldTimesQueries.fetchServerTotalWorldTimes(serverUUID())).getTotal());
assertEquals(0, db().query(KillQueries.playerKillCount(0, System.currentTimeMillis(), serverUUID())));
}
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 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 ShutdownSaveTest method storeNecessaryInformation.
private void storeNecessaryInformation() throws Exception {
database.executeTransaction(new RemoveEverythingTransaction());
ServerUUID serverUUID = TestConstants.SERVER_UUID;
UUID playerUUID = TestConstants.PLAYER_ONE_UUID;
String worldName = TestConstants.WORLD_ONE_NAME;
database.executeTransaction(new StoreServerInformationTransaction(new Server(serverUUID, "-", "")));
database.executeTransaction(new PlayerRegisterTransaction(playerUUID, () -> 0L, TestConstants.PLAYER_ONE_NAME));
database.executeTransaction(new WorldNameStoreTransaction(serverUUID, worldName)).get();
}
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 Patch() {
@Override
public boolean hasBeenApplied() {
return false;
}
@Override
public void applyPatch() {
dropTable("plan_world_times");
dropTable("plan_kills");
dropTable("plan_sessions");
dropTable("plan_worlds");
dropTable("plan_users");
}
});
db().executeTransaction(new CreateTablesTransaction());
db().executeTransaction(new RemoveEverythingTransaction());
db().executeTransaction(new StoreServerInformationTransaction(new Server(serverUUID(), TestConstants.SERVER_NAME, "")));
assertEquals(serverUUID(), ((SQLDB) db()).getServerUUIDSupplier().get());
}
Aggregations