Search in sources :

Example 11 with QUser

use of com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser in project midpoint by Evolveum.

the class MidScaleNewRepoTest method test610AddPeakUsers.

@Test
public void test610AddPeakUsers() throws SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.addPeak", "Repository addObject(user) - 3rd batch");
    for (int userIndex = 1; userIndex <= PEAK_USER_COUNT; userIndex++) {
        String name = String.format("user-peak-%07d", userIndex);
        UserType user = new UserType(prismContext).name(PolyStringType.fromOrig(name)).description(randomDescription(name));
        addExtensionValues(user);
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(user.asPrismObject(), null, operationResult);
        } catch (ObjectAlreadyExistsException e) {
            QUser u = aliasFor(QUser.class);
            user.setOid(selectOne(u, u.nameOrig.eq(name)).oid.toString());
        }
        if (userIndex % 10 == 0) {
            userOidsToGet.add(user.getOid());
        }
    }
// no query recorder in this test
}
Also used : QUser(com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser) Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 12 with QUser

use of com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser in project midpoint by Evolveum.

the class MidScaleNewRepoTest method test615AddPeakUsersWithOid.

@Test
public void test615AddPeakUsersWithOid() throws SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.addPeakWithOid", "Repository addObject(user) - 4th batch");
    for (int userIndex = 1; userIndex <= PEAK_USER_COUNT; userIndex++) {
        String name = String.format("user-peak-oid-%07d", userIndex);
        UserType user = new UserType(prismContext).oid(UUID.randomUUID().toString()).name(PolyStringType.fromOrig(name)).description(randomDescription(name));
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(user.asPrismObject(), null, operationResult);
        } catch (ObjectAlreadyExistsException e) {
            QUser u = aliasFor(QUser.class);
            user.setOid(selectOne(u, u.nameOrig.eq(name)).oid.toString());
        }
        if (userIndex % 10 == 0) {
            userOidsToGet.add(user.getOid());
        }
    }
// no query recorder in this test
}
Also used : QUser(com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser) Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 13 with QUser

use of com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser in project midpoint by Evolveum.

the class MidScaleNewRepoTest method test020AddBaseUsers.

@Test
public void test020AddBaseUsers() throws SchemaException {
    if (MORE_USER_START > 1) {
        throw new SkipException("Skipping, as we probably want to continue with more users");
    }
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.add", "Repository addObject(user) - 1st batch");
    for (int userIndex = 1; userIndex <= BASE_USER_COUNT; userIndex++) {
        String name = String.format("user-%07d", userIndex);
        UserType user = new UserType(prismContext).name(PolyStringType.fromOrig(name)).description(randomDescription(name));
        addExtensionValues(user);
        if (userIndex == BASE_USER_COUNT) {
            queryRecorder.clearBufferAndStartRecording();
        }
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(user.asPrismObject(), null, operationResult);
        } catch (ObjectAlreadyExistsException e) {
            QUser u = aliasFor(QUser.class);
            user.setOid(selectOne(u, u.nameOrig.eq(name)).oid.toString());
        }
        if (userIndex % 10 == 0) {
            userOidsToGet.add(user.getOid());
        }
    }
    queryRecorder.stopRecording();
}
Also used : QUser(com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser) Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SkipException(org.testng.SkipException) Split(org.javasimon.Split) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 14 with QUser

use of com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser in project midpoint by Evolveum.

the class MidScaleNewRepoTest method test210AddMoreUsers.

@Test
public // @Test(enabled = false) // uncomment this if the users are all in to skip straight to the shadows
void test210AddMoreUsers() throws SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.addMore", "Repository addObject(user) - 2nd batch");
    for (int userIndex = MORE_USER_START; userIndex <= MORE_USER_COUNT; userIndex++) {
        String name = String.format("user-more-%07d", userIndex);
        UserType user = new UserType(prismContext).name(PolyStringType.fromOrig(name)).description(randomDescription(name));
        addExtensionValues(user);
        if (userIndex == MORE_USER_COUNT) {
            queryRecorder.startRecording();
        }
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(user.asPrismObject(), null, operationResult);
        } catch (ObjectAlreadyExistsException e) {
            QUser u = aliasFor(QUser.class);
            user.setOid(selectOne(u, u.nameOrig.eq(name)).oid.toString());
        }
        if (userIndex % 100 == 0) {
            userOidsToGet.add(user.getOid());
        }
    }
    queryRecorder.stopRecording();
}
Also used : QUser(com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser) Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Aggregations

SqaleRepoBaseTest (com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)14 QUser (com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser)14 Test (org.testng.annotations.Test)14 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)13 MUser (com.evolveum.midpoint.repo.sqale.qmodel.focus.MUser)8 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)8 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)7 JdbcSession (com.evolveum.midpoint.repo.sqlbase.JdbcSession)6 Jsonb (com.evolveum.midpoint.repo.sqale.jsonb.Jsonb)5 PrismObject (com.evolveum.midpoint.prism.PrismObject)4 ItemName (com.evolveum.midpoint.prism.path.ItemName)4 RepositoryService (com.evolveum.midpoint.repo.api.RepositoryService)4 com.evolveum.midpoint.repo.sqale.qmodel.accesscert (com.evolveum.midpoint.repo.sqale.qmodel.accesscert)4 com.evolveum.midpoint.repo.sqale.qmodel.assignment (com.evolveum.midpoint.repo.sqale.qmodel.assignment)4 MContainerType (com.evolveum.midpoint.repo.sqale.qmodel.common.MContainerType)4 QConnector (com.evolveum.midpoint.repo.sqale.qmodel.connector.QConnector)4 MShadow (com.evolveum.midpoint.repo.sqale.qmodel.shadow.MShadow)4 QShadow (com.evolveum.midpoint.repo.sqale.qmodel.shadow.QShadow)4 MTask (com.evolveum.midpoint.repo.sqale.qmodel.task.MTask)4 QTask (com.evolveum.midpoint.repo.sqale.qmodel.task.QTask)4