diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java index 0211c17b6fe..c45623cf1c3 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java @@ -337,6 +337,10 @@ public void test021AddAssignmentModifyAccountAssignment() throws Exception { assertNoMinusAttributeValues(plusAccountConstruction, getDummyResourceController().getAttributeQName(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME)); + assertTrue("Old legal variable for projection context is not true", accContext.isLegalOld()); + assertTrue("Legal variable for projection context is not true", accContext.isLegal()); + assertTrue("Old assigned variable for projection context is not true", accContext.isAssignedOld()); + assertTrue("Assigned variable for projection context is not true", accContext.isAssigned()); } @Test diff --git a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ConcurrencyTest.java b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ConcurrencyTest.java index 6f816329a12..c9493b609e0 100644 --- a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ConcurrencyTest.java +++ b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ConcurrencyTest.java @@ -50,6 +50,13 @@ public class ConcurrencyTest extends BaseSQLRepoTest { private static final long WAIT_FOR_THREAD_NATURAL_STOP_TIME = 300000; + @Override + public void initSystem() throws Exception { + Session session = getFactory().openSession(); + session.doWork(connection -> System.out.println(">>>> Connection.TRANSACTION_* (transaction isolation level): " + connection.getTransactionIsolation())); + session.close(); + } + @Test public void test001TwoWriters_OneAttributeEach__NoReader() throws Exception { PropertyModifierThread[] mts = new PropertyModifierThread[] { @@ -128,11 +135,6 @@ private interface Checker { } private void concurrencyUniversal(String name, long duration, long waitStep, PropertyModifierThread[] modifierThreads, Checker checker) throws Exception { - - Session session = getFactory().openSession(); - session.doWork(connection -> System.out.println(">>>>" + connection.getTransactionIsolation())); - session.close(); - final File file = new File("src/test/resources/concurrency/user.xml"); PrismObject user = prismContext.parseObject(file); user.asObjectable().setName(new PolyStringType(name)); @@ -508,10 +510,6 @@ public void test100AddOperationExecution() throws Exception { int THREADS = 8; long DURATION = 30000L; - Session session = getFactory().openSession(); - session.doWork(connection -> System.out.println(">>>>" + connection.getTransactionIsolation())); - session.close(); - UserType user = new UserType(prismContext).name("jack"); OperationResult result = new OperationResult("test100AddOperationExecution"); @@ -603,7 +601,7 @@ public void test110AddAssignments() throws Exception { public void test120AddApproverRef() throws Exception { int THREADS = 4; - long DURATION = 30000L; + long DURATION = 30_000L; final String DELEGATED_REF_FORMAT = "oid-%d-%s"; RoleType role = new RoleType(prismContext).name("judge"); diff --git a/repo/repo-sql-impl-test/testng-db-specific.xml b/repo/repo-sql-impl-test/testng-db-specific.xml index 61134de60a5..c417bd8a40d 100644 --- a/repo/repo-sql-impl-test/testng-db-specific.xml +++ b/repo/repo-sql-impl-test/testng-db-specific.xml @@ -14,4 +14,12 @@ + + + + + + + + diff --git a/repo/repo-sql-impl-test/testng-integration.xml b/repo/repo-sql-impl-test/testng-integration.xml index 458d7c7e2be..0384c9c4fde 100644 --- a/repo/repo-sql-impl-test/testng-integration.xml +++ b/repo/repo-sql-impl-test/testng-integration.xml @@ -50,14 +50,6 @@ - - - - - - - - diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/data/common/dictionary/ExtItemDictionary.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/data/common/dictionary/ExtItemDictionary.java index ebb02d41eac..f5b19948eb8 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/data/common/dictionary/ExtItemDictionary.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/data/common/dictionary/ExtItemDictionary.java @@ -43,6 +43,12 @@ public class ExtItemDictionary { private Map itemsById; private Map itemsByKey; + @PostConstruct + public synchronized void initialize() { + itemsByKey = null; + itemsById = null; + } + private boolean fetchItemsIfNeeded() { if (itemsByKey != null) { return false; @@ -127,12 +133,6 @@ private RExtItem createOrFindItemByDefinitionInternal( return item; } - @PostConstruct - public synchronized void initialize() { - itemsByKey = null; - itemsById = null; - } - private void addExtItemAttempt(RExtItem item) { Session session = null; try {