You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/07/25 13:39:01 UTC

[causeway] branch master updated: CAUSEWAY-3500: regr. tests: more concurrent test sync.

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/master by this push:
     new 63e1a5adf4 CAUSEWAY-3500: regr. tests: more concurrent test sync.
63e1a5adf4 is described below

commit 63e1a5adf42c92100252b63ee32f64eec105efd1
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Jul 25 15:38:55 2023 +0200

    CAUSEWAY-3500: regr. tests: more concurrent test sync.
---
 .../testdomain/injecting/jdo/JdoEntityInjectingTest.java  | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/regressiontests/stable-persistence-jdo/src/test/java/org/apache/causeway/testdomain/injecting/jdo/JdoEntityInjectingTest.java b/regressiontests/stable-persistence-jdo/src/test/java/org/apache/causeway/testdomain/injecting/jdo/JdoEntityInjectingTest.java
index fff3bf66ba..6b13571c23 100644
--- a/regressiontests/stable-persistence-jdo/src/test/java/org/apache/causeway/testdomain/injecting/jdo/JdoEntityInjectingTest.java
+++ b/regressiontests/stable-persistence-jdo/src/test/java/org/apache/causeway/testdomain/injecting/jdo/JdoEntityInjectingTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Order;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestMethodOrder;
 import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.annotation.Rollback;
+import org.springframework.test.annotation.Commit;
 import org.springframework.test.context.TestPropertySource;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -38,6 +38,7 @@ import org.apache.causeway.commons.internal.primitives._Longs.Bound;
 import org.apache.causeway.commons.internal.primitives._Longs.Range;
 import org.apache.causeway.core.config.presets.CausewayPresets;
 import org.apache.causeway.testdomain.conf.Configuration_usingJdo;
+import org.apache.causeway.testdomain.fixtures.EntityTestFixtures.Lock;
 import org.apache.causeway.testdomain.jdo.JdoTestFixtures;
 import org.apache.causeway.testdomain.jdo.entities.JdoBook;
 import org.apache.causeway.testdomain.jdo.entities.JdoProduct;
@@ -66,10 +67,12 @@ class JdoEntityInjectingTest extends CausewayIntegrationTestAbstract {
     @Inject private JdoTestFixtures jdoTestFixtures;
     @Inject private RepositoryService repository;
     @Inject private KVStoreForTesting kvStore;
+    private static Lock lock;
 
-    @Test @Order(0) @Rollback(false)
-    void init() {
+    @Test @Order(0) @Commit
+    void aquireLockAndInit() {
         // given
+        lock = jdoTestFixtures.aquireLock();
         jdoTestFixtures.resetTo3Books(()->kvStore.clear(JdoBook.class));
         assertInjectCountRange(3, 12); //TODO there is some injection redundancy
     }
@@ -120,6 +123,12 @@ class JdoEntityInjectingTest extends CausewayIntegrationTestAbstract {
         log.debug("TEST 3 EXITING");
     }
 
+    @Test @Order(4)
+    void releaseLock() {
+        lock.release();
+    }
+
+
     // -- HELPER
 
     private long getInjectCount() {