Skip to content

Commit

Permalink
Fix TestFilterSimplifier and add it to the suite
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 2, 2020
1 parent f653dd7 commit 40bcca2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
Expand Up @@ -8,6 +8,7 @@

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.query.*;
import com.evolveum.midpoint.prism.util.PrismAsserts;
import com.evolveum.midpoint.prism.util.PrismTestUtil;
import com.evolveum.midpoint.schema.constants.MidPointConstants;
import com.evolveum.midpoint.schema.util.ObjectQueryUtil;
Expand All @@ -25,7 +26,6 @@
import static org.testng.AssertJUnit.assertTrue;

/**
* @author mederly
*
*/
public class TestFilterSimplifier {
Expand All @@ -37,7 +37,7 @@ public void setup() throws SchemaException, SAXException, IOException {
}

@Test
public void test010All() throws Exception {
public void test010All() {
System.out.println("===[ test010All ]===");

// GIVEN
Expand All @@ -55,7 +55,7 @@ public void test010All() throws Exception {
}

@Test
public void test020None() throws Exception {
public void test020None() {
System.out.println("===[ test020None ]===");

// GIVEN
Expand All @@ -73,7 +73,7 @@ public void test020None() throws Exception {
}

@Test
public void test030Undefined() throws Exception {
public void test030Undefined() {
System.out.println("===[ test030Undefined ]===");

// GIVEN
Expand All @@ -91,7 +91,7 @@ public void test030Undefined() throws Exception {
}

@Test
public void test100AndLevel1() throws Exception {
public void test100AndLevel1() {
System.out.println("===[ test100AndLevel1 ]===");

// GIVEN
Expand All @@ -112,7 +112,7 @@ public void test100AndLevel1() throws Exception {
}

@Test
public void test110AndLevel1WithoutNone() throws Exception {
public void test110AndLevel1WithoutNone() {
System.out.println("===[ test110AndLevel1WithoutNone ]===");

// GIVEN
Expand All @@ -132,7 +132,7 @@ public void test110AndLevel1WithoutNone() throws Exception {
}

@Test
public void test120AndEmpty() throws Exception {
public void test120AndEmpty() {
System.out.println("===[ test120AndEmpty ]===");

// GIVEN
Expand All @@ -149,7 +149,7 @@ public void test120AndEmpty() throws Exception {
}

@Test
public void test150OrLevel1() throws Exception {
public void test150OrLevel1() {
System.out.println("===[ test150OrLevel1 ]===");

// GIVEN
Expand All @@ -170,7 +170,7 @@ public void test150OrLevel1() throws Exception {
}

@Test
public void test160OrLevel1WithoutAll() throws Exception {
public void test160OrLevel1WithoutAll() {
System.out.println("===[ test160OrLevel1WithoutAll ]===");

// GIVEN
Expand All @@ -190,7 +190,7 @@ public void test160OrLevel1WithoutAll() throws Exception {
}

@Test
public void test170OrLevel1Undefined() throws Exception {
public void test170OrLevel1Undefined() {
System.out.println("===[ test170OrLevel1Undefined ]===");

// GIVEN
Expand All @@ -207,7 +207,7 @@ public void test170OrLevel1Undefined() throws Exception {
}

@Test
public void test180OrEmpty() throws Exception {
public void test180OrEmpty() {
System.out.println("===[ test180OrEmpty ]===");

// GIVEN
Expand All @@ -224,7 +224,7 @@ public void test180OrEmpty() throws Exception {
}

@Test
public void test200AndLevel2() throws Exception {
public void test200AndLevel2() {
System.out.println("===[ test200AndLevel2 ]===");

// GIVEN
Expand Down Expand Up @@ -252,7 +252,7 @@ public void test200AndLevel2() throws Exception {
}

@Test
public void test210OrLevel2() throws Exception {
public void test210OrLevel2() {
System.out.println("===[ test210OrLevel2 ]===");

// GIVEN
Expand Down Expand Up @@ -280,7 +280,7 @@ public void test210OrLevel2() throws Exception {
}

@Test
public void test300NotAll() throws Exception {
public void test300NotAll() {
System.out.println("===[ test300NotAll ]===");

// GIVEN
Expand All @@ -299,7 +299,7 @@ public void test300NotAll() throws Exception {
}

@Test
public void test310NotNone() throws Exception {
public void test310NotNone() {
System.out.println("===[ test310NotNone ]===");

// GIVEN
Expand All @@ -318,7 +318,7 @@ public void test310NotNone() throws Exception {
}

@Test
public void test320NotNotAll() throws Exception {
public void test320NotNotAll() {
System.out.println("===[ test320NotNotAll ]===");

// GIVEN
Expand All @@ -337,7 +337,7 @@ public void test320NotNotAll() throws Exception {
}

@Test
public void test330NotNotNone() throws Exception {
public void test330NotNotNone() {
System.out.println("===[ test330NotNotNone ]===");

// GIVEN
Expand All @@ -356,7 +356,7 @@ public void test330NotNotNone() throws Exception {
}

@Test
public void test400TypeAll() throws Exception {
public void test400TypeAll() {
System.out.println("===[ test400TypeAll ]===");

// GIVEN
Expand All @@ -378,7 +378,7 @@ public void test400TypeAll() throws Exception {
}

@Test
public void test410TypeNone() throws Exception {
public void test410TypeNone() {
System.out.println("===[ test410TypeNone ]===");

// GIVEN
Expand All @@ -397,7 +397,7 @@ public void test410TypeNone() throws Exception {
}

@Test
public void test420TypeUndefined() throws Exception {
public void test420TypeUndefined() {
System.out.println("===[ test420TypeUndefined ]===");

// GIVEN
Expand All @@ -419,7 +419,7 @@ public void test420TypeUndefined() throws Exception {
}

@Test
public void test500ExistsAll() throws Exception {
public void test500ExistsAll() {
System.out.println("===[ test500ExistsAll ]===");

// GIVEN
Expand All @@ -436,12 +436,12 @@ public void test500ExistsAll() throws Exception {
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified instanceof ExistsFilter);
ExistsFilter existsSimplified = (ExistsFilter) simplified;
assertEquals("Wrong simplified filter path", UserType.F_ASSIGNMENT, existsSimplified.getFullPath());
PrismAsserts.assertEquivalent("Wrong simplified filter path", UserType.F_ASSIGNMENT, existsSimplified.getFullPath());
assertTrue("Wrong simplified filter subfilter: " + existsSimplified.getFilter(), ObjectQueryUtil.isAll(existsSimplified.getFilter()));
}

@Test
public void test510ExistsNone() throws Exception {
public void test510ExistsNone() {
System.out.println("===[ test510ExistsNone ]===");

// GIVEN
Expand All @@ -460,7 +460,7 @@ public void test510ExistsNone() throws Exception {
}

@Test
public void test520ExistsUndefined() throws Exception {
public void test520ExistsUndefined() {
System.out.println("===[ test520ExistsUndefined ]===");

// GIVEN
Expand All @@ -477,7 +477,7 @@ public void test520ExistsUndefined() throws Exception {
System.out.println("Simplified filter:\n" + DebugUtil.debugDump(simplified));
assertTrue("Wrong simplified filter: " + simplified, simplified instanceof ExistsFilter);
ExistsFilter existsSimplified = (ExistsFilter) simplified;
assertEquals("Wrong simplified filter path", UserType.F_ASSIGNMENT, existsSimplified.getFullPath());
PrismAsserts.assertEquivalent("Wrong simplified filter path", UserType.F_ASSIGNMENT, existsSimplified.getFullPath());
assertTrue("Wrong simplified filter subfilter: " + existsSimplified.getFilter(), ObjectQueryUtil.isAll(existsSimplified.getFilter()));
}

Expand Down
1 change: 1 addition & 0 deletions infra/schema/testng-unit.xml
Expand Up @@ -138,6 +138,7 @@
<class name="com.evolveum.midpoint.schema.TestParseMisc"/>
<class name="com.evolveum.midpoint.schema.validator.TestObjectValidator"/>
<class name="com.evolveum.midpoint.schema.TestSchemaImmutability"/>
<class name="com.evolveum.midpoint.schema.TestFilterSimplifier"/>
</classes>
</test>
</suite>

0 comments on commit 40bcca2

Please sign in to comment.