aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryConnectionLog.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryConnectionLog.java')
-rw-r--r--container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryConnectionLog.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryConnectionLog.java b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryConnectionLog.java
new file mode 100644
index 00000000000..6d1baf0423f
--- /dev/null
+++ b/container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/InMemoryConnectionLog.java
@@ -0,0 +1,25 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.http.server.jetty;
+
+import com.yahoo.container.logging.ConnectionLog;
+import com.yahoo.container.logging.ConnectionLogEntry;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * A {@link ConnectionLog} that aggregates log entries in memory
+ *
+ * @author bjorncs
+ */
+class InMemoryConnectionLog implements ConnectionLog {
+
+ private final List<ConnectionLogEntry> logEntries = new CopyOnWriteArrayList<>();
+
+ @Override
+ public void log(ConnectionLogEntry entry) {
+ logEntries.add(entry);
+ }
+
+ List<ConnectionLogEntry> logEntries() { return logEntries; }
+}