use of org.eclipse.milo.opcua.stack.core.types.structured.ServiceCounterDataType in project milo by eclipse.
the class VariantSerializationTest method testVariant_UaStructure.
@Test
public void testVariant_UaStructure() {
ServiceCounterDataType sc1 = new ServiceCounterDataType(uint(1), uint(2));
Variant v = new Variant(sc1);
writer.writeVariant(v);
Variant decoded = reader.readVariant();
ExtensionObject extensionObject = (ExtensionObject) decoded.getValue();
ServiceCounterDataType sc2 = (ServiceCounterDataType) extensionObject.decode(new TestSerializationContext());
Assert.assertEquals(sc1.getTotalCount(), sc2.getTotalCount());
Assert.assertEquals(sc1.getErrorCount(), sc2.getErrorCount());
}
Aggregations