Skip to content

Commit

Permalink
Integration-Test-Suite for aasenvironment-component (#137)
Browse files Browse the repository at this point in the history
* Updates SpecificAssetIDValueValueOnlySerialization

* Implements EntityValueValueOnlyDecorator

Signed-off-by: Jannis Jung <[email protected]>

* Fixes SpecificAssetIdValueValueOnlySerialization

Signed-off-by: Jannis Jung <[email protected]>

* Adds SpecificAssetIdValueValueSerialization to SubmodelRepository

Signed-off-by: Jannis Jung <[email protected]>

* Includes externalSubjectId for serialization and deserialzation

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* cleans up code, refactoring

* loads environment preconfiguration from folder

* Implements loadEnvironmentFromFolder Test
Co-authored-by: Marie Witt <[email protected]>

Signed-off-by: Jannis Jung <[email protected]>

* Refactors Test and AasEnvironmentPreconfigurationLoader

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Refactors Test

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Reworks AasEnvironmentPreconfigurationLoader

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Fully migrates to test "TestPreconfiguration"

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Adds slf4j to aasenvironment-http pom

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Improves null value handling

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Removes unnecessary/disruptive pom entries

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Reworks AasEnvironmentPreconfigurationLoader

Co-authored-by: Marie Witt <[email protected]>
Co-authored-by: Frank Schnicke <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Resolves Review Remarks

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* tries to execute IT in aasenvironment

* approaches integration test for aasenvironment

* tries to integrate the submodelreporsitoryIT

* Renames DummyConfigs with individual Names

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Renemes Dummy Configs with individual Names

Co-authored-by: Marie Witt <[email protected]
Signed-off-by: Jannis Jung <[email protected]>

* Adds dependency and annotation

Signed-off-by: Jannis Jung <[email protected]>

* finalize the IT-Integration

* Resolves Merge conflict

Signed-off-by: Jannis Jung <[email protected]>

* Readds and renames DummyConfig for DiscoveryService

Co-authored-by: Marie Witt <[email protected]>
Signed-off-by: Jannis Jung <[email protected]>

* Integrates missing png in aasenv src/test/res

* applies the review-remarks

---------

Signed-off-by: Jannis Jung <[email protected]>
Co-authored-by: Jannis Jung <[email protected]>
Co-authored-by: Frank Schnicke <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2023
1 parent 2f6781a commit c6a8f06
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*
*/
@Configuration
public class DummyConfig {
public class DummyDiscoveryServiceConfig {

private final String COLLECTION = "discoveryServiceHTTPTestCollection";

Expand Down
33 changes: 31 additions & 2 deletions basyx.aasenvironment/basyx.aasenvironment.component/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,42 @@
</properties>

<dependencies>

<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasrepository.component</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasrepository-tck</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.submodelrepository.component</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.submodelrepository-tck</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.conceptdescriptionrepository-tck</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.conceptdescriptionrepository.component</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
Expand All @@ -40,12 +65,12 @@
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.http</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.submodelservice-core</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.http</artifactId>
Expand Down Expand Up @@ -158,6 +183,10 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*******************************************************************************
* Copyright (C) 2023 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 org.eclipse.digitaltwin.basyx.aasrepository.component.AASRepositoryIT;
import org.eclipse.digitaltwin.basyx.conceptdescriptionrepository.component.ConceptDescriptionRepositoryIT;
import org.eclipse.digitaltwin.basyx.submodelrepository.component.SubmodelRepositoryIT;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

/**
* Integration test using the Integration tests from AASRepository,
* SubmodelRepository and ConceptDescriptionRepository over the test suite
*
* @author witt
*
*/

@RunWith(Suite.class)
@Suite.SuiteClasses({ AASRepositoryIT.class, SubmodelRepositoryIT.class, ConceptDescriptionRepositoryIT.class, })
public class AASEnvironmentIT {

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* SPDX-License-Identifier: MIT
******************************************************************************/

package basyx.aasenvironment.component;
package org.eclipse.digitaltwin.basyx.aasenvironment.component;

import static org.junit.Assert.assertNotNull;

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
*/
@Configuration
public class DummyConfig {
public class DummyAasRepositoryConfig {

@Bean
@ConditionalOnMissingBean
Expand Down
5 changes: 0 additions & 5 deletions basyx.aasrepository/basyx.aasrepository-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,24 @@
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.aasrepository-http</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.http</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.eclipse.digitaltwin.basyx.aasservice.AasServiceFactory;
import org.eclipse.digitaltwin.basyx.aasservice.feature.AasServiceFeature;
import org.eclipse.digitaltwin.basyx.aasservice.feature.DecoratedAasServiceFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
Expand All @@ -49,6 +50,7 @@
@Configuration
public class AasRepositoryConfiguration {
@Bean
@ConditionalOnMissingBean
public static AasRepository getAasRepository(AasRepositoryFactory aasRepositoryFactory, List<AasRepositoryFeature> features) {
return new DecoratedAasRepositoryFactory(aasRepositoryFactory, features).create();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
*
*/
public class AASRepositoryIT extends AasRepositoryTestDefinedURL {

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
*
*/
@Configuration
public class DummyConfig {
public class DummyConceptDescriptionRepositoryConfig {

@Bean
@ConditionalOnMissingBean
public ConceptDescriptionRepository createConceptDescriptionRepository() {
return new InMemoryConceptDescriptionRepository();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,29 @@
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.conceptdescriptionrepository-http</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.conceptdescriptionrepository-core</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.http</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
import org.eclipse.digitaltwin.basyx.conceptdescriptionrepository.ConceptDescriptionRepositoryFactory;
import org.eclipse.digitaltwin.basyx.conceptdescriptionrepository.feature.ConceptDescriptionRepositoryFeature;
import org.eclipse.digitaltwin.basyx.conceptdescriptionrepository.feature.DecoratedConceptDescriptionRepositoryFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Provides the spring bean configuration for the {@link ConceptDescriptionRepository}
* utilizing all found features for the respective services
* Provides the spring bean configuration for the
* {@link ConceptDescriptionRepository} utilizing all found features for the
* respective services
*
* @author danish
*
Expand All @@ -45,8 +47,9 @@
public class ConceptDescriptionRepositoryConfiguration {

@Bean
@ConditionalOnMissingBean
public static ConceptDescriptionRepository getConceptDescriptionRepository(ConceptDescriptionRepositoryFactory aasRepositoryFactory, List<ConceptDescriptionRepositoryFeature> features) {
return new DecoratedConceptDescriptionRepositoryFactory(aasRepositoryFactory, features).create();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
*
*/
@Configuration
public class DummyConfig {
public class DummySubmodelRepositoryConfig {

@Bean
@ConditionalOnMissingBean
public SubmodelRepository createSubmodelRepository() {
return new InMemorySubmodelRepository(new InMemorySubmodelServiceFactory());
}
}
}
7 changes: 0 additions & 7 deletions basyx.submodelrepository/basyx.submodelrepository-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,32 @@
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.submodelservice-http</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.submodelrepository-http</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.http</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.digitaltwin.basyx</groupId>
<artifactId>basyx.submodelservice-http</artifactId>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.eclipse.digitaltwin.basyx.submodelservice.SubmodelServiceFactory;
import org.eclipse.digitaltwin.basyx.submodelservice.feature.DecoratedSubmodelServiceFactory;
import org.eclipse.digitaltwin.basyx.submodelservice.feature.SubmodelServiceFeature;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
Expand All @@ -50,15 +51,14 @@
@Configuration
public class SubmodelRepositoryConfiguration {
@Bean
public SubmodelRepository getSubmodelRepository(SubmodelRepositoryFactory aasRepositoryFactory,
List<SubmodelRepositoryFeature> features) {
@ConditionalOnMissingBean
public SubmodelRepository getSubmodelRepository(SubmodelRepositoryFactory aasRepositoryFactory, List<SubmodelRepositoryFeature> features) {
return new DecoratedSubmodelRepositoryFactory(aasRepositoryFactory, features).create();
}

@Primary
@Bean
public SubmodelServiceFactory getSubmodelServiceFactory(SubmodelServiceFactory aasServiceFactory,
List<SubmodelServiceFeature> features) {
public SubmodelServiceFactory getSubmodelServiceFactory(SubmodelServiceFactory aasServiceFactory, List<SubmodelServiceFeature> features) {
return new DecoratedSubmodelServiceFactory(aasServiceFactory, features);
}
}

0 comments on commit c6a8f06

Please sign in to comment.