OFSwitchHandlerTestBase.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:iTAP-controller 作者:
/**
 * 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));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号