From f863009e96f4a47b0be5ecf2c73b4dcd8d46ce6a Mon Sep 17 00:00:00 2001 From: Frank Schnicke Date: Fri, 22 Oct 2021 10:03:17 +0200 Subject: [PATCH] Deletes obsolete files - Were added accidentally Signed-off-by: Frank Schnicke --- .../TestConnectedPropertyWithUrlValue.java | 88 ------------------- .../submodel/metamodel/ConstantinTest.java | 72 --------------- 2 files changed, 160 deletions(-) delete mode 100644 src/test/java/org/eclipse/basyx/testsuite/regression/TestConnectedPropertyWithUrlValue.java delete mode 100644 src/test/java/org/eclipse/basyx/testsuite/regression/submodel/metamodel/ConstantinTest.java diff --git a/src/test/java/org/eclipse/basyx/testsuite/regression/TestConnectedPropertyWithUrlValue.java b/src/test/java/org/eclipse/basyx/testsuite/regression/TestConnectedPropertyWithUrlValue.java deleted file mode 100644 index 62c77037..00000000 --- a/src/test/java/org/eclipse/basyx/testsuite/regression/TestConnectedPropertyWithUrlValue.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2021 the Eclipse BaSyx Authors - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - ******************************************************************************/ -package org.eclipse.basyx.testsuite.regression; - -import java.util.Arrays; -import java.util.function.Function; - -import org.eclipse.basyx.aas.aggregator.AASAggregator; -import org.eclipse.basyx.aas.aggregator.proxy.AASAggregatorProxy; -import org.eclipse.basyx.aas.aggregator.restapi.AASAggregatorProvider; -import org.eclipse.basyx.aas.metamodel.map.AssetAdministrationShell; -import org.eclipse.basyx.aas.restapi.MultiSubmodelProvider; -import org.eclipse.basyx.submodel.metamodel.api.identifier.IdentifierType; -import org.eclipse.basyx.submodel.metamodel.api.qualifier.haskind.ModelingKind; -import org.eclipse.basyx.submodel.metamodel.map.Submodel; -import org.eclipse.basyx.submodel.metamodel.map.identifier.Identifier; -import org.eclipse.basyx.submodel.metamodel.map.qualifier.AdministrativeInformation; -import org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.Property; -import org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.valuetype.ValueType; -import org.eclipse.basyx.submodel.metamodel.map.submodelelement.operation.Operation; -import org.eclipse.basyx.submodel.metamodel.map.submodelelement.operation.OperationVariable; -import org.eclipse.basyx.submodel.restapi.SubmodelProvider; -import org.eclipse.basyx.vab.modelprovider.VABElementProxy; -import org.eclipse.basyx.vab.modelprovider.VABPathTools; -import org.junit.Test; - -/** - * Test JSONConnector against JSONProvider - * - * @author pschorn - * - */ -public class TestConnectedPropertyWithUrlValue { - - @Test - public void test() { - AssetAdministrationShell aas = new AssetAdministrationShell(); - aas.setIdShort("PersistenceAccess"); - aas.setIdentification(new Identifier(IdentifierType.CUSTOM, "op.basyx.controller/PersistenceAccess:1")); - aas.setAdministration(new AdministrativeInformation("1", "1.0")); - - Submodel submodel = new Submodel(); - submodel.setIdShort("PersistenceAccess"); - submodel.setIdentification( - new Identifier(IdentifierType.CUSTOM, "op.basyx.controller/PersistenceAccess/PersistenceAccess:1")); - submodel.setAdministration(new AdministrativeInformation("1", "1.0")); - - aas.addSubmodel(submodel); - aas.addSubmodelReference(submodel.getReference()); - - Operation opPersistAasEnv = new Operation(); - opPersistAasEnv.setIdShort("persistAasEnv"); - Property pAasEnv = new Property(); - pAasEnv.setIdShort("aasEnv"); - pAasEnv.setModelingKind(ModelingKind.TEMPLATE); - pAasEnv.setValueType(ValueType.String); - Property pPersistentIds = new Property(); - pPersistentIds.setIdShort("persistentIds"); - pPersistentIds.setModelingKind(ModelingKind.TEMPLATE); - pPersistentIds.setValueType(ValueType.String); - opPersistAasEnv.setInputVariables( - Arrays.asList(new OperationVariable(pAasEnv), new OperationVariable(pPersistentIds))); - opPersistAasEnv.setInvokable((Function) params -> { - return null; - }); - submodel.addSubmodelElement(opPersistAasEnv); - - AASAggregator aggregator = new AASAggregator(); - aggregator.createAAS(aas); - MultiSubmodelProvider aasProvider = (MultiSubmodelProvider) aggregator.getAASProvider(aas.getIdentification()); - aasProvider.addSubmodel(new SubmodelProvider(submodel)); - - AASAggregatorProvider provider = new AASAggregatorProvider(aggregator); - VABElementProxy providerWrapper = new VABElementProxy("/shells", provider); - AASAggregatorProxy proxy = new AASAggregatorProxy(providerWrapper); - System.out.println(proxy.getAAS(aas.getIdentification()).getSubmodel(submodel.getIdentification())); - String path = "/shells/" + VABPathTools.encodePathElement(aas.getIdentification().getId()) + "/aas/submodels/"+ submodel.getIdShort() + "/submodel"; - System.out.println(provider.getValue(path)); - } - -} diff --git a/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/metamodel/ConstantinTest.java b/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/metamodel/ConstantinTest.java deleted file mode 100644 index 3f6d86e8..00000000 --- a/src/test/java/org/eclipse/basyx/testsuite/regression/submodel/metamodel/ConstantinTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2021 the Eclipse BaSyx Authors - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - ******************************************************************************/ -package org.eclipse.basyx.testsuite.regression.submodel.metamodel; - -import org.eclipse.basyx.aas.aggregator.api.IAASAggregator; -import org.eclipse.basyx.aas.aggregator.proxy.AASAggregatorProxy; -import org.eclipse.basyx.aas.metamodel.api.IAssetAdministrationShell; -import org.eclipse.basyx.aas.metamodel.api.parts.asset.AssetKind; -import org.eclipse.basyx.aas.metamodel.map.AssetAdministrationShell; -import org.eclipse.basyx.aas.metamodel.map.descriptor.CustomId; -import org.eclipse.basyx.aas.metamodel.map.descriptor.ModelUrn; -import org.eclipse.basyx.aas.metamodel.map.parts.Asset; -import org.eclipse.basyx.submodel.metamodel.api.ISubmodel; -import org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier; -import org.eclipse.basyx.submodel.metamodel.api.identifier.IdentifierType; -import org.eclipse.basyx.submodel.metamodel.api.reference.enums.KeyElements; -import org.eclipse.basyx.submodel.metamodel.map.Submodel; -import org.eclipse.basyx.submodel.metamodel.map.reference.Key; -import org.eclipse.basyx.submodel.metamodel.map.reference.Reference; -import org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.Property; -import org.eclipse.basyx.submodel.metamodel.map.submodelelement.dataelement.property.valuetype.ValueType; -import org.eclipse.basyx.vab.exception.provider.ResourceNotFoundException; -import org.junit.Ignore; - -@Ignore -public class ConstantinTest extends TestSubmodelSuite { - private final static Reference testSemanticIdRef = new Reference(new Key(KeyElements.CONCEPTDESCRIPTION, false, "testVal", IdentifierType.CUSTOM)); - private final static String PROP = "prop1"; - private final static String ID = "TestId"; - - @Override - protected ISubmodel getSubmodel() { - - IAASAggregator aggregator = new AASAggregatorProxy("http://localhost:5080"); - - AssetAdministrationShell aas = new AssetAdministrationShell("aasIdShort", new CustomId("AASCustomId"), new Asset("assetIdShort", new CustomId("AssetCustomId"), AssetKind.INSTANCE)); - - try { - aggregator.deleteAAS(aas.getIdentification()); - } catch (ResourceNotFoundException e) { - System.out.println("AAS not on server"); - } - - aggregator.createAAS(aas); - - IAssetAdministrationShell shell = aggregator.getAAS(aas.getIdentification()); - - // Create the Submodel using the created property and operation - IIdentifier submodelId = new ModelUrn("testUrn"); - Submodel localSubmodel = new Submodel(ID, submodelId); - localSubmodel.setSemanticId(testSemanticIdRef); - - shell.addSubmodel(localSubmodel); - - // Create a simple value property - Property propertyMeta = new Property(PROP, ValueType.Integer); - propertyMeta.setValue(100); - - ISubmodel connectedSm = shell.getSubmodel(localSubmodel.getIdentification()); - connectedSm.addSubmodelElement(propertyMeta); - - return connectedSm; - } - -}