cvs commit: spice/sandbox/metaclass/src/test/org/realityforge/metaclass/introspector CachingMetaClassAccessorTestCase.java

Peter Donald <[email protected]>
Newsgroups gmane.comp.java.spice.cvs
Message-ID <[email protected]>
donaldp     03/10/28 00:19:32

  Modified:    sandbox/metaclass/src/test/org/realityforge/metaclass/introspector
                        CachingMetaClassAccessorTestCase.java
  Log:
  Add more unit tests
  
  Revision  Changes    Path
  1.4       +33 -1     spice/sandbox/metaclass/src/test/org/realityforge/metaclass/introspector/CachingMetaClassAccessorTestCase.java
  
  Index: CachingMetaClassAccessorTestCase.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/metaclass/src/test/org/realityforge/metaclass/introspector/CachingMetaClassAccessorTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CachingMetaClassAccessorTestCase.java	28 Oct 2003 08:15:03 -0000	1.3
  +++ CachingMetaClassAccessorTestCase.java	28 Oct 2003 08:19:32 -0000	1.4
  @@ -16,11 +16,43 @@
   /**
    *
    * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2003/10/28 08:15:03 $
  + * @version $Revision: 1.4 $ $Date: 2003/10/28 08:19:32 $
    */
   public class CachingMetaClassAccessorTestCase
       extends TestCase
   {
  +    public void testNullClassnamePassedToGetClassDescriptor()
  +        throws Exception
  +    {
  +        final CachingMetaClassAccessor accessor = new CachingMetaClassAccessor();
  +        try
  +        {
  +            accessor.getClassDescriptor( null, getClass().getClassLoader(), accessor );
  +        }
  +        catch( final NullPointerException npe )
  +        {
  +            assertEquals( "npe.getMessage()", "classname", npe.getMessage() );
  +            return;
  +        }
  +        fail( "Expected to fail due to null Classname passed into GetClassDescriptor" );
  +    }
  +
  +    public void testNullClassLoaderPassedToGetClassDescriptor()
  +        throws Exception
  +    {
  +        final CachingMetaClassAccessor accessor = new CachingMetaClassAccessor();
  +        try
  +        {
  +            accessor.getClassDescriptor( "X", null, accessor );
  +        }
  +        catch( final NullPointerException npe )
  +        {
  +            assertEquals( "npe.getMessage()", "classLoader", npe.getMessage() );
  +            return;
  +        }
  +        fail( "Expected to fail due to null ClassLoader passed into GetClassDescriptor" );
  +    }
  +
       public void testGetNonExistent()
           throws Exception
       {
  
  
  


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
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.