commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang ObjectsTest.java
Date Sun, 30 Jun 2002 23:09:43 GMT
scolebourne    2002/06/30 16:09:43

  Modified:    lang/src/test/org/apache/commons/lang ObjectsTest.java
  Log:
  Rename isNull method
  Tidy test structre
  
  Revision  Changes    Path
  1.4       +28 -10    jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/ObjectsTest.java
  
  Index: ObjectsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/ObjectsTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ObjectsTest.java	23 Jun 2002 23:04:16 -0000	1.3
  +++ ObjectsTest.java	30 Jun 2002 23:09:43 -0000	1.4
  @@ -54,37 +54,55 @@
    * <http://www.apache.org/>.
    */
   
  -import java.util.HashMap;
  -
  -import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -
  +import junit.textui.TestRunner;
   /**
    * Unit tests {@link org.apache.commons.lang.Objects}.
    *
    * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
  + * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
    */
   public class ObjectsTest extends TestCase
   {
       private static final String FOO = "foo";
       private static final String BAR = "bar";
  -    private static final String MAP_ERROR =
  -        "Map did not serialize and deserialize to equivalent map";
   
       public ObjectsTest(String name)
       {
           super(name);
       }
       
  +    public static void main(String[] args) 
  +    {
  +        TestRunner.run(suite());
  +    }
  +
  +    public static TestSuite suite() 
  +    {
  +        return new TestSuite(ObjectsTest.class);
  +    }
  +
  +    protected void setUp() throws Exception 
  +    {
  +        super.setUp();
  +    }
  +
  +    protected void tearDown() throws Exception
  +    {
  +        super.tearDown();
  +    }
  +
  +    //-----------------------------------------------------------------------
  +    
       public void testIsNull()
       {
           Object o = FOO;
           Object dflt = BAR;
  -        assertEquals("dflt was not returned when o was null", dflt,
  -                     Objects.isNull(null, dflt));
  -        assertEquals("dflt was returned when o was not null", o,
  -                     Objects.isNull(o, dflt));
  +        assertSame("dflt was not returned when o was null", dflt,
  +                     Objects.defaultIfNull(null, dflt));
  +        assertSame("dflt was returned when o was not null", o,
  +                     Objects.defaultIfNull(o, dflt));
       }
           
       public void testEquals()
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message