jicarilla-sandbox/platform/container/impl/src/test/org/jicarilla/container/test/adapters AbstractComponentAdapterTestCase.java,1.5,1.6

[email protected]
Newsgroups gmane.comp.java.jicarilla.cvs
Message-ID <[email protected]>
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/container/impl/src/test/org/jicarilla/container/test/adapters
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23127/platform/container/impl/src/test/org/jicarilla/container/test/adapters

Modified Files:
	AbstractComponentAdapterTestCase.java 
Log Message:
test coverage madness

Index: AbstractComponentAdapterTestCase.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/container/impl/src/test/org/jicarilla/container/test/adapters/AbstractComponentAdapterTestCase.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- AbstractComponentAdapterTestCase.java	10 Jan 2004 12:12:26 -0000	1.5
+++ AbstractComponentAdapterTestCase.java	14 Mar 2004 21:32:26 -0000	1.6
@@ -27,6 +27,8 @@
 
 import junit.framework.TestCase;
 import org.jicarilla.container.Factory;
+import org.jicarilla.container.JicarillaException;
+import org.jicarilla.container.JicarillaInstantiationException;
 import org.jicarilla.container.adapters.AbstractAdapter;
 
 /**
@@ -94,4 +96,42 @@
         assertNotNull( t );
 
     }
+
+    public void testHandleUnExpectedException()
+    {
+        JicarillaException ex = new JicarillaException();
+        try
+        {
+            AbstractAdapter.handleUnexpectedException( ex );
+            fail( "Expected an exception!" );
+        }
+        catch( Throwable th )
+        {
+            assertEquals( ex, th );
+        }
+
+        Error e = new Error();
+        try
+        {
+            AbstractAdapter.handleUnexpectedException( e );
+            fail( "Expected an exception!" );
+        }
+        catch( Throwable th )
+        {
+            assertEquals( e, th );
+        }
+
+        Exception exc = new Exception();
+        try
+        {
+            AbstractAdapter.handleUnexpectedException( exc );
+            fail( "Expected an exception!" );
+        }
+        catch( Throwable th )
+        {
+            assertTrue( th instanceof JicarillaInstantiationException );
+            assertEquals( exc, th.getCause() );
+        }
+
+    }
 }



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.