23 package com.realtime.crossfire.jxclient.scripts;
28 import java.util.ArrayList;
29 import java.util.Collection;
30 import org.jetbrains.annotations.NotNull;
31 import org.junit.Assert;
32 import org.junit.Test;
45 final Collection<ReceivedPacketListener> listeners =
new ArrayList<>();
49 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
51 listeners.add(listener);
55 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
57 listeners.remove(listener);
65 listener.process(
"command", () ->
"");
73 listener.process(
"comman", () ->
"");
74 listener.process(
"command", () ->
"");
76 listener.process(
"commandx", () ->
"");
79 Assert.assertEquals(
"writeToScript: watch command\n"+
"writeToScript: watch commandx\n", scriptProcess.
getAndClearEvents());