123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*
- * ServerManagerTest.java
- * JUnit 4.x based test
- *
- */
-
- package com.dmdirc.parser;
-
- import com.dmdirc.parser.callbacks.CallbackNotFound;
- import com.dmdirc.parser.callbacks.interfaces.IAwayState;
- import junit.framework.TestCase;
- import org.junit.Test;
- import static org.junit.Assert.*;
-
- /**
- *
- * @author Chris
- */
- public class IRCParserTest extends TestCase {
-
- public IRCParserTest() {
- }
-
- @Test
- public void testIssue042() {
- boolean res = false;
-
- try {
- final IRCParser myParser = new IRCParser();
- myParser.getCallbackManager().addCallback("non-existant",new IAwayState() {
- public void onAwayState(IRCParser tParser, boolean currentState, String reason) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- });
- } catch (CallbackNotFound ex) {
- res = true;
- }
-
- assertTrue("addCallback() should throw exception for non-existant callbacks", res);
- }
-
- }
|