/**
* Verify that the given exception event capture (as returned by
* getAndInitExceptionCapture) has thrown an exception of the given
* expectedExceptionClass.
* Resets the capture
* @param err
*/
void verifyExceptionCaptured(
OFMessage err, Class<? extends Throwable> expectedExceptionClass) {
Throwable caughtEx = null;
// This should purposely cause an exception
try{
switchHandler.processOFMessage(err);
}
catch(Exception e){
// Capture the exception
caughtEx = e;
}
assertThat(caughtEx, CoreMatchers.instanceOf(expectedExceptionClass));
}
OFSwitchHandlerTestBase.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:iTAP-controller
作者:
评论列表
文章目录