Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests for EventEmitter to unit tests #626

Merged
merged 2 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@RunWith(Suite.class)
@SuiteClasses({
ConnectionManagerTest.class,
EventEmitterTest.class,
RealtimeHttpHeaderTest.class,
RealtimeAuthTest.class,
RealtimeJWTTest.class,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package io.ably.lib.test.realtime;
package io.ably.lib.util;

import org.junit.Test;

import java.util.HashMap;

import io.ably.lib.util.EventEmitter;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class EventEmitterTest {

private static enum MyEvents {
private enum MyEvents {
event_0,
event_1
}
Expand All @@ -32,7 +30,7 @@ public void onMyThingHappened(MyEventPayload theThing) {
Integer count = counts.get(theThing.event); if(count == null) count = 0;
counts.put(theThing.event, count + 1);
}
HashMap<MyEvents, Integer> counts = new HashMap<MyEvents, Integer>();
HashMap<MyEvents, Integer> counts = new HashMap<>();
}

private static class MyEmitter extends EventEmitter<MyEvents, MyListener> {
Expand Down Expand Up @@ -320,7 +318,6 @@ public void onMyThingHappened(MyEventPayload theThing) {
/**
* "off" event specific listeners inside the listener and ensure they are not called during that event.
*/

@Test
public void off_specific_event_listener_in_listener() {
final MyEmitter emitter = new MyEmitter();
Expand Down