Files
UA-.NETStandard/tests/Opc.Ua.Server.Tests/CoverageNodeSet/Assets/Opc.Ua.CoverageTest.NodeSet2.csv
romanett 333de8305b Add kitchen-sink coverage NodeSet2 with three load pipelines (#4251) (#4272)
# Description

Regression fence for the NodeSet2 import + code-generation surface. This
adds a single, purpose-authored "kitchen-sink" NodeSet2
(`Opc.Ua.CoverageTest.NodeSet2.xml`) plus a small dependent secondary
model that deliberately flip a broad set of the knobs defined by
`UANodeSet.xsd` (every node class, every `Definition` shape, custom
reference types, all five modelling rules, scalar/array/matrix values, a
deep branching instance tree, and a wide set of reference relations).
The same bytes are then loaded into **real** servers (`ServerFixture<T>`
+ `ReferenceServer`) through three independent pipelines and validated
node-by-node, attribute-by-attribute, reference-by-reference:

1. **Source-generation, hand-written manager** - the XML is consumed at
compile time via `<AdditionalFiles
ModelSourceGeneratorPrefix="Opc.Ua.CoverageTest">`; the generated
`AddOpcUaCoverageTest(context)` composes the predefined nodes inside a
`CustomNodeManager2`, so every node materialises as its generated
`NodeState` subclass.
2. **Runtime import** - the identical XML is imported at startup through
`RuntimeNodeSetNodeManagerFactory` / `AddRuntimeNodeSet`.
3. **Source-generation, generated fluent manager** - a
`[NodeManager]`-attributed partial makes the generator emit the whole
`FluentNodeManagerBase` manager, factory and typed fluent-builder
surface.

A shared, data-driven `[TestCaseSource]` battery runs the identical
assertions against all three servers, and a cross-pipeline equivalence
fixture asserts the three address spaces agree. A dependent **second
namespace** (`.../Secondary/`) exercises cross-namespace
`HasTypeDefinition`, `HasSubtype` and `HasComponent` references in every
pipeline.

Authoring the model surfaced two latent source-generator bugs, both
fixed here:

- `NodeSetToModelDesign` crashed on a top-level `<ServerUris>` table
(`StringTable.Append(null)` for the reserved local-server slot). Added a
null guard plus a focused regression test (`NodesetServerUrisTests`).
- `FluentBuilderGenerator` emitted colliding typed-builder accessors for
any model with more than one structure encoding, because
`DataTypeEncoding` objects hang off their `DataType` and surfaced as
parent-less "root" instances sharing the reserved
`DefaultBinary`/`DefaultXml`/`DefaultJson` symbolic names. They are
encoding metadata, never fluent-wired, so they are now excluded from the
typed builder.

A few edges are intentionally not asserted for cross-pipeline
equivalence because the pipelines legitimately differ (documented in
`CoverageNodeSet/README.md`): type-dictionary / `DataTypeDescription`
nodes (the generator regenerates schema rather than emitting them), a
handful of ambiguous duplicate-hierarchical / View-`Organizes` edges,
and runtime structure stand-ins (structure definitions are validated via
the `DataTypeDefinition` round-trip instead).

## Related Issues

- Fixes #4251

## Checklist

_Put an `x` in the boxes that apply. You can complete these step by step
after opening the PR._

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [x] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [x] I have added all necessary documentation.
- [x] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [x] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2026-08-17 14:59:58 -07:00

65 lines
2.8 KiB
CSV

CoverageHierarchicalReference,5001,ReferenceType
CoverageSymmetricReference,5002,ReferenceType
CoverageAbstractReference,5003,ReferenceType
CoverageConcreteReference,5004,ReferenceType
CoverageEnumeration,5100,DataType
CoverageEnumeration_EnumValues,5101,Variable
CoverageOptionSet,5110,DataType
CoverageOptionSet_OptionSetValues,5111,Variable
CoverageAbstractStructure,5120,DataType
CoverageStructure,5130,DataType
CoverageStructure_DefaultBinary,5131,Object
CoverageStructure_DefaultXml,5132,Object
CoverageStructure_DefaultJson,5133,Object
CoverageOptionalStructure,5140,DataType
CoverageOptionalStructure_DefaultBinary,5141,Object
CoverageUnion,5150,DataType
CoverageUnion_DefaultBinary,5151,Object
CoverageAbstractObjectType,5200,ObjectType
CoverageObjectType,5210,ObjectType
CoverageObjectType_MandatoryVariable,5211,Variable
CoverageObjectType_OptionalVariable,5212,Variable
CoverageObjectType_MandatoryPlaceholder,5213,Object
CoverageObjectType_OptionalPlaceholder,5214,Object
CoverageObjectType_ExposesArrayVariable,5215,Variable
CoverageObjectType_MandatoryMethod,5216,Method
CoverageObjectType_MandatoryMethod_InputArguments,5217,Variable
CoverageObjectType_MandatoryMethod_OutputArguments,5218,Variable
CoverageEventType,5230,ObjectType
CoverageInterfaceType,5240,ObjectType
CoverageVariableType,5300,VariableType
CoverageRoot,5400,Object
CoverageRoot_TypedObject,5402,Object
CoverageRoot_TypedObject_MandatoryVariable,5403,Variable
CoverageRoot_TypedObject_MandatoryMethod,5404,Method
CoverageRoot_TypedObject_MandatoryMethod_InputArguments,5405,Variable
CoverageRoot_TypedObject_MandatoryMethod_OutputArguments,5406,Variable
CoverageRoot_EventSource,5410,Object
CoverageRoot_EventSource_SubNotifier,5411,Object
CoverageRoot_EventSource_CoverageCondition,5412,Object
CoverageRoot_BooleanValue,5420,Variable
CoverageRoot_Int32Value,5421,Variable
CoverageRoot_StringArrayValue,5422,Variable
CoverageRoot_DoubleMatrixValue,5423,Variable
CoverageRoot_DateTimeValue,5424,Variable
CoverageRoot_EnumerationValue,5425,Variable
CoverageRoot_OrderedValue,5426,Variable
CoverageRoot_AddNumbers,5450,Method
CoverageRoot_LockedMethod,5451,Method
CoverageRoot_AddNumbers_InputArguments,5452,Variable
CoverageRoot_AddNumbers_OutputArguments,5453,Variable
CoverageView,5460,View
CoverageRoot_CoverageStateMachine,5470,Object
CoverageRoot_CoverageStateMachine_StateA,5471,Object
CoverageRoot_CoverageStateMachine_StateB,5472,Object
CoverageRoot_CoverageStateMachine_TransitionAB,5473,Object
CoveragePlainStructure,5160,DataType
CoveragePlainStructure_DefaultBinary,5161,Object
CoverageRoot_TreeRoot,5490,Object
CoverageRoot_TreeRoot_BranchA,5491,Object
CoverageRoot_TreeRoot_BranchA_LeafA1,5492,Variable
CoverageRoot_TreeRoot_BranchA_SubBranchA,5493,Object
CoverageRoot_TreeRoot_BranchA_SubBranchA_LeafA2,5494,Variable
CoverageRoot_TreeRoot_BranchB,5495,Object
CoverageRoot_TreeRoot_BranchB_LeafB1,5496,Variable