Skip to content

Commit

Permalink
fix conflicts with master
Browse files Browse the repository at this point in the history
  • Loading branch information
larisaVasile committed Apr 8, 2024
2 parents f0ab159 + ccccf94 commit 083e718
Show file tree
Hide file tree
Showing 79 changed files with 1,947 additions and 1,058 deletions.
2 changes: 1 addition & 1 deletion core/apps/ame-e2e/src/fixtures/anonymous-elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
:property3 a samm:Property ;
samm:characteristic [
a samm-c:Trait ;
samm-c:baseCharacteristic [ a samm:Characteristic ] ;
samm-c:baseCharacteristic [ a samm:Characteristic; samm:dataType xsd:string ] ;
samm-c:constraint [ a samm:Constraint ] ;
samm-c:constraint [ a samm:Constraint ]
] .
Expand Down
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 .
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 .
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 .
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 ( ) .
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 ( ) .
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 ( ) .

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 ( ) .

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import {cyHelp} from '../../../support/helpers';
import {
SELECTOR_ecProperty,
SELECTOR_fileMenuFindElements,
SELECTOR_namespaceFileMenuButton,
SELECTOR_openNamespacesButton,
SELECTOR_searchElementsInp,
SELECTOR_workspaceBtn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import {cyHelp} from '../../../support/helpers';
import {
SELECTOR_ecProperty,
SELECTOR_fileMenuFindElements,
SELECTOR_namespaceFileMenuButton,
SELECTOR_openNamespacesButton,
SELECTOR_searchElementsInp,
SELECTOR_workspaceBtn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import {cyHelp} from '../../../support/helpers';
import {
SELECTOR_ecProperty,
SELECTOR_fileMenuFindElements,
SELECTOR_namespaceFileMenuButton,
SELECTOR_openNamespacesButton,
SELECTOR_searchElementsInp,
SELECTOR_workspaceBtn,
Expand Down
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');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ describe('Test load aspect model with anonymous elements', () => {
':Trait1 a samm-c:Trait;\n' +
' samm-c:baseCharacteristic :Characteristic3;\n' +
' samm-c:constraint :Constraint1, :Constraint2.\n' +
':Characteristic3 a samm:Characteristic.\n' +
':Characteristic3 a samm:Characteristic;\n' +
' samm:dataType xsd:string.\n' +
':Constraint1 a samm:Constraint.\n' +
':Constraint2 a samm:Constraint.\n',
':Constraint2 a samm:Constraint.',
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import {SELECTOR_settingsButton, SettingsDialogSelectors} from '../../support/constants';

describe('Auto Validate', () => {
it('should open settings dialog', () => {
it('should open editor settings dialog', () => {
cy.visitDefault()
.then(() => cy.startModelling())
.then(() => {
Expand Down
Loading

0 comments on commit 083e718

Please sign in to comment.