QueryTest.java 文件源码

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

项目:freeVM 作者:
/**
 * Test for the Query.match() method.
 * 
 * @param expr The array, containing reqular expressions.
 * @param invert if true - the match() method should return false.
 * @throws Exception
 */
private void testMatch(String[] expr, boolean invert) throws Exception {
    for (int i = 0; i < expr.length; i++) {
        try {
            if (invert) {
                assertFalse("Query.match(\"" + instances[0].getAttribute1()
                    + "\", \"" + expr[i] + "\")", Query.match(
                    Query.attr("Attribute1"), Query.value(expr[i])).apply(
                    names[0]));
            } else {
                assertTrue("Query.match(\"" + instances[0].getAttribute1()
                    + "\", \"" + expr[i] + "\")", Query.match(
                    Query.attr("Attribute1"), Query.value(expr[i])).apply(
                    names[0]));
            }
        } catch (Throwable ex) {
            fail("Query.match(\"" + instances[0].getAttribute1() + "\", \""
                + expr[i] + "\")", ex);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号