use of org.apache.syncope.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method type.
@Test
public void type() {
String fiql = new AnyObjectFiqlSearchConditionBuilder("PRINTER").query();
assertEquals(SpecialAttr.TYPE + "==PRINTER", fiql);
AnyTypeCond acond = new AnyTypeCond();
acond.setAnyTypeKey("PRINTER");
SearchCond simpleCond = SearchCond.getLeafCond(acond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method like.
@Test
public void like() {
String fiql = new UserFiqlSearchConditionBuilder().is("username").equalTo("ros*").query();
assertEquals("username==ros*", fiql);
AttributeCond attrCond = new AnyCond(AttributeCond.Type.LIKE);
attrCond.setSchema("username");
attrCond.setExpression("ros%");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method isNotNull.
@Test
public void isNotNull() {
String fiql = new UserFiqlSearchConditionBuilder().is("loginDate").notNullValue().query();
assertEquals("loginDate!=" + SpecialAttr.NULL, fiql);
AttributeCond attrCond = new AttributeCond(AttributeCond.Type.ISNOTNULL);
attrCond.setSchema("loginDate");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method relationshipTypes.
@Test
public void relationshipTypes() {
String fiql = new UserFiqlSearchConditionBuilder().inRelationshipTypes("type1").query();
assertEquals(SpecialAttr.RELATIONSHIP_TYPES + "==type1", fiql);
RelationshipTypeCond relationshipCond = new RelationshipTypeCond();
relationshipCond.setRelationshipTypeKey("type1");
SearchCond simpleCond = SearchCond.getLeafCond(relationshipCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
fiql = new AnyObjectFiqlSearchConditionBuilder("PRINTER").inRelationshipTypes("neighborhood").query();
assertEquals(SpecialAttr.RELATIONSHIP_TYPES + "==neighborhood;" + SpecialAttr.TYPE + "==PRINTER", fiql);
}
use of org.apache.syncope.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method isNull.
@Test
public void isNull() {
String fiql = new UserFiqlSearchConditionBuilder().is("loginDate").nullValue().query();
assertEquals("loginDate==" + SpecialAttr.NULL, fiql);
AttributeCond attrCond = new AttributeCond(AttributeCond.Type.ISNULL);
attrCond.setSchema("loginDate");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
Aggregations