LogRecordsTest.java 文件源码

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

项目:incubator-netbeans 作者:
public void testAlwaysSetParamters() throws Exception {
    String what = "actionDelegates.xml";
    InputStream is = getClass().getResourceAsStream(what);
    class H extends Handler {
        int cnt;

        public void publish(LogRecord record) {
            cnt++;
            if (record.getParameters() == null) {
                fail("Each record shall have paramters, #" + cnt + " did not: " + record.getMessage());
            }
        }

        public void flush() {
        }

        public void close() throws SecurityException {
        }
    }

    H h = new H();
    is = getClass().getResourceAsStream(what);
    LogRecords.scan(is, h);
    is.close();

    assertEquals("The four amount of records", 5, h.cnt);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号