You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/02/20 04:44:18 UTC

[isis] 01/02: ISIS-2158: minor (after debugging smoketest issues)

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/isis.git

commit 980eef811ce81049d756e1415bb2dcce95ec2d75
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Feb 20 05:24:26 2020 +0100

    ISIS-2158: minor (after debugging smoketest issues)
---
 .../isis/testdomain/commandexecution/WrapperAsyncTest.java   | 12 ++++++++++--
 .../isis/testdomain/publishing/PublisherServiceTest.java     |  6 +-----
 .../jdo/datanucleus5/persistence/IsisTransactionJdo.java     |  7 +++----
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java b/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java
index e776241..0e540f0 100644
--- a/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java
+++ b/examples/smoketests/src/test/java/org/apache/isis/testdomain/commandexecution/WrapperAsyncTest.java
@@ -30,8 +30,10 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.context.event.EventListener;
 import org.springframework.stereotype.Service;
+import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.TestPropertySource;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -64,6 +66,7 @@ import lombok.extern.log4j.Log4j2;
 )
 @TestPropertySource(IsisPresets.UseLog4j2Test)
 @Incubating("wrapper.wrap(inventoryManager) throws NPE")
+@DirtiesContext // because of the temporary installed ActionDomainEventListener
 class WrapperAsyncTest {
 
     @Inject private FixtureScripts fixtureScripts;
@@ -71,6 +74,11 @@ class WrapperAsyncTest {
     @Inject private FactoryService facoryService;
     @Inject private WrapperFactory wrapper;
     @Inject private ActionDomainEventListener actionDomainEventListener;
+    
+    @Configuration
+    public class Config {
+        // so that we get a new ApplicationContext.
+    }
 
     @BeforeEach
     void setUp() {
@@ -81,7 +89,7 @@ class WrapperAsyncTest {
         fixtureScripts.runPersona(JdoTestDomainPersona.InventoryWith1Book);
     }
 
-    @Test //@Tag("Incubating")
+    @Test @Tag("Incubating")
     void testWrapper_waitingOnDomainEvent() throws InterruptedException, ExecutionException {
 
         val inventoryManager = facoryService.viewModel(InventoryManager.class);
@@ -101,7 +109,7 @@ class WrapperAsyncTest {
         assertEquals(123d, product.getPrice(), 1E-6);
     }
 
-    @Test //@Tag("Incubating")
+    @Test @Tag("Incubating")
     void testWrapper_async_waitingOnDomainEvent() throws InterruptedException, ExecutionException {
 
         val inventoryManager = facoryService.viewModel(InventoryManager.class);
diff --git a/examples/smoketests/src/test/java/org/apache/isis/testdomain/publishing/PublisherServiceTest.java b/examples/smoketests/src/test/java/org/apache/isis/testdomain/publishing/PublisherServiceTest.java
index 6e88160..4a413fc 100644
--- a/examples/smoketests/src/test/java/org/apache/isis/testdomain/publishing/PublisherServiceTest.java
+++ b/examples/smoketests/src/test/java/org/apache/isis/testdomain/publishing/PublisherServiceTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.isis.testdomain.publishing;
 
-import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -41,7 +40,6 @@ import org.springframework.transaction.support.TransactionTemplate;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.apache.isis.applib.services.publish.PublisherService;
 import org.apache.isis.applib.services.repository.RepositoryService;
 import org.apache.isis.applib.services.wrapper.DisabledException;
 import org.apache.isis.applib.services.wrapper.WrapperFactory;
@@ -65,9 +63,7 @@ import lombok.val;
                 Configuration_usingPublishing.class
         }, 
         properties = {
-                "logging.level.org.apache.isis.incubator.IsisPlatformTransactionManagerForJdo=DEBUG",
-                // "isis.core.meta-model.introspector.parallelize=false",
-                // "logging.level.ObjectSpecificationAbstract=TRACE"
+                "logging.level.org.apache.isis.persistence.jdo.datanucleus5.persistence.IsisTransactionJdo=DEBUG"
         })
 @TestPropertySource({
     IsisPresets.SilenceWicket, // just to have any config properties at all
diff --git a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/IsisTransactionJdo.java b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/IsisTransactionJdo.java
index 2684bd0..37c8640 100644
--- a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/IsisTransactionJdo.java
+++ b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/persistence/IsisTransactionJdo.java
@@ -30,6 +30,7 @@ import org.apache.isis.applib.services.registry.ServiceRegistry;
 import org.apache.isis.applib.services.xactn.Transaction;
 import org.apache.isis.applib.services.xactn.TransactionId;
 import org.apache.isis.applib.services.xactn.TransactionState;
+import org.apache.isis.core.commons.collections.Can;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.internal.collections._Inbox;
 import org.apache.isis.core.commons.internal.exceptions._Exceptions;
@@ -157,7 +158,7 @@ public class IsisTransactionJdo implements Transaction {
     private final PublisherDispatchService publisherDispatchService;
     private final AuditerDispatchService auditerDispatchService;
 
-    private final Iterable<WithTransactionScope> withTransactionScopes;
+    private final Can<WithTransactionScope> withTransactionScopes;
 
     private IsisException abortCause;
 
@@ -167,9 +168,7 @@ public class IsisTransactionJdo implements Transaction {
             final int sequence) {
 
         id = TransactionId.of(interactionId, sequence);
-        //        this.authenticationSession = authenticationSession;
-
-        //        this.messageBroker = authenticationSession.getMessageBroker();
+        
         this.publisherDispatchService = serviceRegistry.lookupServiceElseFail(PublisherDispatchService.class);
         this.auditerDispatchService = serviceRegistry.lookupServiceElseFail(AuditerDispatchService.class);