本文整理汇总了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());
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:21,代码来源:NotImplementedExceptionTest.java
示例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);
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:NotImplementedExceptionTest.java
示例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);
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:NotImplementedExceptionTest.java
示例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);
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:NotImplementedExceptionTest.java
示例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);
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:NotImplementedExceptionTest.java
示例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);
}
开发者ID:cams7,项目名称:erp,代码行数:4,代码来源:ResultSetToExcel.java
示例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));
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:6,代码来源:NotImplementedExceptionTest.java
示例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));
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:NotImplementedExceptionTest.java
示例9: NestableException
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
/**
* Constructs a new <code>NestableException</code> without specified
* detail message.
*/
public NestableException() {
super();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:NestableException.java
示例10: NestableException
import org.apache.commons.lang.exception.NestableException; //导入依赖的package包/类
/**
* Constructs a new <code>NestableException</code> without specified
* detail message.
*/
public NestableException() {
super();
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:8,代码来源:NestableException.java
注:本文中的org.apache.commons.lang.exception.NestableException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论