Skip to content

Commit 83f5844

Browse files
committed
Fix broken test models
1 parent 92871d0 commit 83f5844

File tree

8 files changed

+39
-13
lines changed

8 files changed

+39
-13
lines changed

core/sds-aspect-model-validator/src/test/java/io/openmanufacturing/sds/aspectmodel/validation/services/AspectModelValidatorTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.Collection;
2020

2121
import org.junit.jupiter.params.ParameterizedTest;
22+
import org.junit.jupiter.params.provider.EnumSource;
2223
import org.junit.jupiter.params.provider.MethodSource;
2324
import org.topbraid.shacl.vocabulary.SH;
2425

@@ -59,6 +60,33 @@ public void testValidAspect( final KnownVersion metaModelVersion ) {
5960
assertThat( result.getValidationErrors() ).hasSize( 0 );
6061
}
6162

63+
@ParameterizedTest
64+
@EnumSource( value = TestAspect.class, mode = EnumSource.Mode.EXCLUDE, names = {
65+
"ASPECT_WITH_CONSTRAINTS",
66+
// uses bamm-c:OPEN which is not specified, see https://github.com/OpenManufacturingPlatform/sds-bamm-aspect-meta-model/issues/174
67+
"ASPECT_WITH_FIXED_POINT",
68+
"ASPECT_WITH_FIXED_POINT_CONSTRAINT",
69+
"ASPECT_WITH_LANGUAGE_CONSTRAINT",
70+
"ASPECT_WITH_RANGE_CONSTRAINT_ON_CONSTRAINED_NUMERIC_TYPE", // uses bamm-c:OPEN
71+
"ASPECT_WITH_RANGE_CONSTRAINT_WITHOUT_MIN_MAX_DOUBLE_VALUE", // uses bamm-c:OPEN
72+
"ASPECT_WITH_RANGE_CONSTRAINT_WITHOUT_MIN_MAX_INTEGER_VALUE", // uses bamm-c:OPEN
73+
"ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_LOWER_BOUND", // uses bamm-c:OPEN
74+
"ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_LOWER_BOUND_INCL_BOUND_DEFINITION", // uses bamm-c:OPEN
75+
"ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_MIN_VALUE", // uses bamm-c:OPEN
76+
"ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_UPPER_BOUND", // uses bamm-c:OPEN
77+
"ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_UPPER_BOUND_INCL_BOUND_DEFINITION" // uses bamm-c:OPEN
78+
} )
79+
public void testValidateTestAspectModel( final TestAspect testAspect ) {
80+
final Try<VersionedModel> tryModel = TestResources.getModel( testAspect, KnownVersion.getLatest() );
81+
final VersionedModel versionedModel = tryModel.get();
82+
83+
final ValidationReport report = service.validate( tryModel );
84+
if ( !report.conforms() ) {
85+
report.getValidationErrors().forEach( System.out::println );
86+
}
87+
assertThat( report.conforms() ).isTrue();
88+
}
89+
6290
@ParameterizedTest
6391
@MethodSource( value = "versionsUpToIncluding1_0_0" )
6492
public void testInvalidAspectMissingProperties( final KnownVersion metaModelVersion ) {

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithConstraint.ttl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
bamm:description "Test Constraint"@en ;
7979
bamm-c:constraint [
8080
a bamm-c:RangeConstraint ;
81-
bamm-c:minValue "10"^^xsd:int ;
82-
bamm-c:maxValue "15"^^xsd:int ;
81+
bamm-c:minValue "10"^^xsd:integer ;
82+
bamm-c:maxValue "15"^^xsd:integer ;
8383
bamm-c:upperBoundDefinition bamm-c:AT_MOST ;
8484
bamm-c:lowerBoundDefinition bamm-c:AT_LEAST ;
8585
] ;
@@ -90,8 +90,8 @@
9090
bamm:description "Test Constraint"@en ;
9191
bamm-c:constraint [
9292
a bamm-c:RangeConstraint ;
93-
bamm-c:minValue "100"^^xsd:int ;
94-
bamm-c:maxValue "112"^^xsd:int ;
93+
bamm-c:minValue "100"^^xsd:float ;
94+
bamm-c:maxValue "112"^^xsd:float ;
9595
bamm-c:upperBoundDefinition bamm-c:AT_MOST ;
9696
bamm-c:lowerBoundDefinition bamm-c:AT_LEAST ;
9797
] ;

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithEvent.ttl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
:SomeEvent a bamm:Event ;
2626
bamm:preferredName "Some Event"@en ;
2727
bamm:description "This is some event"@en ;
28-
bamm:properties ( :testProperty ) .
28+
bamm:parameters ( :testProperty ) .
2929

3030
:testProperty a bamm:Property ;
3131
bamm:preferredName "Test Property"@en ;

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithFixedPoint.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
bamm:preferredName "Test Fixed Point"@en ;
3232
bamm:description "This is a test fixed point constraint."@en ;
3333
bamm:see <http://example.com/omp> ;
34-
bamm-c:scale "5"^^xsd:nonNegativeInteger ;
35-
bamm-c:integer "3"^^xsd:nonNegativeInteger ;
34+
bamm-c:scale "5"^^xsd:positiveInteger ;
35+
bamm-c:integer "3"^^xsd:positiveInteger ;
3636
] ;
3737
bamm-c:baseCharacteristic :Measurement .
3838

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithFixedPointConstraint.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
bamm:preferredName "Test Fixed Point"@en ;
3232
bamm:description "This is a test fixed point constraint."@en ;
3333
bamm:see <http://example.com/omp> ;
34-
bamm-c:scale "5"^^xsd:nonNegativeInteger ;
35-
bamm-c:integer "3"^^xsd:nonNegativeInteger ;
34+
bamm-c:scale "5"^^xsd:positiveInteger ;
35+
bamm-c:integer "3"^^xsd:positiveInteger ;
3636
] ;
3737
bamm-c:baseCharacteristic :Measurement .
3838

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithLanguageConstraint.ttl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
bamm:preferredName "Test Language Constraint"@en ;
3737
bamm:description "This is a test language constraint."@en ;
3838
bamm:see <http://example.com/omp> ;
39-
bamm-c:languageCode "de-DE" ;
39+
bamm-c:languageCode "de" ;
4040
] ;
4141
bamm-c:baseCharacteristic bamm-c:Text .

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithStringEnumeration.ttl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
bamm:operations ( ) .
2222

2323
:enumerationProperty a bamm:Property ;
24-
bamm:preferredName ""@en ;
25-
bamm:description ""@en ;
2624
bamm:characteristic [
2725
a bamm-c:Enumeration ;
2826
bamm:dataType xsd:string ;

core/sds-test-aspect-models/src/main/resources/valid/bamm_2_0_0/io.openmanufacturing.test/1.0.0/AspectWithUsedAndUnusedEither.ttl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
bamm:see <http://example.com/me> ;
5959
bamm:dataType xsd:float .
6060

61-
:UnusedRightType a bamm:Characteristic ;
61+
:NonUsedRightType a bamm:Characteristic ;
6262
bamm:preferredName "Right Type"@en ;
6363
bamm:description "Right Type Characteristic"@en ;
6464
bamm:see <http://example.com/omp> ;

0 commit comments

Comments
 (0)