Package org.apache.commons.lang.exception

Examples of org.apache.commons.lang.exception.NestableException


        assertEquals(NestableException.class, ex.getThrowables()[2].getClass());
        assertEquals("nested 2", ex.getThrowables()[2].getMessage());
    }
   
    public void testIndexOfThrowable() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        assertEquals(0, ex.indexOfThrowable(NotImplementedException.class));
        assertEquals(1, ex.indexOfThrowable(NestableException.class));
    }
View Full Code Here


        assertEquals(0, ex.indexOfThrowable(NotImplementedException.class));
        assertEquals(1, ex.indexOfThrowable(NestableException.class));
    }
   
    public void testIndexOfThrowable_Index() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        assertEquals(1, ex.indexOfThrowable(NestableException.class, 1));
    }
View Full Code Here

        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        assertEquals(1, ex.indexOfThrowable(NestableException.class, 1));
    }
   
    public void testPrintStackTrace() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);
        PrintStream errStream = System.err;
        System.setErr(ps);
        ex.printStackTrace();
View Full Code Here

        System.setErr(errStream);
        assertTrue(baos.toString().length() > 0);
    }
   
    public void testPrintStackTrace_Stream() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);
        ex.printStackTrace(ps);
        assertTrue(baos.toString().length() > 0);
    }
View Full Code Here

        ex.printStackTrace(ps);
        assertTrue(baos.toString().length() > 0);
    }
   
    public void testPrintStackTrace_Writer() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        StringWriter stringWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(stringWriter);
        ex.printStackTrace(writer);
        assertTrue(stringWriter.toString().length() > 0);
    }
View Full Code Here

        ex.printStackTrace(writer);
        assertTrue(stringWriter.toString().length() > 0);
    }
   
    public void testPrintPartialStackTrace_Writer() {
      NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
      StringWriter stringWriter = new StringWriter();
      PrintWriter writer = new PrintWriter(stringWriter);
      ex.printPartialStackTrace(writer);
      assertTrue(stringWriter.toString().length() > 0);
  }
View Full Code Here

        }
        catch ( Exception e )
        {
            e.printStackTrace();

            throw new NestableException( "Couldn't setCellStyleProperty.", e );
        }
    }
View Full Code Here

            assertEquals("nested 2", messages[2]);
        }
    }
   
    public void testGetThrowable() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
       
        assertEquals(3, ex.getThrowableCount());
       
        assertEquals(NotImplementedException.class, ex.getThrowable(0).getClass());
        assertEquals("Code is not implemented", ex.getThrowable(0).getMessage());
View Full Code Here

        assertEquals(NestableException.class, ex.getThrowables()[2].getClass());
        assertEquals("nested 2", ex.getThrowables()[2].getMessage());
    }
   
    public void testIndexOfThrowable() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        assertEquals(0, ex.indexOfThrowable(NotImplementedException.class));
        assertEquals(1, ex.indexOfThrowable(NestableException.class));
    }
View Full Code Here

        assertEquals(0, ex.indexOfThrowable(NotImplementedException.class));
        assertEquals(1, ex.indexOfThrowable(NestableException.class));
    }
   
    public void testIndexOfThrowable_Index() {
        NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
        assertEquals(1, ex.indexOfThrowable(NestableException.class, 1));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.lang.exception.NestableException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.