use of io.adminshell.aas.v3.model.Qualifier in project FAAAST-Service by FraunhoferIOSB.
the class OpcUaEndpointFullTest method testSubmodel1.
/**
* Tests the submodel 1 (Identification).
*
* @param client The OPC UA Client.
* @param submodelNode The desired Submodel
* @throws ServiceException If the operation fails
* @throws AddressSpaceException If the operation fails
* @throws ServiceResultException If the operation fails
*/
private void testSubmodel1(UaClient client, NodeId submodelNode) throws ServiceException, AddressSpaceException, ServiceResultException, StatusException {
TestUtils.checkDisplayName(client, submodelNode, "Submodel:" + TestDefines.FULL_SUBMODEL_1_NAME);
TestUtils.checkType(client, submodelNode, new NodeId(aasns, TestDefines.AAS_SUBMODEL_TYPE_ID));
TestUtils.checkIdentificationNode(client, submodelNode, aasns, AASIdentifierTypeDataType.IRI, TestDefines.FULL_SUBMODEL_1_ID);
TestUtils.checkAdministrationNode(client, submodelNode, aasns, "0.9", "0");
TestUtils.checkModelingKindNode(client, submodelNode, aasns, AASModelingKindDataType.Instance);
TestUtils.checkCategoryNode(client, submodelNode, aasns, "");
TestUtils.checkDataSpecificationNode(client, submodelNode, aasns);
TestUtils.checkQualifierNode(client, submodelNode, aasns, new ArrayList<>());
ArrayList<Qualifier> list = new ArrayList<>();
list.add(new DefaultQualifier.Builder().value("100").valueType("int").type("http://acplt.org/Qualifier/ExampleQualifier").build());
list.add(new DefaultQualifier.Builder().value("50").valueType("int").type("http://acplt.org/Qualifier/ExampleQualifier2").build());
TestUtils.checkAasPropertyString(client, submodelNode, aasns, "ManufacturerName", AASModelingKindDataType.Instance, "", AASValueTypeDataType.String, "http://acplt.org/ValueId/ACPLT", list);
}
use of io.adminshell.aas.v3.model.Qualifier in project FAAAST-Service by FraunhoferIOSB.
the class TestUtils method checkQualifierList.
// public static void checkFullManufacturerName(UaClient client, NodeId node) {
// List<RelativePath> relPath = new ArrayList<>();
// List<RelativePathElement> browsePath = new ArrayList<>();
// browsePath.add(new RelativePathElement(Identifiers.HierarchicalReferences, false, true, new QualifiedName(aasns, name)));
// relPath.add(new RelativePath(browsePath.toArray(new RelativePathElement[0])));
//
// BrowsePathResult[] bpres = client.getAddressSpace().translateBrowsePathsToNodeIds(node, relPath.toArray(new RelativePath[0]));
// Assert.assertNotNull("checkAasPropertyString Browse Property Result Null", bpres);
// Assert.assertTrue("checkAasPropertyString Browse Property Result: size doesn't match", bpres.length == 1);
//
// BrowsePathTarget[] targets = bpres[0].getTargets();
// Assert.assertNotNull("checkAasPropertyString Property Null", targets);
// Assert.assertTrue("checkAasPropertyString Property empty", targets.length > 0);
// NodeId propertyNode = client.getAddressSpace().getNamespaceTable().toNodeId(targets[0].getTargetId());
//
// }
/**
* Checks the given Qualifier Lists
*
* @param listExpected The expected Qualifier List
* @param listCurrent The current Qualifier List
*/
private static void checkQualifierList(List<Qualifier> listExpected, List<AASQualifierType> listCurrent) {
Assert.assertEquals(listExpected.size(), listCurrent.size());
for (int i = 0; i < listExpected.size(); i++) {
Qualifier exp = listExpected.get(i);
AASQualifierType curr = listCurrent.get(i);
Assert.assertEquals("Qualifier Type not equal", exp.getType(), curr.getType());
Assert.assertEquals("Qualifier ValueType not equal", ValueConverter.stringToValueType(exp.getValueType()), curr.getValueType());
Assert.assertEquals("Qualifier Value not equal", exp.getValue(), curr.getValue());
}
}
Aggregations