Java Code Examples for junit.framework.AssertionFailedError#setStackTrace()
The following examples show how to use
junit.framework.AssertionFailedError#setStackTrace() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataFolderSetOrderTest.java From netbeans with Apache License 2.0 | 5 votes |
/** If execution fails we wrap the exception with * new log message. */ protected void runTest () throws Throwable { ErrManager.messages.append ("Starting test "); ErrManager.messages.append (getName ()); ErrManager.messages.append ('\n'); try { super.runTest (); } catch (AssertionFailedError ex) { AssertionFailedError ne = new AssertionFailedError (ex.getMessage () + " Log:\n" + ErrManager.messages); ne.setStackTrace (ex.getStackTrace ()); throw ne; } }
Example 2
Source File: ChildrenKeysTest.java From netbeans with Apache License 2.0 | 5 votes |
public void assertNoEvents (String msg) { if (events.size() > 0) { AssertionFailedError err = new AssertionFailedError(msg + ":\n" + events); err.initCause(when); err.setStackTrace(when.getStackTrace()); throw err; } }