Search in sources :

Example 6 with ScriptEventListener

use of com.enonic.xp.script.event.ScriptEventListener in project xp by enonic.

the class ScriptEventManagerImplTest method testIterable.

@Test
public void testIterable() {
    final ScriptEventListener listener = newListener("foo.bar");
    this.manager.add(listener);
    assertEquals(1, StreamSupport.stream(manager.spliterator(), false).count());
    assertSame(listener, this.manager.iterator().next());
}
Also used : ScriptEventListener(com.enonic.xp.script.event.ScriptEventListener) Test(org.junit.jupiter.api.Test)

Aggregations

ScriptEventListener (com.enonic.xp.script.event.ScriptEventListener)6 Test (org.junit.jupiter.api.Test)5 Event (com.enonic.xp.event.Event)3 Application (com.enonic.xp.app.Application)1 ScriptAsyncService (com.enonic.xp.script.impl.async.ScriptAsyncService)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1