use of com.evolveum.midpoint.prism.PrismContext in project midpoint by Evolveum.
the class TestFilterSimplifier method test100AndLevel1.
@Test
public void test100AndLevel1() throws Exception {
System.out.println("===[ test100AndLevel1 ]===");
// GIVEN
PrismContext prismContext = PrismTestUtil.getPrismContext();
// WHEN
ObjectFilter filter = QueryBuilder.queryFor(UserType.class, prismContext).all().and().none().and().undefined().buildFilter();
System.out.println("Original filter:\n" + filter.debugDump());
// THEN
ObjectFilter simplified = ObjectQueryUtil.simplify(filter);
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified instanceof NoneFilter);
}
use of com.evolveum.midpoint.prism.PrismContext in project midpoint by Evolveum.
the class TestFilterSimplifier method test510ExistsNone.
@Test
public void test510ExistsNone() throws Exception {
System.out.println("===[ test510ExistsNone ]===");
// GIVEN
PrismContext prismContext = PrismTestUtil.getPrismContext();
// WHEN
ObjectFilter filter = QueryBuilder.queryFor(UserType.class, prismContext).exists(UserType.F_ASSIGNMENT).none().buildFilter();
System.out.println("Original filter:\n" + filter.debugDump());
// THEN
ObjectFilter simplified = ObjectQueryUtil.simplify(filter);
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified instanceof NoneFilter);
}
use of com.evolveum.midpoint.prism.PrismContext in project midpoint by Evolveum.
the class TestFilterSimplifier method test030Undefined.
@Test
public void test030Undefined() throws Exception {
System.out.println("===[ test030Undefined ]===");
// GIVEN
PrismContext prismContext = PrismTestUtil.getPrismContext();
// WHEN
ObjectFilter filter = QueryBuilder.queryFor(UserType.class, prismContext).undefined().buildFilter();
System.out.println("Original filter:\n" + filter.debugDump());
// THEN
ObjectFilter simplified = ObjectQueryUtil.simplify(filter);
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified == null || simplified instanceof AllFilter);
}
use of com.evolveum.midpoint.prism.PrismContext in project midpoint by Evolveum.
the class TestFilterSimplifier method test150OrLevel1.
@Test
public void test150OrLevel1() throws Exception {
System.out.println("===[ test150OrLevel1 ]===");
// GIVEN
PrismContext prismContext = PrismTestUtil.getPrismContext();
// WHEN
ObjectFilter filter = QueryBuilder.queryFor(UserType.class, prismContext).all().or().none().or().undefined().buildFilter();
System.out.println("Original filter:\n" + filter.debugDump());
// THEN
ObjectFilter simplified = ObjectQueryUtil.simplify(filter);
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified == null || simplified instanceof AllFilter);
}
use of com.evolveum.midpoint.prism.PrismContext in project midpoint by Evolveum.
the class TestFilterSimplifier method test310NotNone.
@Test
public void test310NotNone() throws Exception {
System.out.println("===[ test310NotNone ]===");
// GIVEN
PrismContext prismContext = PrismTestUtil.getPrismContext();
// WHEN
ObjectFilter filter = QueryBuilder.queryFor(UserType.class, prismContext).not().none().buildFilter();
System.out.println("Original filter:\n" + filter.debugDump());
// THEN
ObjectFilter simplified = ObjectQueryUtil.simplify(filter);
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified == null || simplified instanceof AllFilter);
}
Aggregations