[AB-57] [AB-61] reworked commands and services to work with completable futures and moved the database operations to the very last operation so we have transaction safety in more areas

added some cache annotations to the default repository functions
reworked how the undo cations are processed within commands, they are executed in a post command listener when the state is error
added a counter id to generate ids to be unique within servers, changed a few tables to be unique within a server
added future utils class for wrapping a list of futures into one
moved abstracto tables to separate schema in the installer
refactored experience gain to work with more futures and delayed database access
This commit is contained in:
Sheldan
2020-09-20 11:11:20 +02:00
parent 552ecc26b8
commit 76adda90a3
220 changed files with 2691 additions and 1498 deletions

View File

@@ -19,6 +19,7 @@ import org.mockito.Mockito;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class CommandTestUtilities {
@@ -31,7 +32,7 @@ public class CommandTestUtilities {
com.execute(context);
}
public static void executeAsyncNoParametersTest(Command com) {
public static void executeNoParametersTestAsync(Command com) {
CommandContext context = CommandTestUtilities.getNoParameters();
com.executeAsync(context);
}
@@ -45,11 +46,11 @@ public class CommandTestUtilities {
com.execute(context);
}
public static void executeAsyncWrongParametersTest(Command com) {
executeAsyncWrongParametersTest(com, new ArrayList<>());
public static void executeWrongParametersTestAsync(Command com) {
executeWrongParametersTestAsync(com, new ArrayList<>());
}
public static void executeAsyncWrongParametersTest(Command com, Object value) {
public static void executeWrongParametersTestAsync(Command com, Object value) {
CommandContext context = CommandTestUtilities.getWithParameters(Arrays.asList(value));
com.executeAsync(context);
}
@@ -98,5 +99,13 @@ public class CommandTestUtilities {
Assert.assertEquals(ResultState.SUCCESSFUL, result.getResult());
}
public static void checkSuccessfulCompletionAsync(CompletableFuture<CommandResult> result){
Assert.assertEquals(ResultState.SUCCESSFUL, result.join().getResult());
}
public static List<CompletableFuture<Message>> messageFutureList() {
return Arrays.asList(CompletableFuture.completedFuture(null));
}
}