|
31 | 31 | import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer;
|
32 | 32 | import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer;
|
33 | 33 | import org.eclipse.digitaltwin.aas4j.v3.model.Environment;
|
34 |
| -import org.junit.jupiter.api.Disabled; |
35 | 34 | import org.junit.jupiter.api.Test;
|
36 | 35 | import org.junit.jupiter.params.ParameterizedTest;
|
37 | 36 | import org.junit.jupiter.params.provider.EnumSource;
|
38 | 37 |
|
39 | 38 | class AasToAspectModelGeneratorTest {
|
40 | 39 |
|
41 | 40 | @Test
|
42 |
| - @Disabled( "IDTA-provided sample files can currently not be read with AAS4J" ) |
43 | 41 | void testTranslateDigitalNameplate() {
|
44 | 42 | final InputStream aasx = AasToAspectModelGeneratorTest.class.getClassLoader()
|
45 |
| - .getResourceAsStream( "Sample_ZVEI_Digital_Nameplate_V10.aasx" ); |
| 43 | + .getResourceAsStream( "idta/Sample_ZVEI_Digital_Nameplate_V10.aasx" ); |
46 | 44 | final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromAasx( aasx );
|
47 | 45 | assertThatCode( aspectModelGenerator::generateAspects ).doesNotThrowAnyException();
|
48 | 46 | }
|
49 | 47 |
|
| 48 | + @Test |
| 49 | + void testSeeReferences() { |
| 50 | + final InputStream inputStream = AasToAspectModelGeneratorTest.class.getClassLoader().getResourceAsStream( |
| 51 | + "idta/IDTA 02022-1-0_Template_Wireless Communication.aasx" ); |
| 52 | + final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromAasx( inputStream ); |
| 53 | + final List<Aspect> aspects = aspectModelGenerator.generateAspects(); |
| 54 | + |
| 55 | + assertThatCode( aspectModelGenerator::generateAspects ).doesNotThrowAnyException(); |
| 56 | + |
| 57 | + aspects.stream() |
| 58 | + .flatMap( aspect -> aspect.getProperties().stream() ) |
| 59 | + .flatMap( property -> property.getSee().stream() ) |
| 60 | + .forEach( see -> { |
| 61 | + assertThat( see ).doesNotContain( "/ " ); |
| 62 | + } ); |
| 63 | + } |
| 64 | + |
50 | 65 | @ParameterizedTest
|
51 | 66 | @EnumSource( TestAspect.class )
|
52 | 67 | void testRoundtripConversion( final TestAspect testAspect ) throws DeserializationException {
|
|
0 commit comments