Add UnregisteringListenerTest
This commit is contained in:
parent
d0e5ee4e09
commit
bb47aba682
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Dabo Ross <www.daboross.net>
|
||||
*/
|
||||
package net.md_5.bungee.event;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author daboross
|
||||
*/
|
||||
public class UnregisteringListenerTest
|
||||
{
|
||||
|
||||
private final EventBus bus = new EventBus();
|
||||
|
||||
@Test
|
||||
public void testPriority()
|
||||
{
|
||||
bus.register( this );
|
||||
bus.unregister( this );
|
||||
bus.post( new TestEvent() );
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEvent(TestEvent evt)
|
||||
{
|
||||
Assert.fail( "Event listener wasn't unregistered" );
|
||||
}
|
||||
|
||||
public static class TestEvent
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user