diff --git a/event/src/test/java/net/md_5/bungee/event/UnregisteringListenerTest.java b/event/src/test/java/net/md_5/bungee/event/UnregisteringListenerTest.java new file mode 100644 index 00000000..6dcab45d --- /dev/null +++ b/event/src/test/java/net/md_5/bungee/event/UnregisteringListenerTest.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 Dabo Ross + */ +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 + { + } +}