Search in sources :

Example 16 with RemoveEverythingTransaction

use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.

the class DBPatchSQLiteRegressionTest method sqlitePatchesAreApplied.

@Test
void sqlitePatchesAreApplied() {
    Patch[] patches = underTest.patches();
    for (Patch patch : patches) {
        underTest.executeTransaction(patch);
    }
    assertPatchesHaveBeenApplied(patches);
    // Make sure that a fetch works.
    PlayerContainer player = underTest.query(ContainerFetchQueries.fetchPlayerContainer(TestConstants.PLAYER_ONE_UUID));
    OptionalAssert.equals(1, player.getValue(PlayerKeys.PLAYER_KILL_COUNT));
    // Make sure no foreign key checks fail on removal
    underTest.executeTransaction(new RemoveEverythingTransaction());
}
Also used : PlayerContainer(com.djrapitops.plan.delivery.domain.container.PlayerContainer) RemoveEverythingTransaction(com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction) Patch(com.djrapitops.plan.storage.database.transactions.patches.Patch) Test(org.junit.jupiter.api.Test)

Example 17 with RemoveEverythingTransaction

use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.

the class UserInfoQueriesTest method removeEverythingRemovesBaseUsers.

@Test
default void removeEverythingRemovesBaseUsers() {
    playerIsRegisteredToUsersTable();
    db().executeTransaction(new RemoveEverythingTransaction());
    assertTrue(db().query(BaseUserQueries.fetchAllBaseUsers()).isEmpty());
}
Also used : RemoveEverythingTransaction(com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction) Test(org.junit.jupiter.api.Test)

Example 18 with RemoveEverythingTransaction

use of com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction in project Plan by plan-player-analytics.

the class PingQueriesTest method removeEverythingRemovesPing.

@Test
default void removeEverythingRemovesPing() {
    pingIsStored();
    db().executeTransaction(new RemoveEverythingTransaction());
    assertTrue(db().query(PingQueries.fetchAllPingData()).isEmpty());
}
Also used : RemoveEverythingTransaction(com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction) Test(org.junit.jupiter.api.Test)

Aggregations

RemoveEverythingTransaction (com.djrapitops.plan.storage.database.transactions.commands.RemoveEverythingTransaction)18 Test (org.junit.jupiter.api.Test)13 Server (com.djrapitops.plan.identification.Server)3 StoreServerInformationTransaction (com.djrapitops.plan.storage.database.transactions.StoreServerInformationTransaction)3 Patch (com.djrapitops.plan.storage.database.transactions.patches.Patch)3 PlayerContainer (com.djrapitops.plan.delivery.domain.container.PlayerContainer)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 RepeatedTest (org.junit.jupiter.api.RepeatedTest)2 DBOpException (com.djrapitops.plan.exceptions.database.DBOpException)1 ExtensionPlayerDataQuery (com.djrapitops.plan.extension.implementation.storage.queries.ExtensionPlayerDataQuery)1 ExtensionServerDataQuery (com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerDataQuery)1 ServerUUID (com.djrapitops.plan.identification.ServerUUID)1 Database (com.djrapitops.plan.storage.database.Database)1 PlayerRegisterTransaction (com.djrapitops.plan.storage.database.transactions.events.PlayerRegisterTransaction)1 StoreJoinAddressTransaction (com.djrapitops.plan.storage.database.transactions.events.StoreJoinAddressTransaction)1 WorldNameStoreTransaction (com.djrapitops.plan.storage.database.transactions.events.WorldNameStoreTransaction)1 CreateTablesTransaction (com.djrapitops.plan.storage.database.transactions.init.CreateTablesTransaction)1 KillsOptimizationPatch (com.djrapitops.plan.storage.database.transactions.patches.KillsOptimizationPatch)1 UUID (java.util.UUID)1 ExecutionException (java.util.concurrent.ExecutionException)1