use of com.evolveum.midpoint.schema.SearchResultMetadata in project midpoint by Evolveum.
the class AbstractAdLdapTest method test100SeachJackBySamAccountName.
// test050 in subclasses
@Test
public void test100SeachJackBySamAccountName() throws Exception {
final String TEST_NAME = "test100SeachJackBySamAccountName";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectQuery query = createSamAccountNameQuery(ACCOUNT_JACK_SAM_ACCOUNT_NAME);
rememberConnectorOperationCount();
rememberConnectorSimulatedPagingSearchCount();
// WHEN
TestUtil.displayWhen(TEST_NAME);
SearchResultList<PrismObject<ShadowType>> shadows = modelService.searchObjects(ShadowType.class, query, null, task, result);
// THEN
result.computeStatus();
TestUtil.assertSuccess(result);
assertEquals("Unexpected search result: " + shadows, 1, shadows.size());
PrismObject<ShadowType> shadow = shadows.get(0);
display("Shadow", shadow);
assertAccountShadow(shadow, toAccountDn(ACCOUNT_JACK_SAM_ACCOUNT_NAME, ACCOUNT_JACK_FULL_NAME));
jackAccountOid = shadow.getOid();
assertConnectorOperationIncrement(2);
assertConnectorSimulatedPagingSearchIncrement(0);
SearchResultMetadata metadata = shadows.getMetadata();
if (metadata != null) {
assertFalse(metadata.isPartialResults());
}
assertLdapConnectorInstances(1);
}
use of com.evolveum.midpoint.schema.SearchResultMetadata in project midpoint by Evolveum.
the class AbstractAdLdapTest method test174SeachFirst11AccountsOffset2.
/**
* Blocksize is 5, so this gets more than two blocks.
* There is offset, so VLV should be used.
* No explicit sorting.
*/
@Test
public void test174SeachFirst11AccountsOffset2() throws Exception {
final String TEST_NAME = "test174SeachFirst11AccountsOffset2";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectQuery query = ObjectQueryUtil.createResourceAndObjectClassQuery(getResourceOid(), getAccountObjectClass(), prismContext);
ObjectPaging paging = ObjectPaging.createPaging(2, 11);
query.setPaging(paging);
allowDuplicateSearchResults = true;
// WHEN
SearchResultList<PrismObject<ShadowType>> searchResultList = doSearch(TEST_NAME, query, 11, task, result);
// THEN
allowDuplicateSearchResults = false;
assertConnectorOperationIncrement(1);
assertConnectorSimulatedPagingSearchIncrement(0);
SearchResultMetadata metadata = searchResultList.getMetadata();
if (metadata != null) {
assertFalse(metadata.isPartialResults());
}
assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.schema.SearchResultMetadata in project midpoint by Evolveum.
the class AbstractLdapConnTest method test100SeachAccount0ByLdapUid.
@Test
public void test100SeachAccount0ByLdapUid() throws Exception {
final String TEST_NAME = "test100SeachAccount0ByLdapUid";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectQuery query = createUidQuery(ACCOUNT_0_UID);
rememberConnectorOperationCount();
rememberConnectorSimulatedPagingSearchCount();
// WHEN
TestUtil.displayWhen(TEST_NAME);
SearchResultList<PrismObject<ShadowType>> shadows = modelService.searchObjects(ShadowType.class, query, null, task, result);
assertEquals("Unexpected search result: " + shadows, 1, shadows.size());
PrismObject<ShadowType> shadow = shadows.get(0);
assertAccountShadow(shadow, toAccountDn(ACCOUNT_0_UID));
assertConnectorOperationIncrement(1, 2);
assertConnectorSimulatedPagingSearchIncrement(0);
SearchResultMetadata metadata = shadows.getMetadata();
if (metadata != null) {
assertFalse(metadata.isPartialResults());
}
assertLdapConnectorInstances(1);
}
use of com.evolveum.midpoint.schema.SearchResultMetadata in project midpoint by Evolveum.
the class AbstractLdapConnTest method test174SeachFirst222AccountsOffset20.
/**
* Blocksize is 100, so this gets more than two blocks.
* There is offset, so VLV should be used.
* No explicit sorting.
*/
@Test
public void test174SeachFirst222AccountsOffset20() throws Exception {
final String TEST_NAME = "test174SeachFirst222AccountsOffset20";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectQuery query = ObjectQueryUtil.createResourceAndObjectClassQuery(getResourceOid(), getAccountObjectClass(), prismContext);
ObjectPaging paging = ObjectPaging.createPaging(20, 222);
query.setPaging(paging);
SearchResultList<PrismObject<ShadowType>> searchResultList = doSearch(TEST_NAME, query, 222, task, result);
assertConnectorOperationIncrement(1, 223);
assertConnectorSimulatedPagingSearchIncrement(0);
SearchResultMetadata metadata = searchResultList.getMetadata();
if (metadata != null) {
assertFalse(metadata.isPartialResults());
}
assertLdapConnectorInstances(1, 2);
}
use of com.evolveum.midpoint.schema.SearchResultMetadata in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test100SeachJackBySamAccountName.
@Test
public void test100SeachJackBySamAccountName() throws Exception {
final String TEST_NAME = "test100SeachJackBySamAccountName";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectQuery query = createSamAccountNameQuery(ACCOUNT_JACK_SAM_ACCOUNT_NAME);
rememberConnectorOperationCount();
rememberConnectorSimulatedPagingSearchCount();
// WHEN
TestUtil.displayWhen(TEST_NAME);
SearchResultList<PrismObject<ShadowType>> shadows = modelService.searchObjects(ShadowType.class, query, null, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
assertEquals("Unexpected search result: " + shadows, 1, shadows.size());
PrismObject<ShadowType> shadow = shadows.get(0);
display("Shadow", shadow);
assertAccountShadow(shadow, toAccountDn(ACCOUNT_JACK_SAM_ACCOUNT_NAME, ACCOUNT_JACK_FULL_NAME));
jackAccountOid = shadow.getOid();
// assertConnectorOperationIncrement(2);
assertConnectorSimulatedPagingSearchIncrement(0);
SearchResultMetadata metadata = shadows.getMetadata();
if (metadata != null) {
assertFalse(metadata.isPartialResults());
}
assertLdapConnectorInstances(1);
}
Aggregations