summaryrefslogtreecommitdiff
path: root/same/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'same/src/test/java')
-rw-r--r--same/src/test/java/com/orbekk/same/TestBroadcaster.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/same/src/test/java/com/orbekk/same/TestBroadcaster.java b/same/src/test/java/com/orbekk/same/TestBroadcaster.java
new file mode 100644
index 0000000..b76a44f
--- /dev/null
+++ b/same/src/test/java/com/orbekk/same/TestBroadcaster.java
@@ -0,0 +1,19 @@
+package com.orbekk.same;
+
+import java.util.List;
+
+public class TestBroadcaster implements Broadcaster {
+ private ConnectionManager connections;
+
+ public TestBroadcaster(ConnectionManager connections) {
+ this.connections = connections;
+ }
+
+ public void broadcast(final List<String> targets,
+ final ServiceOperation operation) {
+ for (String t : targets) {
+ ClientService client = connections.getClient(t);
+ operation.run(client);
+ }
+ }
+}