Added tests for Connection
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@150 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
44ee94041a
commit
53824198db
10 changed files with 93 additions and 6 deletions
|
@ -79,5 +79,30 @@ public class EventTest {
|
|||
testEvent.emit();
|
||||
assertTrue(fired);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void removeListenerByConnection() {
|
||||
fired = false;
|
||||
Event testEvent = new Event();
|
||||
testEvent.add(new IListener() {
|
||||
|
||||
@Override
|
||||
public void handle() {
|
||||
fired = true;
|
||||
|
||||
}
|
||||
});
|
||||
IListener rem = new IListener() {
|
||||
|
||||
@Override
|
||||
public void handle() {
|
||||
fail();
|
||||
}
|
||||
};
|
||||
Connection connection = testEvent.add(rem);
|
||||
connection.remove();
|
||||
testEvent.emit();
|
||||
assertTrue(fired);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue