36583ee6f4
Claude-Session: https://claude.ai/code/session_01GT67AD99zQQqpLCVm3p7xk
37 lines
1.6 KiB
C#
37 lines
1.6 KiB
C#
using Opc.Ua.Server;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests;
|
|
|
|
/// <summary>
|
|
/// Gitea #870: the running server's monitored-item queue factory is <see cref="RingEventQueueFactory"/> (every event
|
|
/// item's queue is a <see cref="RingEventMonitoredItemQueue"/>; the SDK's <see cref="EventQueueHandler"/> always asks
|
|
/// the server's factory), and data-change queues are still the SDK's own.
|
|
/// </summary>
|
|
// Shares a collection with the other user of OtOpcUaSdkServer.RingEventQueues (a process-wide switch the perf
|
|
// harness flips), so the wiring assertion never observes it switched off (#870 review).
|
|
[Collection(RingEventQueueSwitchCollection.Name)]
|
|
public sealed class RingEventQueueWiringTests
|
|
{
|
|
[Fact]
|
|
public async Task The_server_creates_ring_event_queues_and_sdk_data_change_queues()
|
|
{
|
|
var ct = TestContext.Current.CancellationToken;
|
|
await using var rig = await ServerEventRig.StartAsync("RingQueue870", encrypted: false, ct);
|
|
|
|
var factory = rig.Server.CurrentInstance.MonitoredItemQueueFactory.ShouldBeOfType<RingEventQueueFactory>();
|
|
factory.SupportsDurableQueues.ShouldBeFalse();
|
|
factory.CreateEventQueue(false, 1).ShouldBeOfType<RingEventMonitoredItemQueue>();
|
|
factory.CreateDataChangeQueue(false, 2).ShouldBeOfType<DataChangeMonitoredItemQueue>();
|
|
}
|
|
}
|
|
|
|
/// <summary>Serialises the tests that read or flip <c>OtOpcUaSdkServer.RingEventQueues</c>.</summary>
|
|
[CollectionDefinition(Name)]
|
|
public sealed class RingEventQueueSwitchCollection
|
|
{
|
|
/// <summary>The collection name.</summary>
|
|
public const string Name = "RingEventQueueSwitch";
|
|
}
|