|
1 | 1 | package org.eclipse.esmf.samm; |
2 | 2 |
|
| 3 | +import org.eclipse.esmf.samm.validation.SemanticError; |
| 4 | + |
3 | 5 | import org.junit.jupiter.params.ParameterizedTest; |
4 | 6 | import org.junit.jupiter.params.provider.MethodSource; |
5 | 7 |
|
6 | 8 | class ValueTest extends AbstractShapeTest { |
7 | 9 |
|
8 | 10 | @ParameterizedTest |
9 | 11 | @MethodSource( value = "versionsStartingWith2_2_0" ) |
10 | | - void defaultValueDefinition ( final KnownVersion metaModelVersion ) { |
| 12 | + void defaultValueDefinition( final KnownVersion metaModelVersion ) { |
11 | 13 | checkValidity( "value-shape", "DefaultValue", metaModelVersion ); |
12 | 14 | } |
13 | 15 |
|
| 16 | + @ParameterizedTest |
| 17 | + @MethodSource( "versionsStartingWith2_2_0" ) |
| 18 | + void invalidValueDeclarationExpectedFailure( KnownVersion metaModelVersion ) { |
| 19 | + final SemanticError expectedError = new SemanticError( "Property needs to have at least 1 values, but found 0", |
| 20 | + testNamespacePrefix + "GreenLight", "urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#value", violationUrn, "" ); |
| 21 | + |
| 22 | + expectSemanticValidationErrors( "value-shape", "InvalidValueDeclaration", metaModelVersion, expectedError ); |
| 23 | + } |
| 24 | + |
14 | 25 | @ParameterizedTest |
15 | 26 | @MethodSource( value = "versionsStartingWith2_2_0" ) |
16 | | - void valueWithEnumeration ( final KnownVersion metaModelVersion ) { |
| 27 | + void valueWithEnumeration( final KnownVersion metaModelVersion ) { |
17 | 28 | checkValidity( "value-shape", "ValueWithEnumeration", metaModelVersion ); |
18 | 29 | } |
19 | 30 |
|
20 | 31 | @ParameterizedTest |
21 | 32 | @MethodSource( value = "versionsStartingWith2_2_0" ) |
22 | | - void multipleValueWithEnumeration ( final KnownVersion metaModelVersion ) { |
| 33 | + void multipleValueWithEnumeration( final KnownVersion metaModelVersion ) { |
23 | 34 | checkValidity( "value-shape", "MultipleValueWithEnumeration", metaModelVersion ); |
24 | 35 | } |
25 | 36 |
|
26 | 37 | @ParameterizedTest |
27 | 38 | @MethodSource( value = "versionsStartingWith2_2_0" ) |
28 | | - void referenceValueWithProperty ( final KnownVersion metaModelVersion ) { |
| 39 | + void referenceValueWithProperty( final KnownVersion metaModelVersion ) { |
29 | 40 | checkValidity( "value-shape", "ReferenceValueWithProperty", metaModelVersion ); |
30 | 41 | } |
31 | 42 |
|
32 | 43 | @ParameterizedTest |
33 | 44 | @MethodSource( value = "versionsStartingWith2_2_0" ) |
34 | | - void anonymousDescribedValueInExampleValue ( final KnownVersion metaModelVersion ) { |
| 45 | + void anonymousDescribedValueInExampleValue( final KnownVersion metaModelVersion ) { |
35 | 46 | checkValidity( "value-shape", "AnonymousDescribedValueInExampleValue", metaModelVersion ); |
36 | 47 | } |
37 | 48 | } |
0 commit comments