You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2026/06/07 19:36:20 UTC
(causeway) 04/10: CAUSEWAY-4015: moves command logging events to applib
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-4019
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 6eea7c46801988cca144e17ae6c58017b4461a7f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jun 7 17:04:48 2026 +0100
CAUSEWAY-4015: moves command logging events to applib
---
.../services/command/PauseCommandLoggingEvent.java | 15 +++++----
.../command/ResumeCommandLoggingEvent.java | 11 +++---
.../subscriber/CommandLogPauseStateListener.java | 24 ++++---------
.../integtest/CommandLog_IntegTestAbstract.java | 39 +++++-----------------
.../.openspec.yaml | 0
.../design.md | 0
.../proposal.md | 0
.../specs/command-recording-suppression/spec.md | 0
.../tasks.md | 28 ++++++++--------
.../specs/command-recording-suppression/spec.md | 24 +++++++------
.../InitialFixtureScriptsInstalledEvent.java | 34 -------------------
.../InitialFixtureScriptsInstallingEvent.java | 34 -------------------
.../services/InitialFixtureScriptsInstaller.java | 8 ++---
.../InitialFixtureScriptsInstaller_Test.java | 12 +++----
14 files changed, 65 insertions(+), 164 deletions(-)
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/events/PauseLoggingEvent.java b/api/applib/src/main/java/org/apache/causeway/applib/services/command/PauseCommandLoggingEvent.java
similarity index 61%
rename from extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/events/PauseLoggingEvent.java
rename to api/applib/src/main/java/org/apache/causeway/applib/services/command/PauseCommandLoggingEvent.java
index b297a8590c2..ab3b72b42a2 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/events/PauseLoggingEvent.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/services/command/PauseCommandLoggingEvent.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.causeway.extensions.commandlog.applib.events;
+package org.apache.causeway.applib.services.command;
import org.apache.causeway.applib.events.EventObjectBase;
@@ -24,17 +24,18 @@
* Pauses command-log persistence for a scoped operation.
*
* <p>
- * Subscribers in the command-log module use this event to temporarily ignore command lifecycle notifications without
- * disabling command publishing itself.
- * Every pause event should be paired with a {@link ResumeLoggingEvent}, preferably from a {@code finally} block.
- * Nested pauses are supported, so command logging resumes only after all active pauses have been resumed.
+ * Command logging implementations can subscribe to this event to temporarily ignore command lifecycle notifications
+ * without disabling command publishing itself.
+ * Every pause event should be paired with a {@link ResumeCommandLoggingEvent}, preferably from a {@code finally} block.
+ * Nested pauses are supported by command logging implementations that track pause depth, so command logging resumes
+ * only after all active pauses have been resumed.
* </p>
*
* @since 3.x {@index}
*/
-public class PauseLoggingEvent extends EventObjectBase<Object> {
+public class PauseCommandLoggingEvent extends EventObjectBase<Object> {
- public PauseLoggingEvent(final Object source) {
+ public PauseCommandLoggingEvent(final Object source) {
super(source);
}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/events/ResumeLoggingEvent.java b/api/applib/src/main/java/org/apache/causeway/applib/services/command/ResumeCommandLoggingEvent.java
similarity index 71%
rename from extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/events/ResumeLoggingEvent.java
rename to api/applib/src/main/java/org/apache/causeway/applib/services/command/ResumeCommandLoggingEvent.java
index d555494f1f3..c8cef89f5c2 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/events/ResumeLoggingEvent.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/services/command/ResumeCommandLoggingEvent.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.causeway.extensions.commandlog.applib.events;
+package org.apache.causeway.applib.services.command;
import org.apache.causeway.applib.events.EventObjectBase;
@@ -24,15 +24,16 @@
* Resumes command-log persistence after a scoped pause.
*
* <p>
- * This event should be posted for each matching {@link PauseLoggingEvent}.
- * The command-log module tolerates unmatched resume events and never lets its pause depth become negative.
+ * This event should be posted for each matching {@link PauseCommandLoggingEvent}.
+ * Command logging implementations that track pause depth should tolerate unmatched resume events and never let pause
+ * depth become negative.
* </p>
*
* @since 3.x {@index}
*/
-public class ResumeLoggingEvent extends EventObjectBase<Object> {
+public class ResumeCommandLoggingEvent extends EventObjectBase<Object> {
- public ResumeLoggingEvent(final Object source) {
+ public ResumeCommandLoggingEvent(final Object source) {
super(source);
}
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/subscriber/CommandLogPauseStateListener.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/subscriber/CommandLogPauseStateListener.java
index 92a2cd02178..38e74850726 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/subscriber/CommandLogPauseStateListener.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/subscriber/CommandLogPauseStateListener.java
@@ -26,11 +26,9 @@
import org.springframework.stereotype.Service;
import org.apache.causeway.applib.annotation.PriorityPrecedence;
+import org.apache.causeway.applib.services.command.PauseCommandLoggingEvent;
+import org.apache.causeway.applib.services.command.ResumeCommandLoggingEvent;
import org.apache.causeway.extensions.commandlog.applib.CausewayModuleExtCommandLogApplib;
-import org.apache.causeway.extensions.commandlog.applib.events.PauseLoggingEvent;
-import org.apache.causeway.extensions.commandlog.applib.events.ResumeLoggingEvent;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstalledEvent;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstallingEvent;
import lombok.RequiredArgsConstructor;
@@ -47,23 +45,13 @@ public class CommandLogPauseStateListener {
private final CommandLogPauseState commandLogPauseState;
- @EventListener(PauseLoggingEvent.class)
- public void onPauseLoggingEvent(final PauseLoggingEvent event) {
+ @EventListener(PauseCommandLoggingEvent.class)
+ public void onPauseCommandLoggingEvent(final PauseCommandLoggingEvent event) {
commandLogPauseState.pause();
}
- @EventListener(ResumeLoggingEvent.class)
- public void onResumeLoggingEvent(final ResumeLoggingEvent event) {
- commandLogPauseState.resume();
- }
-
- @EventListener(InitialFixtureScriptsInstallingEvent.class)
- public void onInitialFixtureScriptsInstallingEvent(final InitialFixtureScriptsInstallingEvent event) {
- commandLogPauseState.pause();
- }
-
- @EventListener(InitialFixtureScriptsInstalledEvent.class)
- public void onInitialFixtureScriptsInstalledEvent(final InitialFixtureScriptsInstalledEvent event) {
+ @EventListener(ResumeCommandLoggingEvent.class)
+ public void onResumeCommandLoggingEvent(final ResumeCommandLoggingEvent event) {
commandLogPauseState.resume();
}
diff --git a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java
index 0f017b7c6c4..3cd9953acaf 100644
--- a/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java
+++ b/extensions/core/commandlog/applib/src/test/java/org/apache/causeway/extensions/commandlog/applib/integtest/CommandLog_IntegTestAbstract.java
@@ -48,11 +48,9 @@
import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
import org.apache.causeway.extensions.commandlog.applib.dom.CommandReplayResultMappingRepository;
import org.apache.causeway.extensions.commandlog.applib.dom.ReplayState;
-import org.apache.causeway.extensions.commandlog.applib.events.PauseLoggingEvent;
-import org.apache.causeway.extensions.commandlog.applib.events.ResumeLoggingEvent;
+import org.apache.causeway.applib.services.command.PauseCommandLoggingEvent;
+import org.apache.causeway.applib.services.command.ResumeCommandLoggingEvent;
import org.apache.causeway.extensions.commandlog.applib.spi.CommandReplayMappingListenerPersistent;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstalledEvent;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstallingEvent;
import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.RecordingSupport;
import org.apache.causeway.core.config.CausewayConfiguration.Extensions.CommandLog.ReplayResultMapping.OnConflictPolicy;
import org.apache.causeway.extensions.commandlog.applib.integtest.model.Counter;
@@ -328,7 +326,7 @@ void safe_action_command_publishing_logs_null_list_and_scalar_results() {
void paused_command_logging_suppresses_commands_until_resumed() {
// given
- eventBusService.post(new PauseLoggingEvent(this));
+ eventBusService.post(new PauseCommandLoggingEvent(this));
// when
wrapperFactory.wrap(counter1).bumpUsingDeclaredAction();
@@ -338,7 +336,7 @@ void paused_command_logging_suppresses_commands_until_resumed() {
assertThat(commandLogEntryRepository.findAll()).isEmpty();
// and when
- eventBusService.post(new ResumeLoggingEvent(this));
+ eventBusService.post(new ResumeCommandLoggingEvent(this));
wrapperFactory.wrap(counter1).bumpUsingDeclaredAction();
interactionService.nextInteraction();
@@ -350,11 +348,11 @@ void paused_command_logging_suppresses_commands_until_resumed() {
void nested_paused_command_logging_requires_matching_resumes() {
// given
- eventBusService.post(new PauseLoggingEvent(this));
- eventBusService.post(new PauseLoggingEvent(this));
+ eventBusService.post(new PauseCommandLoggingEvent(this));
+ eventBusService.post(new PauseCommandLoggingEvent(this));
// when
- eventBusService.post(new ResumeLoggingEvent(this));
+ eventBusService.post(new ResumeCommandLoggingEvent(this));
wrapperFactory.wrap(counter1).bumpUsingDeclaredAction();
interactionService.nextInteraction();
@@ -362,7 +360,7 @@ void nested_paused_command_logging_requires_matching_resumes() {
assertThat(commandLogEntryRepository.findAll()).isEmpty();
// and when
- eventBusService.post(new ResumeLoggingEvent(this));
+ eventBusService.post(new ResumeCommandLoggingEvent(this));
wrapperFactory.wrap(counter1).bumpUsingDeclaredAction();
interactionService.nextInteraction();
@@ -370,27 +368,6 @@ void nested_paused_command_logging_requires_matching_resumes() {
assertThat(commandLogEntryRepository.findAll()).hasSize(1);
}
- @Test
- void initial_fixture_script_events_suppress_command_logging_until_installed_event() {
-
- // given
- eventBusService.post(new InitialFixtureScriptsInstallingEvent(this));
-
- // when
- wrapperFactory.wrap(counter1).bumpUsingDeclaredAction();
- interactionService.nextInteraction();
-
- // then
- assertThat(commandLogEntryRepository.findAll()).isEmpty();
-
- // and when
- eventBusService.post(new InitialFixtureScriptsInstalledEvent(this));
- wrapperFactory.wrap(counter1).bumpUsingDeclaredAction();
- interactionService.nextInteraction();
-
- // then
- assertThat(commandLogEntryRepository.findAll()).hasSize(1);
- }
@Test
void edit() {
diff --git a/openspec/changes/move-command-logging-events-to-applib/.openspec.yaml b/openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/.openspec.yaml
similarity index 100%
rename from openspec/changes/move-command-logging-events-to-applib/.openspec.yaml
rename to openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/.openspec.yaml
diff --git a/openspec/changes/move-command-logging-events-to-applib/design.md b/openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/design.md
similarity index 100%
rename from openspec/changes/move-command-logging-events-to-applib/design.md
rename to openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/design.md
diff --git a/openspec/changes/move-command-logging-events-to-applib/proposal.md b/openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/proposal.md
similarity index 100%
rename from openspec/changes/move-command-logging-events-to-applib/proposal.md
rename to openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/proposal.md
diff --git a/openspec/changes/move-command-logging-events-to-applib/specs/command-recording-suppression/spec.md b/openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/specs/command-recording-suppression/spec.md
similarity index 100%
rename from openspec/changes/move-command-logging-events-to-applib/specs/command-recording-suppression/spec.md
rename to openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/specs/command-recording-suppression/spec.md
diff --git a/openspec/changes/move-command-logging-events-to-applib/tasks.md b/openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/tasks.md
similarity index 55%
rename from openspec/changes/move-command-logging-events-to-applib/tasks.md
rename to openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/tasks.md
index a079b546cf9..1795be97682 100644
--- a/openspec/changes/move-command-logging-events-to-applib/tasks.md
+++ b/openspec/changes/archive/2026-06-07-move-command-logging-events-to-applib/tasks.md
@@ -1,25 +1,25 @@
## 1. Core Applib Events
-- [ ] 1.1 Add `PauseCommandLoggingEvent` to core applib under the command service API package with JavaDoc describing scoped command-log persistence suppression.
-- [ ] 1.2 Add `ResumeCommandLoggingEvent` to core applib under the command service API package with JavaDoc describing matching resume behavior and nested pause semantics.
-- [ ] 1.3 Remove the command-log applib `PauseLoggingEvent` and `ResumeLoggingEvent` classes.
+- [x] 1.1 Add `PauseCommandLoggingEvent` to core applib under the command service API package with JavaDoc describing scoped command-log persistence suppression.
+- [x] 1.2 Add `ResumeCommandLoggingEvent` to core applib under the command service API package with JavaDoc describing matching resume behavior and nested pause semantics.
+- [x] 1.3 Remove the command-log applib `PauseLoggingEvent` and `ResumeLoggingEvent` classes.
## 2. Command Log Listener Simplification
-- [ ] 2.1 Update `CommandLogPauseStateListener` to import and listen for the core applib `PauseCommandLoggingEvent` and `ResumeCommandLoggingEvent` classes.
-- [ ] 2.2 Remove listener methods and imports for fixture-specific initial fixture installing and installed events.
-- [ ] 2.3 Verify `CommandLogPauseState` and `CommandSubscriberForCommandLog` continue to use the existing depth-counted pause state behavior.
+- [x] 2.1 Update `CommandLogPauseStateListener` to import and listen for the core applib `PauseCommandLoggingEvent` and `ResumeCommandLoggingEvent` classes.
+- [x] 2.2 Remove listener methods and imports for fixture-specific initial fixture installing and installed events.
+- [x] 2.3 Verify `CommandLogPauseState` and `CommandSubscriberForCommandLog` continue to use the existing depth-counted pause state behavior.
## 3. Fixture Script Integration
-- [ ] 3.1 Update `InitialFixtureScriptsInstaller` to publish `PauseCommandLoggingEvent` before invoking the configured initial fixture script.
-- [ ] 3.2 Update `InitialFixtureScriptsInstaller` to publish `ResumeCommandLoggingEvent` in the existing `finally` path.
-- [ ] 3.3 Remove fixture-specific `InitialFixtureScriptsInstallingEvent` and `InitialFixtureScriptsInstalledEvent` classes.
-- [ ] 3.4 Ensure testing fixtures applib depends only on core applib for command logging pause and resume events, not on command-log applib.
+- [x] 3.1 Update `InitialFixtureScriptsInstaller` to publish `PauseCommandLoggingEvent` before invoking the configured initial fixture script.
+- [x] 3.2 Update `InitialFixtureScriptsInstaller` to publish `ResumeCommandLoggingEvent` in the existing `finally` path.
+- [x] 3.3 Remove fixture-specific `InitialFixtureScriptsInstallingEvent` and `InitialFixtureScriptsInstalledEvent` classes.
+- [x] 3.4 Ensure testing fixtures applib depends only on core applib for command logging pause and resume events, not on command-log applib.
## 4. Tests and Verification
-- [ ] 4.1 Update command-log integration tests to use `PauseCommandLoggingEvent` and `ResumeCommandLoggingEvent`.
-- [ ] 4.2 Update initial fixture installer tests to verify direct publication of the core applib pause and resume command logging events.
-- [ ] 4.3 Run focused tests for testing fixtures applib and command-log persistence that cover pause/resume and initial fixture installation.
-- [ ] 4.4 Run `openspec validate move-command-logging-events-to-applib --strict` and fix any proposal/spec/task issues.
+- [x] 4.1 Update command-log integration tests to use `PauseCommandLoggingEvent` and `ResumeCommandLoggingEvent`.
+- [x] 4.2 Update initial fixture installer tests to verify direct publication of the core applib pause and resume command logging events.
+- [x] 4.3 Run focused tests for testing fixtures applib and command-log persistence that cover pause/resume and initial fixture installation.
+- [x] 4.4 Run `openspec validate move-command-logging-events-to-applib --strict` and fix any proposal/spec/task issues.
diff --git a/openspec/specs/command-recording-suppression/spec.md b/openspec/specs/command-recording-suppression/spec.md
index fa565a2706f..329615e5166 100644
--- a/openspec/specs/command-recording-suppression/spec.md
+++ b/openspec/specs/command-recording-suppression/spec.md
@@ -57,8 +57,9 @@ When a user interacts with these marked helper objects during a recording sessio
- **THEN** the system does not persist a command log entry for that helper action solely through recording support
### Requirement: Command log persistence can be paused and resumed
-The system SHALL provide an application-event based mechanism to pause command log persistence.
-The system SHALL provide an application-event based mechanism to resume command log persistence after a previous pause.
+The system SHALL provide `PauseCommandLoggingEvent` in core applib as an application-event based mechanism to pause command log persistence.
+The system SHALL provide `ResumeCommandLoggingEvent` in core applib as an application-event based mechanism to resume command log persistence after a previous pause.
+Command logging implementations SHALL listen for the core applib pause and resume events without requiring event publishers to depend on a command logging implementation module.
While command log persistence is paused, the command-log subscriber MUST NOT create new command log entries for published commands.
While command log persistence is paused, the command-log subscriber MUST NOT sync existing command log entries for published command lifecycle updates.
After command log persistence is resumed, subsequent eligible commands MUST remain persistable by the normal command-log subscriber flow.
@@ -66,35 +67,36 @@ Nested pause scopes MUST NOT resume command log persistence until each active pa
#### Scenario: Paused logging skips command entry creation
- **GIVEN** command-log persistence is enabled
-- **AND** command log persistence has been paused
+- **AND** command log persistence has been paused by publishing `PauseCommandLoggingEvent`
- **WHEN** a command reaches the ready notification
- **THEN** the system does not create a command log entry for that command
#### Scenario: Paused logging skips command entry synchronization
- **GIVEN** command-log persistence is enabled
-- **AND** command log persistence has been paused
+- **AND** command log persistence has been paused by publishing `PauseCommandLoggingEvent`
- **WHEN** a command reaches the started or completed notification
- **THEN** the system does not sync a command log entry for that command notification
#### Scenario: Resumed logging restores normal persistence
- **GIVEN** command-log persistence is enabled
-- **AND** command log persistence was paused and has then been resumed
+- **AND** command log persistence was paused by publishing `PauseCommandLoggingEvent` and has then been resumed by publishing `ResumeCommandLoggingEvent`
- **WHEN** a subsequent eligible command reaches the ready notification
- **THEN** the system can create a command log entry for that command through the normal command-log subscriber flow
#### Scenario: Nested pause requires matching resumes
- **GIVEN** command-log persistence is enabled
-- **AND** command log persistence has been paused twice
-- **WHEN** command log persistence is resumed once
+- **AND** command log persistence has been paused twice by publishing `PauseCommandLoggingEvent` twice
+- **WHEN** command log persistence is resumed once by publishing `ResumeCommandLoggingEvent` once
- **THEN** command log persistence remains paused
-- **WHEN** command log persistence is resumed a second time
+- **WHEN** command log persistence is resumed a second time by publishing `ResumeCommandLoggingEvent` a second time
- **THEN** subsequent eligible commands can be persisted through the normal command-log subscriber flow
### Requirement: Initial fixture script commands are not logged
-The system SHALL pause command log persistence while a configured initial fixture script is being installed during application startup.
-The system MUST resume command log persistence after the initial fixture script installation completes.
-The system MUST resume command log persistence if the initial fixture script installation fails.
+The system SHALL publish the core applib `PauseCommandLoggingEvent` while a configured initial fixture script is being installed during application startup.
+The system MUST publish the core applib `ResumeCommandLoggingEvent` after the initial fixture script installation completes.
+The system MUST publish the core applib `ResumeCommandLoggingEvent` if the initial fixture script installation fails.
The pause MUST apply only to command-log persistence and MUST NOT prevent the fixture script from executing its domain logic normally.
+The initial fixture script installation path MUST NOT require a dependency from testing fixtures applib to command-log applib.
#### Scenario: Initial fixture script commands are suppressed
- **GIVEN** command-log persistence is enabled
diff --git a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/events/InitialFixtureScriptsInstalledEvent.java b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/events/InitialFixtureScriptsInstalledEvent.java
deleted file mode 100644
index 5e2df57dd65..00000000000
--- a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/events/InitialFixtureScriptsInstalledEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.causeway.testing.fixtures.applib.events;
-
-import org.apache.causeway.applib.events.EventObjectBase;
-
-/**
- * Posted immediately after the configured initial fixture script installation scope exits.
- *
- * @since 3.x {@index}
- */
-public class InitialFixtureScriptsInstalledEvent extends EventObjectBase<Object> {
-
- public InitialFixtureScriptsInstalledEvent(final Object source) {
- super(source);
- }
-
-}
diff --git a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/events/InitialFixtureScriptsInstallingEvent.java b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/events/InitialFixtureScriptsInstallingEvent.java
deleted file mode 100644
index e0099ad36a2..00000000000
--- a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/events/InitialFixtureScriptsInstallingEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.causeway.testing.fixtures.applib.events;
-
-import org.apache.causeway.applib.events.EventObjectBase;
-
-/**
- * Posted immediately before the configured initial fixture script is installed.
- *
- * @since 3.x {@index}
- */
-public class InitialFixtureScriptsInstallingEvent extends EventObjectBase<Object> {
-
- public InitialFixtureScriptsInstallingEvent(final Object source) {
- super(source);
- }
-
-}
diff --git a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller.java b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller.java
index 14def162421..091d6f7e343 100644
--- a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller.java
+++ b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller.java
@@ -31,10 +31,10 @@
import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.applib.events.metamodel.MetamodelEvent;
+import org.apache.causeway.applib.services.command.PauseCommandLoggingEvent;
+import org.apache.causeway.applib.services.command.ResumeCommandLoggingEvent;
import org.apache.causeway.applib.services.eventbus.EventBusService;
import org.apache.causeway.core.config.CausewayConfiguration;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstalledEvent;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstallingEvent;
import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScript;
import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScripts;
@@ -86,10 +86,10 @@ public void onMetamodelEvent(final MetamodelEvent event) {
log.info("install initial fixtures from script {}", initialFixtureScript.getFriendlyName());
try {
- eventBusService.post(new InitialFixtureScriptsInstallingEvent(this));
+ eventBusService.post(new PauseCommandLoggingEvent(this));
fixtureScripts.run(initialFixtureScript);
} finally {
- eventBusService.post(new InitialFixtureScriptsInstalledEvent(this));
+ eventBusService.post(new ResumeCommandLoggingEvent(this));
}
}
}
diff --git a/testing/fixtures/applib/src/test/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller_Test.java b/testing/fixtures/applib/src/test/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller_Test.java
index d7c8eb49f22..906698d2dfd 100644
--- a/testing/fixtures/applib/src/test/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller_Test.java
+++ b/testing/fixtures/applib/src/test/java/org/apache/causeway/testing/fixtures/applib/services/InitialFixtureScriptsInstaller_Test.java
@@ -34,8 +34,8 @@
import org.apache.causeway.applib.events.metamodel.MetamodelEvent;
import org.apache.causeway.applib.services.eventbus.EventBusService;
import org.apache.causeway.core.config.CausewayConfiguration;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstalledEvent;
-import org.apache.causeway.testing.fixtures.applib.events.InitialFixtureScriptsInstallingEvent;
+import org.apache.causeway.applib.services.command.ResumeCommandLoggingEvent;
+import org.apache.causeway.applib.services.command.PauseCommandLoggingEvent;
import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScript;
import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScripts;
@@ -54,9 +54,9 @@ void posts_initial_fixture_events_around_initial_script() {
installer.onMetamodelEvent(MetamodelEvent.AFTER_METAMODEL_LOADED);
InOrder inOrder = inOrder(eventBusService, fixtureScripts);
- inOrder.verify(eventBusService).post(any(InitialFixtureScriptsInstallingEvent.class));
+ inOrder.verify(eventBusService).post(any(PauseCommandLoggingEvent.class));
inOrder.verify(fixtureScripts).run(any(TestFixtureScript.class));
- inOrder.verify(eventBusService).post(any(InitialFixtureScriptsInstalledEvent.class));
+ inOrder.verify(eventBusService).post(any(ResumeCommandLoggingEvent.class));
verifyNoMoreInteractions(eventBusService);
}
@@ -77,8 +77,8 @@ void posts_initial_fixture_installed_event_when_initial_script_fails() {
// expected
}
- verify(eventBusService).post(any(InitialFixtureScriptsInstallingEvent.class));
- verify(eventBusService).post(any(InitialFixtureScriptsInstalledEvent.class));
+ verify(eventBusService).post(any(PauseCommandLoggingEvent.class));
+ verify(eventBusService).post(any(ResumeCommandLoggingEvent.class));
}
public static class TestFixtureScript extends FixtureScript {