/**
* 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);
}
}
}
QueryTest.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:freeVM
作者:
评论列表
文章目录