From 5a90facb8aff6e19207ccf24f5be24d83664b18f Mon Sep 17 00:00:00 2001 From: mateusmolina Date: Fri, 25 Oct 2024 09:53:59 +0200 Subject: [PATCH 1/2] test: add AasEnvironment component test using the registry integ. features --- ...estEnvironmentWithRegistryIntegration.java | 112 ++++++++++++++++++ .../resources/application-reginteg.properties | 7 ++ .../test/resources/faulty_aas_reginteg.aasx | Bin 0 -> 10897 bytes 3 files changed, 119 insertions(+) create mode 100644 basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestEnvironmentWithRegistryIntegration.java create mode 100644 basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/application-reginteg.properties create mode 100644 basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/faulty_aas_reginteg.aasx diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestEnvironmentWithRegistryIntegration.java b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestEnvironmentWithRegistryIntegration.java new file mode 100644 index 000000000..a3fee1c54 --- /dev/null +++ b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/java/org/eclipse/digitaltwin/basyx/aasenvironment/component/TestEnvironmentWithRegistryIntegration.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (C) 2024 the Eclipse BaSyx Authors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * SPDX-License-Identifier: MIT + ******************************************************************************/ + +package org.eclipse.digitaltwin.basyx.aasenvironment.component; + +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.basyx.aasenvironment.AasEnvironment; +import org.eclipse.digitaltwin.basyx.aasenvironment.environmentloader.CompleteEnvironment; +import org.eclipse.digitaltwin.basyx.aasenvironment.environmentloader.CompleteEnvironment.EnvironmentType; +import org.eclipse.digitaltwin.basyx.aasrepository.AasRepository; +import org.eclipse.digitaltwin.basyx.aasrepository.feature.registry.integration.AasRepositoryRegistryLink; +import org.eclipse.digitaltwin.basyx.core.pagination.PaginationInfo; +import org.eclipse.digitaltwin.basyx.submodelrepository.SubmodelRepository; +import org.eclipse.digitaltwin.basyx.submodelrepository.feature.registry.integration.SubmodelRepositoryRegistryLink; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.io.ClassPathResource; + +/** + * + * Test the {@link AasEnvironment} with aas and submodel registry integration + * features enabled + * + * @author mateusmolina + */ +public class TestEnvironmentWithRegistryIntegration { + + static final String FAULTY_AAS_PATH = "faulty_aas_reginteg.aasx"; + + static ConfigurableApplicationContext appContext; + + static AasEnvironment aasEnvironment; + static AasRepositoryRegistryLink aasRepositoryRegistryLink; + static SubmodelRepositoryRegistryLink smRepositoryRegistryLink; + static AasRepository aasRepository; + static SubmodelRepository smRepository; + + @BeforeClass + public static void startAASEnvironment() { + appContext = new SpringApplicationBuilder(AasEnvironmentComponent.class).profiles("reginteg").run(new String[] {}); + + aasEnvironment = appContext.getBean(AasEnvironment.class); + aasRepositoryRegistryLink = appContext.getBean(AasRepositoryRegistryLink.class); + smRepositoryRegistryLink = appContext.getBean(SubmodelRepositoryRegistryLink.class); + aasRepository = appContext.getBean(AasRepository.class); + smRepository = appContext.getBean(SubmodelRepository.class); + + assertRepositoriesAreEmpty(); + } + + @AfterClass + public static void stopAASEnvironment() { + appContext.close(); + } + + @AfterClass + public static void clearRegistries() throws Exception { + smRepositoryRegistryLink.getRegistryApi().deleteAllSubmodelDescriptors(); + aasRepositoryRegistryLink.getRegistryApi().deleteAllShellDescriptors(); + } + + @Test + public void whenUploadDescriptorToRegistryFails_thenNoAasOrSmAreAddedToRepository() throws InvalidFormatException, DeserializationException, IOException { + CompleteEnvironment completeEnvironment = CompleteEnvironment.fromInputStream(getIsFromClasspath(FAULTY_AAS_PATH), EnvironmentType.AASX); + + assertThrows(IllegalArgumentException.class, () -> aasEnvironment.loadEnvironment(completeEnvironment)); + + assertRepositoriesAreEmpty(); + } + + private static InputStream getIsFromClasspath(String fileName) throws IOException { + return new ClassPathResource(fileName).getInputStream(); + } + + private static void assertRepositoriesAreEmpty() { + assertTrue(aasRepository.getAllAas(PaginationInfo.NO_LIMIT).getResult().isEmpty()); + assertTrue(smRepository.getAllSubmodels(PaginationInfo.NO_LIMIT).getResult().isEmpty()); + } + +} diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/application-reginteg.properties b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/application-reginteg.properties new file mode 100644 index 000000000..ce166b3ec --- /dev/null +++ b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/application-reginteg.properties @@ -0,0 +1,7 @@ +basyx.aasrepository.feature.registryintegration=http://localhost:8050 +basyx.submodelrepository.feature.registryintegration=http://localhost:8060 + +basyx.externalurl=http://localhost:8080 + +# Override for empty environment +basyx.environment= \ No newline at end of file diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/faulty_aas_reginteg.aasx b/basyx.aasenvironment/basyx.aasenvironment.component/src/test/resources/faulty_aas_reginteg.aasx new file mode 100644 index 0000000000000000000000000000000000000000..55fe434d329e10bac59de9de6ae852c4872827ca GIT binary patch literal 10897 zcmb7~1ymeOzvc&bcXtmA?(XguAo$=G7~Bc&8X$OZcXtaO+}(l)4IWtXe)rpb-@AA3 z?)IFnK6SeOPgg%x)jieqQ&oV1#s)yb!vh8kziJZ78mHj`008W_9UVXnFfnoQ0RBms z9i6Q$tsTg};sfY&|D65bx9f2xxe2C`@kxd8ky1_B31<4zIVgbYn?51{01x;}e?6xM z8VLdb_-lXDH*yBqxd2)Ir2n1td3(2@h=;u$xf{sY#oEz9h?0$km69CfVCHCU?O-WH z=?b=B=A{%77E}k>nSkF)xL8>`xsbnwIJgK=T7kh%{6L_KnH9+1#D&Gt3FPp0#=_Cr z-UR%Xb+!aLnV8v{Sb~7;tgPI?x7z$K4a$FNl52W8f&QnWiMhSC1G9@2$j*+%+VL-= z{u%vu?eLX_(4=A1kr3l3g$UUM!^b`CR2a-gsv@E^A% z{KwBX|KHjxz)w&s_{jdof*JrYVS)l^zBS2T?Iq^o0s@QushYJ5*!izp(fCtEW@ct~ z2`O<&RvvcX|3ev;H!+qspU$#Y9rk41s?K?~+~He*MMSC$X#6~TecGVXvXD|nYig~S zVq`O_#OU#8jHGdkcy$mF>|-CWHZZ*%r904f+qV|tN$C;h8PU6Piy~b{t&lP$@kKgc zK#JWn9Jva(pyyw4fByRPikjkI+22FPD1vDen(g@V(-BUMlU;FXl;oJ5!I?-n@(?ZdhiWVPb&Zss{?5GbBqv_U z7`Zcl@~if}+Yck>CyWt18?GuwB}yU*$$v7OO4&#d+Wh^~@lo-ilKb<%4fTMXKt&^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sjdA{~T(6h5ttqPWvCV{I3Vze-`>@U;MjJ4ISXW>Y1tvFtC4$!My#7-yE5v H|C9S4UD6oo literal 0 HcmV?d00001 From 83116366c2067dba36b8554472f23c1d5f198c20 Mon Sep 17 00:00:00 2001 From: mateusmolina Date: Fri, 25 Oct 2024 10:01:55 +0200 Subject: [PATCH 2/2] fix: RegistryIntegragation: when add descriptor fails, nothing is added to repo --- .../integration/RegistryIntegrationAasRepository.java | 4 ++-- .../integration/RegistryIntegrationSubmodelRepository.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/basyx.aasrepository/basyx.aasrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/registry/integration/RegistryIntegrationAasRepository.java b/basyx.aasrepository/basyx.aasrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/registry/integration/RegistryIntegrationAasRepository.java index 17d93879d..df52bc6af 100644 --- a/basyx.aasrepository/basyx.aasrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/registry/integration/RegistryIntegrationAasRepository.java +++ b/basyx.aasrepository/basyx.aasrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/registry/integration/RegistryIntegrationAasRepository.java @@ -78,9 +78,9 @@ public AssetAdministrationShell getAas(String shellId) throws ElementDoesNotExis @Override public void createAas(AssetAdministrationShell shell) throws CollidingIdentifierException { - decorated.createAas(shell); - integrateAasWithRegistry(shell, aasRepositoryRegistryLink.getAasRepositoryBaseURLs()); + + decorated.createAas(shell); } @Override diff --git a/basyx.submodelrepository/basyx.submodelrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/registry/integration/RegistryIntegrationSubmodelRepository.java b/basyx.submodelrepository/basyx.submodelrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/registry/integration/RegistryIntegrationSubmodelRepository.java index 57760d07c..583ed41a0 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/registry/integration/RegistryIntegrationSubmodelRepository.java +++ b/basyx.submodelrepository/basyx.submodelrepository-feature-registry-integration/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/registry/integration/RegistryIntegrationSubmodelRepository.java @@ -91,9 +91,9 @@ public void updateSubmodel(String submodelId, Submodel submodel) throws ElementD @Override public void createSubmodel(Submodel submodel) throws CollidingIdentifierException { - decorated.createSubmodel(submodel); - integrateSubmodelWithRegistry(submodel, submodelRepositoryRegistryLink.getSubmodelRepositoryBaseURLs()); + + decorated.createSubmodel(submodel); } @Override