Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

54 node ids for attributes interfaces #83

Merged
merged 14 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 258 additions & 27 deletions NodeSetToAML.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SystemTest/ExternalInterfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ExternalInterfaces

// This test is more about studying the file output, but has validity as a real test
private int LinkInternalElementDifferentCount;
[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void DifferencesBetweenLinksAndInternalElements()
{
GetDocument();
Expand Down
2 changes: 1 addition & 1 deletion SystemTest/Ids.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Ids
CAEXDocument m_document = null;
#region Tests

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestForGuids()
{
GetDocument();
Expand Down
10 changes: 5 additions & 5 deletions SystemTest/InternalElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class InternalElements

#region Tests

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void Validation()
{
var lookupService = LookupService.Register();
Expand Down Expand Up @@ -67,7 +67,7 @@ public void Validation()

// Test is done on AcknowledgeableConditionType/AckedState and AlarmConditionType/SuppressedState
// As both use TwoStateConditionType, and StateVariableType
[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow(
Opc.Ua.Variables.AcknowledgeableConditionType_AckedState,
Opc.Ua.Variables.AcknowledgeableConditionType_AckedState_Id,
Expand Down Expand Up @@ -112,7 +112,7 @@ public void TestDerivedTwoState(uint objectType, uint id, uint transitionTime, u
}
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow(
Opc.Ua.Variables.StateMachineType_CurrentState,
Opc.Ua.Variables.StateVariableType_Name,
Expand Down Expand Up @@ -202,7 +202,7 @@ public void TestDerivedCurrentState(uint objectType,

// Objects/Server/PublishSubscribe/SecurityGroups is an instance that has been improved to have nodeIds as IDs.
// This is an object picked semi-randomly as an Id test for InternalElements
[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestSecurityGroupInstance()
{
string root = TestHelper.GetOpcRootName();
Expand All @@ -224,7 +224,7 @@ public void TestSecurityGroupInstance()
}


[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow(new string[]
{
"DescriptionMethod",
Expand Down
2 changes: 1 addition & 1 deletion SystemTest/IsAbstract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum CheckType
ExternalInterfaceType
};

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestAllIsAbstract()
{
DirectoryInfo outputDirectoryInfo = TestHelper.GetOpc2AmlDirectory();
Expand Down
9 changes: 0 additions & 9 deletions SystemTest/NodeSetFiles/AmlFxTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
<Uri>http://opcfoundation.org/UA/FX/AML/TESTING/AmlFxTest/</Uri>
<Uri>http://opcfoundation.org/UA/FX/AC/</Uri>
<Uri>http://opcfoundation.org/UA/FX/Data/</Uri>
<Uri>http://opcfoundation.org/UA/DI/</Uri>
</NamespaceUris>
<Models>
<Model ModelUri="http://opcfoundation.org/UA/FX/AML/TESTING/AmlFxTest/">
<RequiredModel ModelUri="http://opcfoundation.org/UA/"/>
<RequiredModel ModelUri="http://opcfoundation.org/UA/DI/" />
<RequiredModel ModelUri="http://opcfoundation.org/UA/FX/Data/" />
<RequiredModel ModelUri="http://opcfoundation.org/UA/FX/AC/" />
</Model>
</Models>
Expand All @@ -24,11 +20,6 @@
<Alias Alias="DeviceHealthOptionSet">ns=2;i=3005</Alias>
<Alias Alias="OperationalHealthOptionSet">ns=2;i=3010</Alias>
</Aliases>
<Extensions>
<Extension>
<ua:ModelInfo Tool="UaModeler" Hash="WltXoHM4YlagD+N7UzeKkw==" Version="1.6.8"/>
</Extension>
</Extensions>
<UAObject NodeId="ns=1;i=5003" BrowseName="1:AutomationComponentInstance">
<DisplayName>AutomationComponentInstance</DisplayName>
<References>
Expand Down
13 changes: 10 additions & 3 deletions SystemTest/NodeSetFiles/Modified.Opc.Ua.NodeSet2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9730,9 +9730,16 @@
<Reference ReferenceType="HasSubtype" IsForward="false">i=18809</Reference>
</References>
<Definition Name="3DCartesianCoordinates" SymbolicName="ThreeDCartesianCoordinates">
<Field Name="X" DataType="i=11" />
<Field Name="Y" DataType="i=11" />
<Field Name="Z" DataType="i=11" />
<Field Name="X" DataType="i=11" >
<Description>No Locale</Description>
</Field>
<Field Name="Y" DataType="i=11" >
<Description Locale="en">With Locale</Description>
</Field>
<Field Name="Z" DataType="i=11" >
<Description>Multiple Descriptions</Description>
<Description Locale="en">Multiple Descriptions with Locale</Description>
</Field>
</Definition>
</UADataType>
<UADataType NodeId="i=18811" BrowseName="Orientation" IsAbstract="true">
Expand Down
4 changes: 2 additions & 2 deletions SystemTest/TestAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TestAttributes

#region Tests

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("Description", "5001",
"A Folder to store instances specifically for testing purposes",
true, DisplayName = "Instance Expected Description")]
Expand Down Expand Up @@ -59,7 +59,7 @@ public void TestAttribute(string attribute, string nodeId,
}
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestMethodClassAttributes()
{
CAEXDocument document = GetDocument();
Expand Down
26 changes: 13 additions & 13 deletions SystemTest/TestCommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void ClassInitialize(TestContext context)

#region Tests

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void OutputSpecific()
{
DirectoryInfo outputDirectoryInfo = TestHelper.GetOpc2AmlDirectory();
Expand Down Expand Up @@ -71,7 +71,7 @@ public void OutputSpecific()
Assert.IsFalse( dontBuildfileInfo.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void OutputNonExistent()
{
string commandLine = "--Nodeset NonExistent.xml";
Expand All @@ -80,7 +80,7 @@ public void OutputNonExistent()
}

// Test 6: Output specific output overwrite
[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void OutputSpecificOverwrite()
{
string commandLine = DirectoryParameter( ) +
Expand All @@ -95,7 +95,7 @@ public void OutputSpecificOverwrite()
Assert.IsTrue( before < fileInfo.LastWriteTimeUtc );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void SpecificNoDirectory()
{
string commandLine = NodesetParameter( WorkingDirectoryString() + "LevelOne.xml" ) +
Expand All @@ -107,7 +107,7 @@ public void SpecificNoDirectory()
Assert.IsTrue( fileInfo.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void NoDirectoryOutputSubdirectory()
{
string commandLine = NodesetParameter( WorkingDirectoryString() + "LevelOne.xml" ) +
Expand All @@ -119,7 +119,7 @@ public void NoDirectoryOutputSubdirectory()
Assert.IsTrue( fileInfo.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void RelativeDirectory()
{
string commandLine = DirectoryParameter() +
Expand All @@ -132,7 +132,7 @@ public void RelativeDirectory()
Assert.IsTrue( fileInfo.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void AbsoluteDirectory()
{
DirectoryInfo directoryInfo = new DirectoryInfo( WorkingDirectory().FullName );
Expand All @@ -146,7 +146,7 @@ public void AbsoluteDirectory()
Assert.IsTrue( fileInfo.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void BadDirectory()
{
string commandLine = DirectoryParameter() + "BadDirectory" +
Expand All @@ -156,7 +156,7 @@ public void BadDirectory()
TestHelper.Execute( commandLine, expectedResult: 1 );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void OutputAllDirectory()
{
DirectoryInfo directoryInfo = new DirectoryInfo( WorkingDirectory().FullName );
Expand All @@ -176,7 +176,7 @@ public void OutputAllDirectory()
directoryInfo.GetFiles( "*.xml" ).Length );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void OutputOneDirectory()
{
string commandLine = DirectoryParameter() +
Expand All @@ -185,7 +185,7 @@ public void OutputOneDirectory()
TestHelper.Execute( commandLine, expectedResult: 1 );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void RelativeConfig()
{
DirectoryInfo directoryInfo = new DirectoryInfo( ConfigDirectory().FullName );
Expand All @@ -207,7 +207,7 @@ public void RelativeConfig()
Assert.IsTrue( expectedLog.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void AbsoluteConfig()
{
DirectoryInfo directoryInfo = new DirectoryInfo( ConfigDirectory().FullName );
Expand All @@ -228,7 +228,7 @@ public void AbsoluteConfig()
Assert.IsTrue( expectedLog.Exists );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void BadConfig()
{
DateTime start = DateTime.UtcNow;
Expand Down
10 changes: 5 additions & 5 deletions SystemTest/TestComplexNonRootNamespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class TestComplexNonRootNamespace
private const string LevelTwo = "http://opcfoundation.org/UA/FX/AML/TESTING/LevelTwo/";
private const string RootLevel = "http://opcfoundation.org/UA/";

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestLevelOne()
{
AttributeType value = InitialGetValueAttribute( "LevelOne" );
Expand Down Expand Up @@ -216,7 +216,7 @@ public void TestLevelOne()
#endregion
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestLevelTwo()
{
AttributeType value = InitialGetValueAttribute( "LevelTwo" );
Expand All @@ -226,7 +226,7 @@ public void TestLevelTwo()
return;
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestTopLevel()
{
AttributeType topLevel = InitialGetValueAttribute( "TopLevel" );
Expand Down Expand Up @@ -399,7 +399,7 @@ public void TestValue( AttributeType source, string target, string value, string
Assert.AreEqual( type, attribute.AttributeDataType );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestFieldTargetData()
{
SystemUnitClassType objectToTest = GetObjectFolder();
Expand Down Expand Up @@ -442,7 +442,7 @@ public void TestFieldTargetData()
//Assert.AreEqual( "", overrideValue.AttributeDataType );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestPublishedVariableData()
{
SystemUnitClassType objectToTest = GetObjectFolder();
Expand Down
6 changes: 3 additions & 3 deletions SystemTest/TestComplexRootNamespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TestComplexRootNamespace
private const string LevelTwo = "http://opcfoundation.org/UA/FX/AML/TESTING/LevelTwo/";
private const string RootLevel = "http://opcfoundation.org/UA/";

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestDataSetMetaData()
{
SystemUnitClassType objectToTest = GetObjectFolder();
Expand Down Expand Up @@ -110,7 +110,7 @@ public void TestDataSetMetaData()
}


[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestFieldTargetData()
{
SystemUnitClassType objectToTest = GetObjectFolder();
Expand Down Expand Up @@ -153,7 +153,7 @@ public void TestFieldTargetData()
//Assert.AreEqual( "", overrideValue.AttributeDataType );
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
public void TestPublishedVariableData()
{
SystemUnitClassType objectToTest = GetObjectFolder();
Expand Down
2 changes: 1 addition & 1 deletion SystemTest/TestDataTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TestDataTypes

#region Tests

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow( "6192", "12345", "xs:int", "Value", DisplayName = "DataValue Value" )]
[DataRow( "6192", "2165637120", "xs:unsignedInt", "StatusCode", DisplayName = "StatusCode" )]
[DataRow( "6192", "2023-09-13T14:39:08-06:00", "xs:dateTime", "SourceTimestamp", DisplayName = "SourceTimestamp" )]
Expand Down
14 changes: 7 additions & 7 deletions SystemTest/TestEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class TestDisplay

#region Tests

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("5015", "TrueState", "FalseState", true, DisplayName = "Default Parameters")]
[DataRow("5016", "OverrideTrueState", "OverrideFalseState", true, DisplayName = "Override Default Parameters")]
[DataRow("5017", "InstanceTrueState", "InstanceFalseState", false, DisplayName = "Override Parameters")]
Expand Down Expand Up @@ -56,7 +56,7 @@ public void TwoStateInstances(string nodeId, string expectedTrue, string expecte



[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("6012", "", "", false, DisplayName = "Has No Values")]
[DataRow("6013", "TrueState", "FalseState", true, DisplayName = "Has Values")]
public void TwoStateClasses(string nodeId, string expectedTrue, string expectedFalse, bool hasValues)
Expand Down Expand Up @@ -93,7 +93,7 @@ public void TwoStateClasses(string nodeId, string expectedTrue, string expectedF
Assert.IsNotNull(valueAsText, "Unable to Find ValueAsText Property");
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("5005", new string[] {"ZeroValue","OneValue"}, 1, DisplayName = "Default Parameters")]
[DataRow("5007", new string[] { "OverrideZero", "OverrideOne" }, 1, DisplayName = "Override Default Parameters")]
[DataRow("5006", new string[] { "InstanceZero", "InstanceOne" }, 0, DisplayName = "Override Parameters")]
Expand All @@ -104,15 +104,15 @@ public void MultiStateVariableInstances(string nodeId, string[] values, int expe

}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("6009", new string[] { }, false, DisplayName = "Has No Values")]
[DataRow("6008", new string[] { "ZeroValue", "OneValue" }, true, DisplayName = "Has Values")]
public void MultiStateVariableClasses(string nodeId, string[] values, bool hasValues)
{
EnumClassTest(nodeId, values, hasValues, "EnumValues", "ListOfEnumValueType");
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("5008", new string[] { "ZeroState", "OneState" }, 1, DisplayName = "Default Parameters")]
[DataRow("5009", new string[] { "OverrideZero", "OverrideOne" }, 1, DisplayName = "Override Default Parameters")]
[DataRow("5010", new string[] { "InstanceZero", "InstanceOne" }, 0, DisplayName = "Override Parameters")]
Expand All @@ -122,15 +122,15 @@ public void MultiStateInstances(string nodeId, string[] values, int expectedInde
"Test_MultiState_", "EnumStrings", "ListOfLocalizedText");
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]
[DataRow("6010", new string[] { }, false, DisplayName = "Has No Values")]
[DataRow("6011", new string[] { "ZeroState", "OneState" }, true, DisplayName = "Has Values")]
public void MultiStateClasses(string nodeId, string[] values, bool hasValues)
{
EnumClassTest(nodeId, values, hasValues, "EnumStrings", "ListOfLocalizedText");
}

[TestMethod]
[TestMethod, Timeout( TestHelper.UnitTestTimeout )]

[DataRow( Opc.Ua.DataTypes.NodeClass, new NodeClass(), DisplayName = "EnumValue Constraints - NodeClass" )]
[DataRow( Opc.Ua.DataTypes.MessageSecurityMode, new MessageSecurityMode(), DisplayName = "EnumString Constraints - MessageSecurityMode" )]
Expand Down
Loading