mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-05 01:59:46 +01:00
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