You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2022/08/02 17:26:03 UTC
[isis] branch ISIS-3108 updated (1484299e64 -> 3807ee7d4d)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch ISIS-3108
in repository https://gitbox.apache.org/repos/asf/isis.git
discard 1484299e64 ISIS-3108: fixing unit tests
discard 7d2d74efbd ISIS-3108: fixing unit tests
discard 25fa967303 ISIS-3108: makes EntityPublishingChangeFacet explicit
add 810e78e701 ISIS-3105: ZoneOffset.UTC and ZoneId.of("UTC") result in different output format;
add 738632b133 ISIS-3108: makes EntityPublishingChangeFacet explicit
add 77330c42ba ISIS-3108: fixing unit tests
add c68e9d0b78 ISIS-3108: fixing unit tests
add 6f043889d5 ISIS-3108: updates regression test
add 378ced296b Merge branch 'ISIS-3108'
new 3807ee7d4d ISIS-3108: removes special case processing, we now always install the facet
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (1484299e64)
\
N -- N -- N refs/heads/ISIS-3108 (3807ee7d4d)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../value/semantics/ValueSemanticsAbstract.java | 17 +++------------
.../isis/commons/internal/base/_Temporals.java | 23 +++++++++++++++++----
.../isis/commons/internal/base/TemporalsTest.java | 21 ++++++++++++++++++-
.../DomainObjectAnnotationFacetFactory.java | 10 ---------
.../applib/dom/CommandLogEntryRepository.java | 7 +++++--
.../applib/dom/ExecutionLogEntryRepository.java | 4 ++++
.../applib/dom/ExecutionOutboxEntryRepository.java | 4 ++++
.../applib/dom/AuditTrailEntryRepository.java | 9 ++++++--
.../CmdExecAuditSessLog_IntegTestAbstract.java | 24 ++++++++++++++++++++++
.../src/test/resources/application-test.yml | 5 +++++
.../domainmodel/MetaModelRegressionTest.java | 2 ++
11 files changed, 93 insertions(+), 33 deletions(-)
[isis] 01/01: ISIS-3108: removes special case processing, we now always install the facet
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch ISIS-3108
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 3807ee7d4df0716481f1c6b795048bc892fadda3
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Aug 2 18:25:43 2022 +0100
ISIS-3108: removes special case processing, we now always install the facet
---
.../DomainObjectAnnotationFacetFactory.java | 10 ---------
.../applib/dom/CommandLogEntryRepository.java | 7 +++++--
.../applib/dom/ExecutionLogEntryRepository.java | 4 ++++
.../applib/dom/ExecutionOutboxEntryRepository.java | 4 ++++
.../applib/dom/AuditTrailEntryRepository.java | 9 ++++++--
.../CmdExecAuditSessLog_IntegTestAbstract.java | 24 ++++++++++++++++++++++
.../src/test/resources/application-test.yml | 5 +++++
7 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
index 47eefe9b48..41252a92b0 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/domainobject/DomainObjectAnnotationFacetFactory.java
@@ -198,16 +198,6 @@ implements
val cls = processClassContext.getCls();
val facetHolder = processClassContext.getFacetHolder();
- //
- // this rule originally implemented only in AuditableFacetFromConfigurationFactory
- // but think should apply in general
- //
- if(HasInteractionId.class.isAssignableFrom(cls)) {
- // do not install on any implementation of HasInteractionId
- // (ie commands, audit entries, published events).
- return;
- }
-
// check for @DomainObject(entityChangePublishing=....)
val entityChangePublishing = domainObjectIfAny
.map(DomainObject::entityChangePublishing);
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/isis/extensions/commandlog/applib/dom/CommandLogEntryRepository.java b/extensions/core/commandlog/applib/src/main/java/org/apache/isis/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
index 4a972911f6..fbc603c489 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/isis/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/isis/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
@@ -53,8 +53,6 @@ import lombok.val;
public abstract class CommandLogEntryRepository<C extends CommandLogEntry> {
-
-
public static class NotFoundException extends RecoverableException {
private static final long serialVersionUID = 1L;
@Getter
@@ -71,10 +69,15 @@ public abstract class CommandLogEntryRepository<C extends CommandLogEntry> {
private final Class<C> commandLogEntryClass;
+
protected CommandLogEntryRepository(Class<C> commandLogEntryClass) {
this.commandLogEntryClass = commandLogEntryClass;
}
+ public Class<C> getEntityClass() {
+ return commandLogEntryClass;
+ }
+
public C createEntryAndPersist(final Command command, CommandLogEntry parentEntryIfAny) {
C c = factoryService.detachedEntity(commandLogEntryClass);
c.init(command);
diff --git a/extensions/core/executionlog/applib/src/main/java/org/apache/isis/extensions/executionlog/applib/dom/ExecutionLogEntryRepository.java b/extensions/core/executionlog/applib/src/main/java/org/apache/isis/extensions/executionlog/applib/dom/ExecutionLogEntryRepository.java
index a095c8b6cc..cf72d07707 100644
--- a/extensions/core/executionlog/applib/src/main/java/org/apache/isis/extensions/executionlog/applib/dom/ExecutionLogEntryRepository.java
+++ b/extensions/core/executionlog/applib/src/main/java/org/apache/isis/extensions/executionlog/applib/dom/ExecutionLogEntryRepository.java
@@ -62,6 +62,10 @@ public abstract class ExecutionLogEntryRepository<E extends ExecutionLogEntry> {
this.executionLogEntryClass = executionLogEntryClass;
}
+ public Class<E> getEntityClass() {
+ return executionLogEntryClass;
+ }
+
/**
* for testing only.
diff --git a/extensions/core/executionoutbox/applib/src/main/java/org/apache/isis/extensions/executionoutbox/applib/dom/ExecutionOutboxEntryRepository.java b/extensions/core/executionoutbox/applib/src/main/java/org/apache/isis/extensions/executionoutbox/applib/dom/ExecutionOutboxEntryRepository.java
index 203cc8e49c..17169503f3 100644
--- a/extensions/core/executionoutbox/applib/src/main/java/org/apache/isis/extensions/executionoutbox/applib/dom/ExecutionOutboxEntryRepository.java
+++ b/extensions/core/executionoutbox/applib/src/main/java/org/apache/isis/extensions/executionoutbox/applib/dom/ExecutionOutboxEntryRepository.java
@@ -68,6 +68,10 @@ public abstract class ExecutionOutboxEntryRepository<E extends ExecutionOutboxEn
this.executionOutboxEntryClass = executionOutboxEntryClass;
}
+ public Class<E> getEntityClass() {
+ return executionOutboxEntryClass;
+ }
+
/**
* for testing only.
diff --git a/extensions/security/audittrail/applib/src/main/java/org/apache/isis/extensions/audittrail/applib/dom/AuditTrailEntryRepository.java b/extensions/security/audittrail/applib/src/main/java/org/apache/isis/extensions/audittrail/applib/dom/AuditTrailEntryRepository.java
index a08ff3d9d4..7c57e09518 100644
--- a/extensions/security/audittrail/applib/src/main/java/org/apache/isis/extensions/audittrail/applib/dom/AuditTrailEntryRepository.java
+++ b/extensions/security/audittrail/applib/src/main/java/org/apache/isis/extensions/audittrail/applib/dom/AuditTrailEntryRepository.java
@@ -47,6 +47,13 @@ public abstract class AuditTrailEntryRepository<E extends AuditTrailEntry> {
private final Class<E> auditTrailEntryClass;
+ @Inject RepositoryService repositoryService;
+ @Inject FactoryService factoryService;
+
+ public Class<E> getEntityClass() {
+ return auditTrailEntryClass;
+ }
+
public AuditTrailEntry createFor(final EntityPropertyChange change) {
E entry = factoryService.detachedEntity(auditTrailEntryClass);
entry.init(change);
@@ -172,7 +179,5 @@ public abstract class AuditTrailEntryRepository<E extends AuditTrailEntry> {
repositoryService.removeAll(auditTrailEntryClass);
}
- @Inject RepositoryService repositoryService;
- @Inject FactoryService factoryService;
}
diff --git a/regressiontests/stable-cmdexecauditsess/generic/src/main/java/org/apache/isis/regressiontests/cmdexecauditsess/generic/integtest/CmdExecAuditSessLog_IntegTestAbstract.java b/regressiontests/stable-cmdexecauditsess/generic/src/main/java/org/apache/isis/regressiontests/cmdexecauditsess/generic/integtest/CmdExecAuditSessLog_IntegTestAbstract.java
index 4dcf09a926..e5b4d79780 100644
--- a/regressiontests/stable-cmdexecauditsess/generic/src/main/java/org/apache/isis/regressiontests/cmdexecauditsess/generic/integtest/CmdExecAuditSessLog_IntegTestAbstract.java
+++ b/regressiontests/stable-cmdexecauditsess/generic/src/main/java/org/apache/isis/regressiontests/cmdexecauditsess/generic/integtest/CmdExecAuditSessLog_IntegTestAbstract.java
@@ -22,6 +22,7 @@ import java.util.stream.Collectors;
import javax.inject.Inject;
+import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,6 +38,9 @@ import org.apache.isis.applib.services.sudo.SudoService;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
import org.apache.isis.core.config.beans.IsisBeanTypeRegistry;
import org.apache.isis.core.config.presets.IsisPresets;
+import org.apache.isis.core.metamodel.facets.object.publish.entitychange.EntityChangePublishingFacet;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
import org.apache.isis.extensions.audittrail.applib.dom.AuditTrailEntry;
import org.apache.isis.extensions.audittrail.applib.dom.AuditTrailEntryRepository;
import org.apache.isis.extensions.commandlog.applib.dom.CommandLogEntry;
@@ -93,6 +97,26 @@ public abstract class CmdExecAuditSessLog_IntegTestAbstract extends IsisIntegrat
protected abstract Counter newCounter(String name);
+ @Inject SpecificationLoader specificationLoader;
+
+
+ @Test
+ void check_facets() {
+ assertEntityPublishingDisabledFor(auditTrailEntryRepository.getEntityClass());
+ assertEntityPublishingDisabledFor(commandLogEntryRepository.getEntityClass());
+ assertEntityPublishingDisabledFor(executionLogEntryRepository.getEntityClass());
+ assertEntityPublishingDisabledFor(executionOutboxEntryRepository.getEntityClass());
+
+ }
+
+ private void assertEntityPublishingDisabledFor(Class<?> entityClass) {
+ val objectSpecification = specificationLoader.loadSpecification(entityClass);
+ EntityChangePublishingFacet facet = objectSpecification.getFacet(EntityChangePublishingFacet.class);
+ Assertions.assertThat(facet)
+ .satisfies(f -> assertThat(f).isNotNull())
+ .satisfies(f -> assertThat(f.isEnabled()).isFalse())
+ ;
+ }
@Test
void invoke_mixin() {
diff --git a/regressiontests/stable-cmdexecauditsess/persistence-jpa/src/test/resources/application-test.yml b/regressiontests/stable-cmdexecauditsess/persistence-jpa/src/test/resources/application-test.yml
index 98d17b83a8..67eec1b7ba 100644
--- a/regressiontests/stable-cmdexecauditsess/persistence-jpa/src/test/resources/application-test.yml
+++ b/regressiontests/stable-cmdexecauditsess/persistence-jpa/src/test/resources/application-test.yml
@@ -27,6 +27,11 @@ isis:
extensions:
session-log:
auto-logout-on-restart: false
+ core:
+ meta-model:
+ introspector:
+ mode: full
+
spring:
jpa: