feat(GWC-37,WRK-32): refresh live alarm watch lists
ci / nightly-windev (push) Has been skipped
ci / windows-x86 (push) Failing after 51s
ci / java (push) Successful in 2m8s
ci / portable (push) Failing after 1h1m54s

This commit is contained in:
Joseph Doherty
2026-08-25 11:46:07 -04:00
parent 1b11e89f29
commit 484028e721
22 changed files with 3961 additions and 1858 deletions
@@ -91,6 +91,27 @@ public sealed class AlarmCommandExecutorTests
Assert.Equal(ProtocolStatusCode.InvalidRequest, reply.ProtocolStatus.Code);
}
/// <summary>Verifies that a live watch-list replacement routes to the alarm handler on the executor thread.</summary>
[Fact]
public void UpdateAlarmWatchList_WithHandler_RoutesToHandlerAndReturnsOk()
{
FakeAlarmHandler handler = new FakeAlarmHandler();
MxAccessCommandExecutor executor = NewExecutor(handler);
var target = new AlarmSubtagTarget { AlarmFullReference = "Galaxy!Area.Tank01.Alarm" };
MxCommandReply reply = executor.Execute(new StaCommand(
SessionId,
CorrelationId,
new MxCommand
{
Kind = MxCommandKind.UpdateAlarmWatchList,
UpdateAlarmWatchList = new UpdateAlarmWatchListCommand { WatchList = { target } },
}));
Assert.Equal(ProtocolStatusCode.Ok, reply.ProtocolStatus.Code);
Assert.Equal(target, Assert.Single(handler.LastWatchList!));
}
/// <summary>Verifies that acknowledge routes native status into hresult and payload.</summary>
[Fact]
public void AcknowledgeAlarm_WithHandler_RoutesNativeStatusIntoHresultAndPayload()
@@ -447,6 +468,15 @@ public sealed class AlarmCommandExecutorTests
LastSessionId = sessionId;
}
/// <summary>Gets the most recent replacement watch list.</summary>
public IReadOnlyList<AlarmSubtagTarget>? LastWatchList { get; private set; }
/// <inheritdoc />
public void UpdateWatchList(IReadOnlyList<AlarmSubtagTarget> watchList)
{
LastWatchList = watchList;
}
/// <inheritdoc />
public void Unsubscribe()
{