Disabled systems after all database tests

This commit is contained in:
Rsl1122 2019-08-18 10:04:35 +03:00
parent ae5a1df7cd
commit cd33f6bc32
3 changed files with 21 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package com.djrapitops.plan.db; package com.djrapitops.plan.db;
import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.PlanSystem;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.api.io.TempDir;
@ -52,6 +53,12 @@ public class H2Test implements DatabaseTest {
.orElseThrow(IllegalStateException::new); .orElseThrow(IllegalStateException::new);
} }
@AfterAll
static void disableSystem() {
if (database != null) database.close();
system.disable();
}
@Override @Override
public Database db() { public Database db() {
return database; return database;

View File

@ -20,6 +20,7 @@ import com.djrapitops.plan.data.container.GeoInfo;
import com.djrapitops.plan.db.access.queries.ServerAggregateQueries; import com.djrapitops.plan.db.access.queries.ServerAggregateQueries;
import com.djrapitops.plan.db.access.transactions.events.PlayerRegisterTransaction; import com.djrapitops.plan.db.access.transactions.events.PlayerRegisterTransaction;
import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.PlanSystem;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -65,6 +66,12 @@ class MySQLTest implements DatabaseTest {
database = mysql.get(); database = mysql.get();
} }
@AfterAll
static void disableSystem() {
if (database != null) database.close();
system.disable();
}
@Override @Override
public Database db() { public Database db() {
return database; return database;

View File

@ -23,6 +23,7 @@ import com.djrapitops.plan.db.access.transactions.StoreServerInformationTransact
import com.djrapitops.plan.db.access.transactions.events.PlayerRegisterTransaction; import com.djrapitops.plan.db.access.transactions.events.PlayerRegisterTransaction;
import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.PlanSystem;
import com.djrapitops.plan.system.info.server.Server; import com.djrapitops.plan.system.info.server.Server;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
@ -62,6 +63,12 @@ public class SQLiteTest implements DatabaseTest {
.orElseThrow(IllegalStateException::new); .orElseThrow(IllegalStateException::new);
} }
@AfterAll
static void disableSystem() {
if (database != null) database.close();
system.disable();
}
@Override @Override
public Database db() { public Database db() {
return database; return database;