Skip to content

Commit 6f6323b

Browse files
Merge pull request ably#626 from ably/move-event-emitter-tests-to-unit-tests
Move tests for EventEmitter to unit tests
2 parents 6d0af67 + a0803b3 commit 6f6323b

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

lib/src/test/java/io/ably/lib/test/realtime/RealtimeSuite.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
@RunWith(Suite.class)
1515
@SuiteClasses({
1616
ConnectionManagerTest.class,
17-
EventEmitterTest.class,
1817
RealtimeHttpHeaderTest.class,
1918
RealtimeAuthTest.class,
2019
RealtimeJWTTest.class,

lib/src/test/java/io/ably/lib/test/realtime/EventEmitterTest.java renamed to lib/src/test/java/io/ably/lib/util/EventEmitterTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
package io.ably.lib.test.realtime;
1+
package io.ably.lib.util;
22

33
import org.junit.Test;
44

55
import java.util.HashMap;
66

7-
import io.ably.lib.util.EventEmitter;
8-
97
import static org.junit.Assert.assertEquals;
108
import static org.junit.Assert.assertNull;
119
import static org.junit.Assert.assertTrue;
1210

1311
public class EventEmitterTest {
1412

15-
private static enum MyEvents {
13+
private enum MyEvents {
1614
event_0,
1715
event_1
1816
}
@@ -32,7 +30,7 @@ public void onMyThingHappened(MyEventPayload theThing) {
3230
Integer count = counts.get(theThing.event); if(count == null) count = 0;
3331
counts.put(theThing.event, count + 1);
3432
}
35-
HashMap<MyEvents, Integer> counts = new HashMap<MyEvents, Integer>();
33+
HashMap<MyEvents, Integer> counts = new HashMap<>();
3634
}
3735

3836
private static class MyEmitter extends EventEmitter<MyEvents, MyListener> {
@@ -320,7 +318,6 @@ public void onMyThingHappened(MyEventPayload theThing) {
320318
/**
321319
* "off" event specific listeners inside the listener and ensure they are not called during that event.
322320
*/
323-
324321
@Test
325322
public void off_specific_event_listener_in_listener() {
326323
final MyEmitter emitter = new MyEmitter();

0 commit comments

Comments
 (0)