use of net.opengis.wfs.v_1_1_0.QueryType in project midpoint by Evolveum.
the class TestOpenDj method test202SearchObjectsComplexFilter.
@Test
public void test202SearchObjectsComplexFilter() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
QueryType queryType = PrismTestUtil.parseAtomicValue(QUERY_COMPLEX_FILTER_FILE, QueryType.COMPLEX_TYPE);
ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType);
provisioningService.applyDefinition(ShadowType.class, query, task, result);
rememberCounter(InternalCounters.CONNECTOR_OPERATION_COUNT);
rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT);
// WHEN
when();
List<PrismObject<ShadowType>> objListType = provisioningService.searchObjects(ShadowType.class, query, null, task, result);
// THEN
then();
result.computeStatus();
TestUtil.assertSuccess(result);
for (PrismObject<ShadowType> objType : objListType) {
assertNotNull("Null search result", objType);
display("found object", objType);
}
assertEquals("Unexpected number of objects found", 1, objListType.size());
assertConnectorOperationIncrement(1, 3);
assertCounterIncrement(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT, 0);
}
use of net.opengis.wfs.v_1_1_0.QueryType in project midpoint by Evolveum.
the class TestOpenDj method test330SearchForPosixAccount.
/**
* Search for account created directly on resource (no shadow in repo). The account has
* posixAccount auxiliary object class. Provisioning should figure that out.
*/
@Test
public void test330SearchForPosixAccount() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
QueryType queryType = PrismTestUtil.parseAtomicValue(QUERY_VANHELGEN_FILE, QueryType.COMPLEX_TYPE);
ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType);
provisioningService.applyDefinition(ShadowType.class, query, task, result);
Entry entry = openDJController.addEntryFromLdifFile(ACCOUNT_POSIX_VANHELGEN_LDIF_FILE);
display("Added entry", entry);
rememberCounter(InternalCounters.CONNECTOR_OPERATION_COUNT);
rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT);
// WHEN
when();
List<PrismObject<ShadowType>> objListType = provisioningService.searchObjects(ShadowType.class, query, null, task, result);
// THEN
then();
for (PrismObject<ShadowType> objType : objListType) {
assertNotNull("Null search result", objType);
display("found object", objType);
}
assertEquals("Unexpected number of objects found", 1, objListType.size());
PrismObject<ShadowType> provisioningShadow = objListType.get(0);
assertAttribute(provisioningShadow, "cn", "Edward Van Helgen");
assertAttribute(provisioningShadow, "homeDirectory", "/home/vanhelgen");
assertAttribute(provisioningShadow, "uidNumber", 1002);
assertConnectorOperationIncrement(1, 3);
assertCounterIncrement(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT, 0);
assertShadows(17);
}
use of net.opengis.wfs.v_1_1_0.QueryType in project midpoint by Evolveum.
the class TestOpenDj method test252CountLdapGroups.
/**
* Account counting is simulated.
* But "dumber" resource do not have any simulation for this.
*/
@Test
public void test252CountLdapGroups() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
QueryType queryType = PrismTestUtil.parseAtomicValue(QUERY_ALL_LDAP_GROUPS_FILE, QueryType.COMPLEX_TYPE);
ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType);
// WHEN
when();
Integer count = provisioningService.countObjects(ShadowType.class, query, null, task, result);
// THEN
then();
assertSuccess(result);
displayValue("All LDAP groups count", count);
assertEquals("Unexpected number of search results", getExpectedLdapGroupCountTest25x(), count);
}
use of net.opengis.wfs.v_1_1_0.QueryType in project midpoint by Evolveum.
the class TestOpenDj method test250CountAccounts.
/**
* Account counting is simulated.
* For "dumber" resource it is defined in schemaHandling as a object-type-specific capability.
*/
@Test
public void test250CountAccounts() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
QueryType queryType = PrismTestUtil.parseAtomicValue(QUERY_ALL_ACCOUNTS_FILE, QueryType.COMPLEX_TYPE);
ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType);
// WHEN
when();
Integer count = provisioningService.countObjects(ShadowType.class, query, null, task, result);
// THEN
then();
assertSuccess(result);
displayValue("All accounts count", count);
assertEquals("Unexpected number of search results", (Integer) 14, count);
}
use of net.opengis.wfs.v_1_1_0.QueryType in project midpoint by Evolveum.
the class TestOpenDj method test231SearchObjectsPagedOffsetZero.
@Test
public void test231SearchObjectsPagedOffsetZero() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
QueryType queryType = PrismTestUtil.parseAtomicValue(QUERY_ALL_ACCOUNTS_FILE, QueryType.COMPLEX_TYPE);
ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType);
ObjectPaging paging = prismContext.queryFactory().createPaging(0, 4);
query.setPaging(paging);
rememberCounter(InternalCounters.CONNECTOR_OPERATION_COUNT);
rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT);
// WHEN
when();
SearchResultList<PrismObject<ShadowType>> searchResults = provisioningService.searchObjects(ShadowType.class, query, null, task, result);
// THEN
then();
assertSuccess(result);
display("Search results", searchResults);
assertSearchResults(searchResults, "cook", "drake", "hbarbossa", "idm");
assertConnectorOperationIncrement(1, 9);
assertCounterIncrement(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT, 0);
// VLV search if forced by using offset. So we have result number estimate.
assertApproxNumberOfAllResults(searchResults.getMetadata(), 14);
}
Aggregations