Skip to content

Commit d597ee2

Browse files
authored
Merge pull request #136 from bci-oss/135-properties-and-operations-not-mandatory-any-more
Make presence of `bamm:properties` and `bamm:operations` optional
2 parents ff2a272 + f881851 commit d597ee2

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

core/sds-aspect-meta-model-java/src/test/java/io/openmanufacturing/sds/metamodel/loader/AspectMetaModelInstantiatorTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
package io.openmanufacturing.sds.metamodel.loader;
1515

1616
import static org.assertj.core.api.Assertions.assertThat;
17+
import static org.assertj.core.api.Assertions.assertThatCode;
1718

1819
import java.util.List;
1920
import java.util.Locale;
2021
import java.util.Optional;
2122

2223
import org.apache.jena.vocabulary.XSD;
2324
import org.junit.jupiter.params.ParameterizedTest;
25+
import org.junit.jupiter.params.provider.EnumSource;
2426
import org.junit.jupiter.params.provider.MethodSource;
2527

2628
import io.openmanufacturing.sds.aspectmetamodel.KnownVersion;
@@ -40,6 +42,13 @@
4042
import io.openmanufacturing.sds.test.TestModel;
4143

4244
public class AspectMetaModelInstantiatorTest extends MetaModelInstantiatorTest {
45+
@ParameterizedTest
46+
@EnumSource( value = TestAspect.class )
47+
public void testLoadAspectExpectSuccess( final TestAspect aspect ) {
48+
assertThatCode( () ->
49+
loadAspect( aspect, KnownVersion.getLatest() )
50+
).doesNotThrowAnyException();
51+
}
4352

4453
@ParameterizedTest
4554
@MethodSource( value = "allVersions" )

core/sds-aspect-model-serializer/src/test/java/io/openmanufacturing/sds/aspectmodel/serializer/RdfModelCreatorVisitorTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ public class RdfModelCreatorVisitorTest extends MetaModelVersions {
4242
* Exclude the test models that contain unused elements; the resulting serialized models can
4343
* never be identical to the original because the unused elements are ignored when loading the
4444
* model and can therefore not be serialized.
45+
* Furthermore, exclude the test model of an Aspect without bamm:properties and bamm:operations,
46+
* since the serialization will always write "bamm:properties ()" (i.e., add the attribute with
47+
* an empty list as value) for now, so here the serialization will differ from the source model
48+
* as well.
4549
*/
4650
@EnumSource( value = TestAspect.class, mode = EnumSource.Mode.EXCLUDE, names = {
4751
"ASPECT_WITH_USED_AND_UNUSED_CHARACTERISTIC",
4852
"ASPECT_WITH_USED_AND_UNUSED_COLLECTION",
4953
"ASPECT_WITH_USED_AND_UNUSED_CONSTRAINT",
5054
"ASPECT_WITH_USED_AND_UNUSED_EITHER",
51-
"ASPECT_WITH_USED_AND_UNUSED_ENUMERATION"
55+
"ASPECT_WITH_USED_AND_UNUSED_ENUMERATION",
56+
"ASPECT_WITHOUT_PROPERTIES_AND_OPERATIONS"
5257
} )
5358
public void testRdfModelCreatorVisitor( final TestAspect aspect ) {
5459
testRdfCreation( aspect, KnownVersion.getLatest() );

core/sds-test-aspect-models/src/main/java/io/openmanufacturing/sds/test/TestAspect.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
public enum TestAspect implements TestModel {
1919
ASPECT,
2020
ASPECT_WITHOUT_LANGUAGE_TAGS,
21+
ASPECT_WITHOUT_PROPERTIES_AND_OPERATIONS,
2122
ASPECT_WITHOUT_SEE_ATTRIBUTE,
2223
ASPECT_WITH_ABSTRACT_ENTITY,
2324
ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix : <urn:bamm:io.openmanufacturing.test:1.0.0#> .
13+
@prefix bamm: <urn:bamm:io.openmanufacturing:meta-model:2.0.0#> .
14+
@prefix bamm-c: <urn:bamm:io.openmanufacturing:characteristic:2.0.0#> .
15+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
16+
17+
:AspectWithoutPropertiesAndOperations a bamm:Aspect ;
18+
bamm:name "AspectWithBoolean" .

0 commit comments

Comments
 (0)