Skip to content

Commit

Permalink
Merge branch 'main' into 475-allow-loading-custom-quantity-kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
atextor authored Nov 6, 2023
2 parents dd7f296 + c615b53 commit 074e7f5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
15 changes: 7 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.
**How: List of performed steps**

**Where**
Indicate the location of the bug (e.g., which component of the SDK, which API call, which command etc.).
**What: Actual result vs expected result**

**Screenshots**
If applicable, add screenshots to help explain your problem.
**Where: (e.g. component, version, url, your system info)**

**Input (files/screenshots)**

**Additional context**
Add any other context about the problem here.
**Output (files/screenshots)**

**Additional context (e.g. references)**
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,17 @@ private SubmodelElement decideOnMapping( final Property property, final Context

private SubmodelElement decideOnMapping( final Type type, final Property property, final Context context ) {
if ( type instanceof Entity ) {
return mapToAasSubModelElementCollection( (Entity) type, context );
return mapToAasSubModelElementCollection( (Entity) type, property.getName(), context );
} else {
return findPropertyMapper( property ).mapToAasProperty( type, property, context );
}
}

private SubmodelElementCollection mapToAasSubModelElementCollection( final Entity entity, final Context context ) {
private SubmodelElementCollection mapToAasSubModelElementCollection( final Entity entity, final String name, final Context context ) {
final List<SubmodelElement> submodelElements =
visitProperties( entity.getAllProperties(), context );
return new DefaultSubmodelElementCollection.Builder()
.idShort( ID_PREFIX + entity.getName() )
.idShort( ID_PREFIX + name )
.displayName( LangStringMapper.NAME.map( entity.getPreferredNames() ) )
.description( LangStringMapper.TEXT.map( entity.getDescriptions() ) )
.value( submodelElements )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AspectModelAASGeneratorTest {
AspectModelAASGenerator generator = new AspectModelAASGenerator();

@Test
void generateAasxWithAspectDataForMultilanguageText() throws IOException, DeserializationException, SAXException {
void generateAasxWithAspectDataForMultilanguageText() throws IOException, DeserializationException {
final Environment env = getAssetAdministrationShellFromAspectWithData( TestAspect.ASPECT_WITH_MULTI_LANGUAGE_TEXT );
assertThat( env.getSubmodels() )
.singleElement()
Expand Down Expand Up @@ -218,8 +218,8 @@ void testGenerateAasxFromBammAspectWithEitherWithComplexTypes() throws IOExcepti
assertEquals( 1, env.getSubmodels().size(), "Not exactly one Submodel in AAS." );
assertEquals( 1, env.getSubmodels().get( 0 ).getSubmodelElements().size(), 1, "Not exactly one Element in SubmodelElements." );
final SubmodelElementList elementCollection = ((SubmodelElementList) env.getSubmodels().get( 0 ).getSubmodelElements().get( 0 ));
final Set<String> testValues = Set.of( "id_RightEntity", "id_LeftEntity" );
assertTrue( elementCollection.getValue().stream().anyMatch( x -> testValues.contains( x.getIdShort() ) ), "Neither left nor right entity contained." );
final List<String> testValues = List.of( "id_testProperty", "id_testProperty" );
assertTrue( elementCollection.getValue().stream().anyMatch( x -> testValues.contains( x.getIdShort() ) ), "Neither LeftEntity (with id_testProperty) nor RightEntity (with id_testProperty) contained." );

final Set<String> semanticIds =
Set.of( "urn:samm:org.eclipse.esmf.test:1.0.0#result",
Expand Down Expand Up @@ -360,7 +360,7 @@ private Environment getAssetAdministrationShellFromAspect( final TestAspect test
}

private Environment getAssetAdministrationShellFromAspectWithData( final TestAspect testAspect )
throws DeserializationException, IOException, SAXException {
throws DeserializationException, IOException {
final Aspect aspect = loadAspect( testAspect );
final JsonNode aspectData = loadPayload( testAspect );
final ByteArrayOutputStream out = generator.generateXmlOutput( Map.of( aspect, aspectData ) );
Expand Down

0 comments on commit 074e7f5

Please sign in to comment.