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 2021/07/24 09:42:15 UTC

[isis] branch master updated: ISIS-2573: exclude 'programmatic' test when publishing not supported programmatically

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


The following commit(s) were added to refs/heads/master by this push:
     new 2958cb9  ISIS-2573: exclude 'programmatic' test when publishing not supported programmatically
2958cb9 is described below

commit 2958cb96741683fcafbdd9b9f73a601cebe10d68
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Jul 24 11:42:05 2021 +0200

    ISIS-2573: exclude 'programmatic' test when publishing not supported
    programmatically
    
    also active debug logging specific to the publishing feature under test
---
 .../publishing/jdo/JdoCommandPublishingTest.java   |  1 +
 .../publishing/jdo/JdoEntityPublishingTest.java    |  3 +-
 .../publishing/jdo/JdoExecutionPublishingTest.java |  1 +
 .../publishing/jdo/JdoPropertyPublishingTest.java  |  4 +--
 .../publishing/jpa/JpaCommandPublishingTest.java   |  2 ++
 .../publishing/jpa/JpaEntityPublishingTest.java    |  3 +-
 .../publishing/jpa/JpaExecutionPublishingTest.java |  1 +
 .../publishing/jpa/JpaPropertyPublishingTest.java  |  4 +--
 .../publishing/PublishingTestFactoryAbstract.java  | 36 ++++++++++++++++------
 9 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoCommandPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoCommandPublishingTest.java
index 5dd974c..95fd4c0 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoCommandPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoCommandPublishingTest.java
@@ -42,6 +42,7 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingCommandPubl
                 //XrayEnable.class
         },
         properties = {
+                "logging.level.org.apache.isis.applib.services.publishing.log.CommandLogger=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.datanucleus5.persistence.IsisTransactionJdo=DEBUG",
                 "logging.level.org.apache.isis.core.runtimeservices.session.IsisInteractionFactoryDefault=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.datanucleus5.datanucleus.service.JdoPersistenceLifecycleService=DEBUG"
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoEntityPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoEntityPublishingTest.java
index 08dd4af..cabe167 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoEntityPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoEntityPublishingTest.java
@@ -42,6 +42,7 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingEntityChang
                 //XrayEnable.class
         },
         properties = {
+                "logging.level.org.apache.isis.applib.services.publishing.log.EntityChangesLogger=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.datanucleus5.persistence.IsisTransactionJdo=DEBUG",
                 "logging.level.org.apache.isis.core.runtimeservices.session.IsisInteractionFactoryDefault=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.integration.changetracking.JdoLifecycleListener=DEBUG",
@@ -58,7 +59,7 @@ implements HasPersistenceStandardJdo {
 
     @TestFactory @DisplayName("Publishing")
     List<DynamicTest> generateTests() {
-        return testFactory.generateTests(this::given, this::verify);
+        return testFactory.generateTestsIncludeProgrammatic(this::given, this::verify);
     }
 
 }
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoExecutionPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoExecutionPublishingTest.java
index 454c334..b7ff2cb 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoExecutionPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoExecutionPublishingTest.java
@@ -42,6 +42,7 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingExecutionPu
                 //XrayEnable.class
         },
         properties = {
+                "logging.level.org.apache.isis.applib.services.publishing.log.ExecutionLogger=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.datanucleus5.persistence.IsisTransactionJdo=DEBUG",
                 "logging.level.org.apache.isis.core.runtimeservices.session.IsisInteractionFactoryDefault=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.datanucleus5.datanucleus.service.JdoPersistenceLifecycleService=DEBUG"
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoPropertyPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoPropertyPublishingTest.java
index 1307f70..4a8b254 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoPropertyPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jdo/JdoPropertyPublishingTest.java
@@ -44,7 +44,7 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingEntityPrope
                 //XrayEnable.class
         },
         properties = {
-                "logging.level.org.apache.isis.applib.services.publishing.log.*=DEBUG",
+                "logging.level.org.apache.isis.applib.services.publishing.log.EntityPropertyChangeLogger=DEBUG",
                 "logging.level.org.apache.isis.testdomain.util.rest.KVStoreForTesting=DEBUG",
                 "logging.level.org.apache.isis.persistence.jdo.integration.changetracking.JdoLifecycleListener=DEBUG",
                 "logging.level.org.apache.isis.core.transaction.changetracking.EntityChangeTrackerDefault=DEBUG",
@@ -61,7 +61,7 @@ implements HasPersistenceStandardJdo {
 
     @TestFactory @DisplayName("Publishing")
     List<DynamicTest> generateTests() {
-        return testFactory.generateTests(this::given, this::verify);
+        return testFactory.generateTestsIncludeProgrammatic(this::given, this::verify);
     }
 
 }
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaCommandPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaCommandPublishingTest.java
index 0b14952..4896a04 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaCommandPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaCommandPublishingTest.java
@@ -43,6 +43,8 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingCommandPubl
         },
         properties = {
                 "logging.level.org.springframework.orm.jpa.*=DEBUG",
+                "logging.level.org.apache.isis.applib.services.publishing.log.CommandLogger=DEBUG",
+                "logging.level.org.apache.isis.testdomain.util.rest.KVStoreForTesting=DEBUG",
                 "logging.level.org.apache.isis.core.runtimeservices.session.IsisInteractionFactoryDefault=DEBUG"
         })
 @TestPropertySource({
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaEntityPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaEntityPublishingTest.java
index bb46d9f..316f42c 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaEntityPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaEntityPublishingTest.java
@@ -42,6 +42,7 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingEntityChang
                 //XrayEnable.class
         },
         properties = {
+                "logging.level.org.apache.isis.applib.services.publishing.log.EntityChangesLogger=DEBUG",
                 "logging.level.org.apache.isis.core.runtimeservices.session.IsisInteractionFactoryDefault=DEBUG",
                 "logging.level.org.apache.isis.testdomain.util.kv.KVStoreForTesting=DEBUG",
         })
@@ -56,7 +57,7 @@ implements HasPersistenceStandardJpa {
 
     @TestFactory @DisplayName("Publishing")
     List<DynamicTest> generateTests() {
-        return testFactory.generateTests(this::given, this::verify);
+        return testFactory.generateTestsIncludeProgrammatic(this::given, this::verify);
     }
 
 }
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaExecutionPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaExecutionPublishingTest.java
index 461c89d..878b289 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaExecutionPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaExecutionPublishingTest.java
@@ -42,6 +42,7 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingExecutionPu
                 //XrayEnable.class
         },
         properties = {
+                "logging.level.org.apache.isis.applib.services.publishing.log.ExecutionLogger=DEBUG",
                 "logging.level.org.apache.isis.core.runtimeservices.session.IsisInteractionFactoryDefault=DEBUG",
         })
 @TestPropertySource({
diff --git a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaPropertyPublishingTest.java b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaPropertyPublishingTest.java
index e154023..5b380a3 100644
--- a/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaPropertyPublishingTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/isis/testdomain/publishing/jpa/JpaPropertyPublishingTest.java
@@ -44,8 +44,8 @@ import org.apache.isis.testdomain.publishing.conf.Configuration_usingEntityPrope
                 //XrayEnable.class
         },
         properties = {
+                "logging.level.org.apache.isis.applib.services.publishing.log.EntityPropertyChangeLogger=DEBUG",
                 "logging.level.org.springframework.orm.jpa.*=DEBUG",
-                "logging.level.org.apache.isis.applib.services.publishing.log.*=DEBUG",
                 "logging.level.org.apache.isis.testdomain.util.rest.KVStoreForTesting=DEBUG",
                 "logging.level.org.apache.isis.core.transaction.changetracking.EntityChangeTrackerDefault=DEBUG",
         })
@@ -61,7 +61,7 @@ implements HasPersistenceStandardJpa {
 
     @TestFactory @DisplayName("Publishing")
     List<DynamicTest> generateTests() {
-        return testFactory.generateTests(this::given, this::verify);
+        return testFactory.generateTestsIncludeProgrammatic(this::given, this::verify);
     }
 
 }
diff --git a/regressiontests/stable/src/main/java/org/apache/isis/testdomain/publishing/PublishingTestFactoryAbstract.java b/regressiontests/stable/src/main/java/org/apache/isis/testdomain/publishing/PublishingTestFactoryAbstract.java
index 83c7e2e..ba1683d 100644
--- a/regressiontests/stable/src/main/java/org/apache/isis/testdomain/publishing/PublishingTestFactoryAbstract.java
+++ b/regressiontests/stable/src/main/java/org/apache/isis/testdomain/publishing/PublishingTestFactoryAbstract.java
@@ -180,18 +180,25 @@ public abstract class PublishingTestFactoryAbstract {
 
     // -- CREATE DYNAMIC TESTS
 
+    public final List<DynamicTest> generateTestsIncludeProgrammatic(
+            final Runnable given,
+            final Consumer<VerificationStage> verifier) {
+        return generateTests(true, given, verifier);
+    }
+
     public final List<DynamicTest> generateTests(
             final Runnable given,
             final Consumer<VerificationStage> verifier) {
+        return generateTests(false, given, verifier);
+    }
 
-        _Probe.errOut("GENERATE TESTS");
+    private final List<DynamicTest> generateTests(
+            final boolean includeProgrammatic,
+            final Runnable given,
+            final Consumer<VerificationStage> verifier) {
 
-        val dynamicTests = Can.<DynamicTest>of(
+        var dynamicTests = Can.<DynamicTest>of(
 
-                publishingTest("Programmatic Execution",
-                        PublishingTestContext.of(given, verifier, VerificationStage.POST_COMMIT_WHEN_PROGRAMMATIC),
-                        VerificationStage.POST_INTERACTION_WHEN_PROGRAMMATIC,
-                        this::programmaticExecution),
                 publishingTest("Interaction Api Execution",
                         PublishingTestContext.of(given, verifier, VerificationStage.POST_COMMIT),
                         VerificationStage.POST_INTERACTION,
@@ -200,20 +207,29 @@ public abstract class PublishingTestFactoryAbstract {
                         PublishingTestContext.of(given, verifier, VerificationStage.POST_COMMIT),
                         VerificationStage.POST_INTERACTION,
                         this::wrapperSyncExecutionNoRules),
-                publishingTest("Wrapper Sync Execution w/ Rules (expected to fail w/ DisabledException)",
-                        PublishingTestContext.of(given, verifier, VerificationStage.FAILURE_CASE),
-                        VerificationStage.POST_INTERACTION,
-                        this::wrapperSyncExecutionWithFailure),
                 publishingTest("Wrapper Async Execution w/o Rules",
                         PublishingTestContext.of(given, verifier, VerificationStage.POST_COMMIT),
                         VerificationStage.POST_INTERACTION,
                         this::wrapperAsyncExecutionNoRules),
+                publishingTest("Wrapper Sync Execution w/ Rules (expected to fail w/ DisabledException)",
+                        PublishingTestContext.of(given, verifier, VerificationStage.FAILURE_CASE),
+                        VerificationStage.POST_INTERACTION,
+                        this::wrapperSyncExecutionWithFailure),
                 publishingTest("Wrapper Async Execution w/ Rules (expected to fail w/ DisabledException)",
                         PublishingTestContext.of(given, verifier, VerificationStage.FAILURE_CASE),
                         VerificationStage.POST_INTERACTION,
                         this::wrapperAsyncExecutionWithFailure)
                 );
 
+        if(includeProgrammatic) {
+            // prepend
+            dynamicTests = dynamicTests.add(0,
+                publishingTest("Programmatic Execution",
+                        PublishingTestContext.of(given, verifier, VerificationStage.POST_COMMIT_WHEN_PROGRAMMATIC),
+                        VerificationStage.POST_INTERACTION_WHEN_PROGRAMMATIC,
+                        this::programmaticExecution));
+        }
+
         return XrayUi.isXrayEnabled()
                 ? dynamicTests
                         .add(dynamicTest("wait for xray viewer", XrayUi::waitForShutdown))