Test against #934 on MySQL

This commit is contained in:
Rsl1122 2019-03-01 11:14:21 +02:00
parent c9c696e71d
commit fd2e45b204
3 changed files with 15 additions and 3 deletions

View File

@ -109,7 +109,7 @@ public class DBPatchH2RegressionTest extends DBPatchRegressionTest {
}
@Test
public void h2PatchTaskWorksWithoutErrors() {
public void h2PatchesAreApplied() {
Patch[] patches = underTest.patches();
for (Patch patch : patches) {
underTest.executeTransaction(patch);

View File

@ -23,6 +23,7 @@ import com.djrapitops.plan.db.access.queries.containers.ContainerFetchQueries;
import com.djrapitops.plan.db.access.transactions.Transaction;
import com.djrapitops.plan.db.access.transactions.commands.RemoveEverythingTransaction;
import com.djrapitops.plan.db.access.transactions.init.CreateTablesTransaction;
import com.djrapitops.plan.db.patches.KillsOptimizationPatch;
import com.djrapitops.plan.db.patches.Patch;
import com.djrapitops.plan.system.PlanSystem;
import com.djrapitops.plan.system.settings.config.PlanConfig;
@ -37,6 +38,7 @@ import utilities.OptionalAssert;
import utilities.RandomData;
import utilities.TestConstants;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
/**
@ -138,7 +140,7 @@ public class DBPatchMySQLRegressionTest extends DBPatchRegressionTest {
}
@Test
public void mysqlPatchTaskWorksWithoutErrors() {
public void mysqlPatchesAreApplied() {
Patch[] patches = underTest.patches();
for (Patch patch : patches) {
underTest.executeTransaction(patch);
@ -153,4 +155,14 @@ public class DBPatchMySQLRegressionTest extends DBPatchRegressionTest {
// Make sure no foreign key checks fail on removal
underTest.executeTransaction(new RemoveEverythingTransaction());
}
@Test
public void mysqlDoesNotApplyKillsOptimizationPatchAgain() {
mysqlPatchesAreApplied();
KillsOptimizationPatch patch = new KillsOptimizationPatch();
underTest.executeTransaction(patch);
assertTrue(patch.hasBeenApplied());
}
}

View File

@ -102,7 +102,7 @@ public class DBPatchSQLiteRegressionTest extends DBPatchRegressionTest {
}
@Test
public void sqlitePatchTaskWorksWithoutErrors() {
public void sqlitePatchesAreApplied() {
Patch[] patches = underTest.patches();
for (Patch patch : patches) {
underTest.executeTransaction(patch);