harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r548938 - /harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java
Date Wed, 20 Jun 2007 05:10:24 GMT
Author: leoli
Date: Tue Jun 19 22:10:24 2007
New Revision: 548938

URL: http://svn.apache.org/viewvc?view=rev&rev=548938
Log:
Add a testcase for java.beans.beancontext.BeanContextServiceRevokedEvent to assure that invoking
BeanContextServiceRevokedEvent.isServiceClass(Class cls), which the cls is not appropriate,
will lead to a NullPointerException.

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java?view=diff&rev=548938&r1=548937&r2=548938
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServiceRevokedEventTest.java
Tue Jun 19 22:10:24 2007
@@ -86,6 +86,17 @@
         } catch (NullPointerException e) {
             // expected
         }
+        
+        try {
+            event.isServiceClass(null);
+            fail("NPE expected");
+        } catch (NullPointerException e) {
+            // expected
+        }
+        
+        event = new MockBeanContextServiceRevokedEvent(services, services
+                .getClass(), true);
+        assertFalse(event.isServiceClass(null));
     }
 
     public void testBeanContextServiceRevokedEvent() {



Mime
View raw message