本文整理汇总了Java中org.apache.commons.lang.exception.NestableException类的典型用法代码示例。如果您正苦于以下问题:Java NestableException类的具体用法?Java NestableException怎么用?Java NestableException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NestableException类属于org.apache.commons.lang.exception包,在下文中一共展示了NestableException类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetThrowable
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
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());
assertEquals(NestableException.class, ex.getThrowable(1).getClass());
assertEquals("nested 1", ex.getThrowable(1).getMessage());
assertEquals(NestableException.class, ex.getThrowable(2).getClass());
assertEquals("nested 2", ex.getThrowable(2).getMessage());
assertEquals(3, ex.getThrowables().length);
assertEquals(NotImplementedException.class, ex.getThrowables()[0].getClass());
assertEquals("Code is not implemented", ex.getThrowables()[0].getMessage());
assertEquals(NestableException.class, ex.getThrowables()[1].getClass());
assertEquals("nested 1", ex.getThrowables()[1].getMessage());
assertEquals(NestableException.class, ex.getThrowables()[2].getClass());
assertEquals("nested 2", ex.getThrowables()[2].getMessage());
}
示例2: testPrintStackTrace
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
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();
System.setErr(errStream);
assertTrue(baos.toString().length() > 0);
}
示例3: testPrintStackTrace_Stream
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
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);
}
示例4: testPrintStackTrace_Writer
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
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);
}
示例5: testPrintPartialStackTrace_Writer
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
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);
}
示例6: writeCell
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
private void writeCell(HSSFRow row, int col, Object value, FormatType formatType) throws NestableException {
writeCell(row, col, value, formatType, null, null);
}
示例7: testIndexOfThrowable
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
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));
}
示例8: testIndexOfThrowable_Index
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
public void testIndexOfThrowable_Index() {
NotImplementedException ex = new NotImplementedException(new NestableException("nested 1", new NestableException("nested 2")));
assertEquals(1, ex.indexOfThrowable(NestableException.class, 1));
}
示例9: NestableException
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
/**
* Constructs a new <code>NestableException</code> without specified
* detail message.
*/
public NestableException() {
super();
}
示例10: NestableException
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
/**
* Constructs a new <code>NestableException</code> without specified
* detail message.
*/
public NestableException() {
super();
}