cvs commit: spice/sandbox/metaclass/src/test/org/realityforge/metaclass/model ParameterDescriptorTestCase.java

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

  Added:       sandbox/metaclass/src/test/org/realityforge/metaclass/model
                        ParameterDescriptorTestCase.java
  Log:
  Add in separate test case for parameters
  
  Revision  Changes    Path
  1.1                  spice/sandbox/metaclass/src/test/org/realityforge/metaclass/model/ParameterDescriptorTestCase.java
  
  Index: ParameterDescriptorTestCase.java
  ===================================================================
  /*
   * Copyright (C) The Spice Group. All rights reserved.
   *
   * This software is published under the terms of the Spice
   * Software License version 1.1, a copy of which has been included
   * with this distribution in the LICENSE.txt file.
   */
  package org.realityforge.metaclass.model;
  
  import junit.framework.TestCase;
  
  /**
   *
   * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2003/10/28 11:08:12 $
   */
  public class ParameterDescriptorTestCase
      extends TestCase
  {
      public void testParameterWithNullName()
      {
          try
          {
              new ParameterDescriptor( null, "type" );
          }
          catch( final NullPointerException npe )
          {
              assertEquals( "npe for name", "name", npe.getMessage() );
          }
      }
  
      public void testParameterWithNullType()
      {
          try
          {
              new ParameterDescriptor( "name", null );
          }
          catch( final NullPointerException npe )
          {
              assertEquals( "npe for type", "type", npe.getMessage() );
          }
      }
  
      public void testParameter()
      {
          final ParameterDescriptor param = new ParameterDescriptor( "paramName", "paramType" );
          assertEquals( "param.getName() == paramName",
                        "paramName", param.getName() );
          assertEquals( "param.getType() == paramType",
                        "paramType", param.getType() );
      }
  }
  
  
  


-------------------------------------------------------
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.