You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by st...@apache.org on 2002/08/25 15:21:24 UTC

cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/exception NestableRuntimeExceptionTestCase.java NestableExceptionTestCase.java

stevencaswell    2002/08/25 06:21:24

  Modified:    lang/src/test/org/apache/commons/lang/exception
                        NestableRuntimeExceptionTestCase.java
                        NestableExceptionTestCase.java
  Log:
  removed testing of deprecated methods getLength() and indexOfThrowable(int, Class)
  
  Revision  Changes    Path
  1.3       +1 -54     jakarta-commons/lang/src/test/org/apache/commons/lang/exception/NestableRuntimeExceptionTestCase.java
  
  Index: NestableRuntimeExceptionTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/exception/NestableRuntimeExceptionTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NestableRuntimeExceptionTestCase.java	26 Jul 2002 20:30:58 -0000	1.2
  +++ NestableRuntimeExceptionTestCase.java	25 Aug 2002 13:21:24 -0000	1.3
  @@ -152,34 +152,6 @@
           assertEquals("ne 8 throwable count", 5, ne8.getThrowableCount());
       }
       
  -    public void testGetLength()
  -    {
  -        // test the deprecated method
  -        NestableRuntimeException ne1 = new NestableRuntimeException();
  -        assertEquals("ne1 length", 1, ne1.getLength());
  -
  -        NestableRuntimeException ne2 = new NestableRuntimeException("ne2");
  -        assertEquals("ne2 length", 1, ne2.getLength());
  -        
  -        NestableRuntimeException ne3 = new NestableRuntimeException(new Exception("ne3 exception"));
  -        assertEquals("ne3 length", 2, ne3.getLength());
  -        
  -        NestableRuntimeException ne4 = new NestableRuntimeException("ne4", new Exception("ne4 exception"));
  -        assertEquals("ne4 length", 2, ne4.getLength());
  -        
  -        NestableRuntimeException ne5 = new NestableRuntimeException("ne5", null);
  -        assertEquals("ne 5 length", 1, ne5.getLength());
  -        
  -        NestableRuntimeException ne6 = new NestableRuntimeException(null, new Exception("ne6 exception"));
  -        assertEquals("ne 6 length", 2, ne6.getLength());
  -        
  -        NestableRuntimeException ne7 = new NestableRuntimeException("ne7o", new NestableRuntimeException("ne7i", new Exception("ne7 exception")));
  -        assertEquals("ne 7 length", 3, ne7.getLength());
  -
  -        NestableRuntimeException ne8 = new NestableRuntimeException("level 1", new NestableRuntimeException("level 2", new NestableRuntimeException(new NestableRuntimeException("level 4", new Exception("level 5")))));
  -        assertEquals("ne 8 length", 5, ne8.getLength());
  -    }
  -
       public void testGetMessage()
       {
           NestableRuntimeException ne1 = new NestableRuntimeException();
  @@ -485,11 +457,6 @@
           {
           }
           
  -        // test the deprecated method
  -        int index = n.indexOfThrowable(-1, NestableRuntimeExceptionTester1.class);
  -        assertEquals("deprecated method index", 0, index);
  -        index = n.indexOfThrowable(999, Exception.class);
  -        assertEquals("deprecated method index", 4, index);
       }
   
       private void doNestableRuntimeExceptionIndexOfThrowableI(Nestable n, Class type, int fromIndex, int expectedIndex, String expectedMsg)
  @@ -516,26 +483,6 @@
               }
           }
           
  -        // test the deprecated method
  -        int index1 = n.indexOfThrowable(fromIndex, type);
  -        assertEquals("index of throwable " + type.getName(), expectedIndex, index);
  -        if(expectedIndex > -1)
  -        {
  -            t = n.getThrowable(index);
  -            if(expectedMsg != null)
  -            {
  -                String msg = null;
  -                if(Nestable.class.isInstance(t))
  -                {
  -                    msg = ((Nestable) t).getMessage(0);
  -                }
  -                else
  -                {
  -                    msg = t.getMessage();
  -                }
  -                assertEquals("message of indexed throwable", expectedMsg, msg);
  -            }
  -        }
       }
       
       public void testPrintStackTrace()
  
  
  
  1.3       +1 -54     jakarta-commons/lang/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java
  
  Index: NestableExceptionTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NestableExceptionTestCase.java	26 Jul 2002 20:30:58 -0000	1.2
  +++ NestableExceptionTestCase.java	25 Aug 2002 13:21:24 -0000	1.3
  @@ -126,34 +126,6 @@
               ne6.getCause()); 
       }
   
  -    public void testGetLength()
  -    {
  -        // test the deprecated method
  -        NestableException ne1 = new NestableException();
  -        assertEquals("ne1 length", 1, ne1.getLength());
  -
  -        NestableException ne2 = new NestableException("ne2");
  -        assertEquals("ne2 length", 1, ne2.getLength());
  -        
  -        NestableException ne3 = new NestableException(new Exception("ne3 exception"));
  -        assertEquals("ne3 length", 2, ne3.getLength());
  -        
  -        NestableException ne4 = new NestableException("ne4", new Exception("ne4 exception"));
  -        assertEquals("ne4 length", 2, ne4.getLength());
  -        
  -        NestableException ne5 = new NestableException("ne5", null);
  -        assertEquals("ne 5 length", 1, ne5.getLength());
  -        
  -        NestableException ne6 = new NestableException(null, new Exception("ne6 exception"));
  -        assertEquals("ne 6 length", 2, ne6.getLength());
  -        
  -        NestableException ne7 = new NestableException("ne7o", new NestableException("ne7i", new Exception("ne7 exception")));
  -        assertEquals("ne 7 length", 3, ne7.getLength());
  -
  -        NestableException ne8 = new NestableException("level 1", new NestableException("level 2", new NestableException(new NestableException("level 4", new Exception("level 5")))));
  -        assertEquals("ne 8 length", 5, ne8.getLength());
  -    }
  -    
       public void testGetThrowableCount()
       {
           NestableException ne1 = new NestableException();
  @@ -493,11 +465,6 @@
           {
           }
           
  -        // test the deprecated method
  -        int index = n.indexOfThrowable(-1, NestableExceptionTester1.class);
  -        assertEquals("deprecated method index", 0, index);
  -        index = n.indexOfThrowable(999, Exception.class);
  -        assertEquals("deprecated method index", 4, index);
       }
   
       private void doNestableExceptionIndexOfThrowableI(Nestable n, Class type, int fromIndex, int expectedIndex, String expectedMsg)
  @@ -524,26 +491,6 @@
               }
           }
           
  -        // test the deprecated method
  -        int index1 = n.indexOfThrowable(fromIndex, type);
  -        assertEquals("index of throwable " + type.getName(), expectedIndex, index);
  -        if(expectedIndex > -1)
  -        {
  -            t = n.getThrowable(index1);
  -            if(expectedMsg != null)
  -            {
  -                String msg = null;
  -                if(Nestable.class.isInstance(t))
  -                {
  -                    msg = ((Nestable) t).getMessage(0);
  -                }
  -                else
  -                {
  -                    msg = t.getMessage();
  -                }
  -                assertEquals("message of indexed throwable", expectedMsg, msg);
  -            }
  -        }
       }
       
       public void testPrintPartialStackTrace()
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>