aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorJames W. Carman <jcarman@apache.org>2010-07-22 19:09:18 +0000
committerJames W. Carman <jcarman@apache.org>2010-07-22 19:09:18 +0000
commitc3b4a3d362405f2e9fd3204e90eced2b80fc5776 (patch)
tree68e0a0e372f7cad0df115bb544eac523b74ef803 /src/test/java
parenta43c5746fc7faf57f063d0e025108998557d56b6 (diff)
downloadapache-commons-lang-c3b4a3d362405f2e9fd3204e90eced2b80fc5776.tar.gz
Improving error checking logic and adding test cases to verify.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@966807 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
index b4c11f6f1..85110d9e6 100644
--- a/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
+++ b/src/test/java/org/apache/commons/lang3/event/EventListenerSupportTest.java
@@ -41,6 +41,32 @@ public class EventListenerSupportTest extends TestCase
assertSame(calledListeners.get(1), listener2);
}
+ public void testCreateWithNonInterfaceParameter()
+ {
+ try
+ {
+ EventListenerSupport.create(String.class);
+ fail("Should not be able to create using non-interface class.");
+ }
+ catch(IllegalArgumentException e)
+ {
+
+ }
+ }
+
+ public void testCreateWithNullParameter()
+ {
+ try
+ {
+ EventListenerSupport.create(null);
+ fail("Should not be able to create using null class.");
+ }
+ catch(NullPointerException e)
+ {
+
+ }
+ }
+
public void testRemoveListenerDuringEvent()
{
final EventListenerSupport<ActionListener> listenerSupport = EventListenerSupport.create(ActionListener.class);