No effective change - add a test for saveAll() with existing batch mode on

Assert that it does not flush the batch.  We want the batch to continue and flush normally.
This commit is contained in:
rob bygrave
2017-09-09 14:14:57 +12:00
parent ef05b81014
commit 84d3578e33
2 changed files with 52 additions and 0 deletions
@@ -52,6 +52,10 @@ public class LoggedSqlCollector {
return basicAppender.collectEnd();
}
public static List<String> current() {
return basicAppender.collectContinue();
}
private static class BasicAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
List<String> messages = new ArrayList<>();
@@ -85,5 +89,14 @@ public class LoggedSqlCollector {
return tempMessages;
}
/**
* Return the collected SQL and continue.
*/
List<String> collectContinue() {
List<String> tempMessages = messages;
messages = new ArrayList<>();
return tempMessages;
}
}
}