Skip to content

Commit c0e853e

Browse files
authored
Feature/update to latest sdk version (#48)
* Update to latest sdk version and update aspect models files and postman collection * Update test files for new sdk upgrade
1 parent a759532 commit c0e853e

File tree

19 files changed

+119
-84
lines changed

19 files changed

+119
-84
lines changed

pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
<main.class>org.eclipse.esmf.ame.Application</main.class>
3939

4040
<!-- Internal esmf dependencies -->
41-
<esmf-sdk-version>2.2.0</esmf-sdk-version>
41+
<esmf-sdk-version>2.3.2</esmf-sdk-version>
4242

4343
<!-- Versions of third party dependencies -->
4444
<spring-boot-version>3.0.0</spring-boot-version>
4545
<lombok-version>1.18.24</lombok-version>
46-
<commons-io-version>2.11.0</commons-io-version>
46+
<commons-io-version>2.13.0</commons-io-version>
4747
<commons-validator-version>1.7</commons-validator-version>
4848
<port-allocator-version>1.2</port-allocator-version>
4949
<process-exec-version>0.9</process-exec-version>
@@ -223,6 +223,11 @@
223223
<artifactId>slf4j-api</artifactId>
224224
<version>${slf4j-api-version}</version>
225225
</dependency>
226+
<dependency>
227+
<groupId>commons-io</groupId>
228+
<artifactId>commons-io</artifactId>
229+
<version>${commons-io-version}</version>
230+
</dependency>
226231
<dependency>
227232
<groupId>jakarta.servlet</groupId>
228233
<artifactId>jakarta.servlet-api</artifactId>

postman/ame.postman_collection.json

Lines changed: 19 additions & 20 deletions
Large diffs are not rendered by default.

postman/ame.postman_environment.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"key": "currentSammVersion",
12-
"value": "2.0.0",
12+
"value": "2.1.0",
1313
"enabled": true
1414
},
1515
{
@@ -26,6 +26,6 @@
2626
}
2727
],
2828
"_postman_variable_scope": "environment",
29-
"_postman_exported_at": "2023-03-28T14:27:49.657Z",
30-
"_postman_exported_using": "Postman/10.12.0"
29+
"_postman_exported_at": "2023-09-28T07:40:37.230Z",
30+
"_postman_exported_using": "Postman/10.16.0"
3131
}

src/test/java/org/eclipse/esmf/ame/repository/strategy/LocalFolderResolverStrategyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void testGetModelFileNotFound() {
8787
void testGetModel() {
8888
final String result = localFolderResolverStrategy.getModelAsString( NAMESPACE_VERSION, MODEL );
8989

90-
assertTrue( result.contains( "<urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#>" ) );
90+
assertTrue( result.contains( "<urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#>" ) );
9191
}
9292

9393
@Test

src/test/java/org/eclipse/esmf/ame/services/ModelServiceTest.java

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.eclipse.esmf.ame.model.migration.Namespaces;
3030
import org.eclipse.esmf.ame.model.validation.ViolationReport;
3131
import org.eclipse.esmf.ame.repository.strategy.LocalFolderResolverStrategy;
32-
import org.junit.jupiter.api.Disabled;
3332
import org.junit.jupiter.api.Test;
3433
import org.junit.jupiter.api.extension.ExtendWith;
3534
import org.mockito.MockedStatic;
@@ -59,9 +58,15 @@ class ModelServiceTest {
5958
private static final Path MIGRATION_WORKSPACE_PATH = Path.of( RESOURCE_PATH.toString(), "workspace-to-migrate" );
6059
private static final Path TO_MIGRATE_WORKSPACE_ONE = Path.of( MIGRATION_WORKSPACE_PATH.toString(),
6160
"io.migrate-workspace-one", VERSION );
61+
62+
private static final Path MIGRATE_WORKSPACE_ONE = Path.of( RESOURCE_PATH.toString(), "io.migrate-workspace-one",
63+
VERSION );
6264
private static final Path TO_MIGRATE_WORKSPACE_TWO = Path.of( MIGRATION_WORKSPACE_PATH.toString(),
6365
"io.migrate-workspace-two", VERSION );
6466

67+
private static final Path MIGRATE_WORKSPACE_TWO = Path.of( RESOURCE_PATH.toString(), "io.migrate-workspace-two",
68+
VERSION );
69+
6570
private static final String TEST_MODEL = "AspectModelForService.ttl";
6671
private static final String TEST_MODEL_TO_DELTE = "FileToDelete.ttl";
6772
private static final String TEST_MODEL_NOT_FOUND = "NOTFOUND.ttl";
@@ -106,7 +111,6 @@ void testDeleteModel() {
106111
() -> modelService.getModel( NAMESPACE_VERSION, TEST_MODEL_TO_DELTE ) );
107112
}
108113

109-
@Disabled( "Should be reactivated as soon as there is something to migrate again." )
110114
@Test
111115
void testMigrateModel() throws IOException {
112116
final Path storagePath = Path.of( TEST_NAMESPACE_PATH.toString(), "OldAspectModel.ttl" );
@@ -151,10 +155,18 @@ void testMigrateWorkspaceWithoutVersionUpgrade() throws IOException {
151155
assertEquals( "ToMigrateTwo.ttl", namespaces.namespaces.get( 1 ).files.get( 1 ).getName() );
152156
assertEquals( true, namespaces.namespaces.get( 1 ).files.get( 1 ).getSuccess() );
153157

154-
final String migratedModelOne = Files.readString( OneToMigrateOne.toPath(), StandardCharsets.UTF_8 );
155-
final String migratedModelTwo = Files.readString( OneToMigrateTwo.toPath(), StandardCharsets.UTF_8 );
156-
final String migratedModelThree = Files.readString( TwoToMigrateOne.toPath(), StandardCharsets.UTF_8 );
157-
final String migratedModelFour = Files.readString( TwoToMigrateTwo.toPath(), StandardCharsets.UTF_8 );
158+
final String migratedModelOne = Files.readString(
159+
new File( MIGRATE_WORKSPACE_ONE + File.separator + "ToMigrateOne.ttl" ).toPath(),
160+
StandardCharsets.UTF_8 );
161+
final String migratedModelTwo = Files.readString(
162+
new File( MIGRATE_WORKSPACE_ONE + File.separator + "ToMigrateTwo.ttl" ).toPath(),
163+
StandardCharsets.UTF_8 );
164+
final String migratedModelThree = Files.readString(
165+
new File( MIGRATE_WORKSPACE_TWO + File.separator + "ToMigrateOne.ttl" ).toPath(),
166+
StandardCharsets.UTF_8 );
167+
final String migratedModelFour = Files.readString(
168+
new File( MIGRATE_WORKSPACE_TWO + File.separator + "ToMigrateTwo.ttl" ).toPath(),
169+
StandardCharsets.UTF_8 );
158170

159171
checkMigratedModel( migratedModelOne );
160172
checkMigratedModel( migratedModelTwo );
@@ -164,9 +176,9 @@ void testMigrateWorkspaceWithoutVersionUpgrade() throws IOException {
164176
}
165177

166178
private void checkMigratedModel( final String migratedModel ) {
167-
assertTrue( migratedModel.contains( "@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#>" ) );
168-
assertTrue( migratedModel.contains( "@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#>" ) );
169-
assertTrue( migratedModel.contains( "@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#>" ) );
170-
assertTrue( migratedModel.contains( "@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#>" ) );
179+
assertTrue( migratedModel.contains( "@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#>" ) );
180+
assertTrue( migratedModel.contains( "@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#>" ) );
181+
assertTrue( migratedModel.contains( "@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#>" ) );
182+
assertTrue( migratedModel.contains( "@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#>" ) );
171183
}
172184
}
3 Bytes
Binary file not shown.

src/test/resources/services/org.eclipse.esmf.example/1.0.0/AspectModelForService.ttl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#
1010
# SPDX-License-Identifier: MPL-2.0
1111

12-
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> .
13-
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> .
14-
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> .
15-
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> .
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> .
14+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> .
15+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> .
1616
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
1717
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
1818
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

src/test/resources/services/org.eclipse.esmf.example/1.0.0/AspectModelForStrategyWithExtRef.ttl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#
1010
# SPDX-License-Identifier: MPL-2.0
1111

12-
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> .
13-
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> .
14-
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> .
15-
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> .
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> .
14+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> .
15+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> .
1616
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
1717
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
1818
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

src/test/resources/services/org.eclipse.esmf.example/1.0.0/FileToDelete.ttl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#
1010
# SPDX-License-Identifier: MPL-2.0
1111

12-
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> .
13-
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> .
14-
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> .
15-
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> .
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> .
14+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> .
15+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> .
1616
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
1717
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
1818
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> .
2+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> .
3+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> .
4+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> .
5+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
6+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
8+
@prefix : <urn:samm:org.eclipse.esmf.example:1.0.0#> .
9+
10+
:OldAspectModel a samm:Aspect ;
11+
samm:properties ( :property ) ;
12+
samm:operations ( ) .
13+
14+
:property a samm:Property ;
15+
samm:characteristic :Characteristic .
16+
17+
:Characteristic a samm:Characteristic ;
18+
samm:dataType xsd:string .
19+

0 commit comments

Comments
 (0)