-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
1,947 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
core/apps/ame-e2e/src/fixtures/change-namespace/aspect-workspace-one.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
# | ||
# See the AUTHORS file(s) distributed with this work for | ||
# additional information regarding authorship. | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.examples.one:1.0.0#> . | ||
|
||
:AspectDefault a samm:Aspect ; | ||
samm:properties (:property1) ; | ||
samm:operations (); | ||
samm:events () . | ||
|
||
:property1 a samm:Property; | ||
samm:characteristic :Characteristic1 . | ||
|
||
:Characteristic1 a samm:Characteristic ; | ||
samm:dataType xsd:string . |
30 changes: 30 additions & 0 deletions
30
core/apps/ame-e2e/src/fixtures/change-namespace/aspect-workspace-three.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
# | ||
# See the AUTHORS file(s) distributed with this work for | ||
# additional information regarding authorship. | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.examples.two:2.0.0#> . | ||
|
||
:NewName a samm:Aspect ; | ||
samm:properties (:property1) ; | ||
samm:operations (); | ||
samm:events () . | ||
|
||
:property1 a samm:Property; | ||
samm:characteristic :Characteristic1 . | ||
|
||
:Characteristic1 a samm:Characteristic ; | ||
samm:dataType xsd:string . |
30 changes: 30 additions & 0 deletions
30
core/apps/ame-e2e/src/fixtures/change-namespace/aspect-workspace-two.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
# | ||
# See the AUTHORS file(s) distributed with this work for | ||
# additional information regarding authorship. | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.examples.two:2.0.0#> . | ||
|
||
:AspectDefault a samm:Aspect ; | ||
samm:properties (:property1) ; | ||
samm:operations (); | ||
samm:events () . | ||
|
||
:property1 a samm:Property; | ||
samm:characteristic :Characteristic1 . | ||
|
||
:Characteristic1 a samm:Characteristic ; | ||
samm:dataType xsd:string . |
24 changes: 24 additions & 0 deletions
24
...reference/different-namespace/model-with-entity-that-extends-from-different-namespace.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.examples:1.0.0#> . | ||
@prefix ext-different: <urn:samm:org.eclipse.different:1.0.0#> . | ||
|
||
:AspectWithExtendedEntity a samm:Aspect ; | ||
samm:properties ( :property1 ) ; | ||
samm:operations ( ) ; | ||
samm:events ( ) . | ||
|
||
:property1 a samm:Property ; | ||
samm:characteristic :Characteristic1 . | ||
|
||
:Characteristic1 a samm:Characteristic ; | ||
samm:dataType :Entity1 . | ||
|
||
:Entity1 a samm:Entity ; | ||
samm:extends ext-different:DifferentEntity1 ; | ||
samm:properties ( ) . |
22 changes: 22 additions & 0 deletions
22
core/apps/ame-e2e/src/fixtures/external-reference/different-namespace/model-with-entity.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.different:1.0.0#> . | ||
|
||
:DifferentAspect a samm:Aspect ; | ||
samm:properties ( :differentProperty1 ) ; | ||
samm:operations ( ) ; | ||
samm:events ( ) . | ||
|
||
:differentProperty1 a samm:Property ; | ||
samm:characteristic :DifferentCharacteristic1 . | ||
|
||
:DifferentCharacteristic1 a samm:Characteristic ; | ||
samm:dataType :DifferentEntity1 . | ||
|
||
:DifferentEntity1 a samm:Entity ; | ||
samm:properties ( ) . |
23 changes: 23 additions & 0 deletions
23
core/apps/ame-e2e/src/fixtures/external-reference/same-namespace/model-with-entity.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.examples:1.0.0#> . | ||
|
||
:AspectWithEntity a samm:Aspect ; | ||
samm:properties ( :property1 ) ; | ||
samm:operations ( ) ; | ||
samm:events ( ) . | ||
|
||
:property1 a samm:Property ; | ||
samm:characteristic :Characteristic1 . | ||
|
||
:Characteristic1 a samm:Characteristic ; | ||
samm:dataType :Entity1 . | ||
|
||
:Entity1 a samm:Entity ; | ||
samm:properties ( ) . | ||
|
24 changes: 24 additions & 0 deletions
24
...pps/ame-e2e/src/fixtures/external-reference/same-namespace/model-with-extended-entity.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.1.0#> . | ||
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#> . | ||
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.1.0#> . | ||
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.1.0#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix : <urn:samm:org.eclipse.examples:1.0.0#> . | ||
|
||
:AspectWithExtendedEntity a samm:Aspect ; | ||
samm:properties ( :property2 ) ; | ||
samm:operations ( ) ; | ||
samm:events ( ) . | ||
|
||
:property2 a samm:Property ; | ||
samm:characteristic :characteristic2 . | ||
|
||
:characteristic1 a samm:Characteristic ; | ||
samm:dataType :Entity2 . | ||
|
||
:Entity2 a samm:Entity ; | ||
samm:extends :Entity1 ; | ||
samm:properties ( ) . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
core/apps/ame-e2e/src/integration/editor/entity-that-extends-external-entity.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/* | ||
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH | ||
* | ||
* See the AUTHORS file(s) distributed with this work for | ||
* additional information regarding authorship. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
/// <reference types="Cypress" /> | ||
|
||
import {SELECTOR_notificationsBtn, SELECTOR_notificationsDialogCloseButton} from '../../support/constants'; | ||
|
||
describe('Test loading aspect with extended external Entity', () => { | ||
it('should display an error that external reference is not included in the namespace file structure', () => { | ||
cy.intercept('POST', 'http://localhost:9091/ame/api/models/validate', {fixture: 'model-validation-response.json'}); | ||
cy.visitDefault(); | ||
cy.fixture('/external-reference/same-namespace/model-with-extended-entity.txt') | ||
.then(rdfString => cy.loadModel(rdfString)) | ||
.then(() => { | ||
cy.get(SELECTOR_notificationsBtn) | ||
.click({force: true}) | ||
.then(() => | ||
cy | ||
.wait(500) | ||
.get('.mat-mdc-cell') | ||
.contains( | ||
' The Aspect model contains an external reference that is not included in the namespace file structure or is invalid', | ||
) | ||
.should('exist'), | ||
) | ||
.then(() => cy.wait(500).get(SELECTOR_notificationsDialogCloseButton).click({force: true})); | ||
}); | ||
}); | ||
|
||
it('should load a model with an entity that extends an external entity in same namespace', () => { | ||
cy.intercept('POST', 'http://localhost:9091/ame/api/models/validate', {fixture: 'model-validation-response.json'}); | ||
cy.intercept('GET', 'http://localhost:9091/ame/api/models/namespaces?shouldRefresh=true', { | ||
'org.eclipse.examples:1.0.0': ['example.txt'], | ||
}); | ||
|
||
cy.intercept( | ||
{ | ||
method: 'GET', | ||
url: 'http://localhost:9091/ame/api/models', | ||
headers: { | ||
namespace: 'org.eclipse.examples:1.0.0', | ||
'file-name': 'example.txt', | ||
}, | ||
}, | ||
{ | ||
fixture: '/external-reference/same-namespace/model-with-entity.txt', | ||
}, | ||
); | ||
|
||
cy.visitDefault(); | ||
cy.fixture('/external-reference/same-namespace/model-with-extended-entity') | ||
.as('rdfString') | ||
.then(rdfString => cy.loadModel(rdfString)) | ||
.wait(500) | ||
.then(() => cy.getAspect()) | ||
.then(aspect => { | ||
expect(aspect.name).to.equal('AspectWithExtendedEntity'); | ||
cy.shapeExists('AspectWithExtendedEntity').then(() => { | ||
cy.shapeExists('Entity2'); | ||
cy.shapeExists('Entity1'); | ||
}); | ||
}) | ||
.then(() => cy.getUpdatedRDF()) | ||
.then(rdf => { | ||
expect(rdf).to.contain('Entity2 a samm:Entity'); | ||
expect(rdf).to.contain('samm:extends :Entity1'); | ||
}); | ||
}); | ||
|
||
it('should load a model with an entity that extends an external entity in different namespace', () => { | ||
cy.intercept('POST', 'http://localhost:9091/ame/api/models/validate', {fixture: 'model-validation-response.json'}); | ||
cy.intercept('GET', 'http://localhost:9091/ame/api/models/namespaces?shouldRefresh=true', { | ||
'org.eclipse.different:1.0.0': ['example.txt'], | ||
}); | ||
|
||
cy.intercept( | ||
{ | ||
method: 'GET', | ||
url: 'http://localhost:9091/ame/api/models', | ||
headers: { | ||
namespace: 'org.eclipse.different:1.0.0', | ||
'file-name': 'example.txt', | ||
}, | ||
}, | ||
{ | ||
fixture: '/external-reference/different-namespace/model-with-entity.txt', | ||
}, | ||
); | ||
|
||
cy.visitDefault(); | ||
cy.fixture('/external-reference/different-namespace/model-with-entity-that-extends-from-different-namespace') | ||
.as('rdfString') | ||
.then(rdfString => cy.loadModel(rdfString)) | ||
.wait(500) | ||
.then(() => cy.getAspect()) | ||
.then(aspect => { | ||
expect(aspect.name).to.equal('AspectWithExtendedEntity'); | ||
cy.shapeExists('AspectWithExtendedEntity').then(() => { | ||
cy.shapeExists('Entity1'); | ||
cy.shapeExists('DifferentEntity1'); | ||
}); | ||
}) | ||
.then(() => cy.getUpdatedRDF()) | ||
.then(rdf => { | ||
expect(rdf).to.contain(':Entity1 a samm:Entity'); | ||
expect(rdf).to.contain('samm:extends ext-different:DifferentEntity1'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.