Skip to content

Commit c5f2b1b

Browse files
committed
test: Add test case for diagram auto layout
1 parent 3e9920e commit c5f2b1b

File tree

3 files changed

+49
-20
lines changed

3 files changed

+49
-20
lines changed

tests/data/ContextDiagram.aird

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/physical.odesign#//@ownedViewpoints[name='Physical%20Architecture']/@ownedRepresentations[name='Physical%20Architecture%20Blank']"/>
2424
<target xmi:type="org.polarsys.capella.core.data.pa:PhysicalComponentPkg" href="ContextDiagram.capella#f7e20d0e-d219-4867-a287-5a56e2d9a63c"/>
2525
</ownedRepresentationDescriptors>
26-
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_YOs7ICf-Ee-vh6l6UBOpjg" name="[PAB] Example Physical Function Context Diagram" repPath="#_YOoCoCf-Ee-vh6l6UBOpjg" changeId="1733759204537">
26+
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_YOs7ICf-Ee-vh6l6UBOpjg" name="[PAB] Example Physical Function Context Diagram" repPath="#_YOoCoCf-Ee-vh6l6UBOpjg" changeId="1733763757447">
2727
<eAnnotations xmi:type="description:DAnnotation" uid="_YO5IYCf-Ee-vh6l6UBOpjg" source="https://www.polarsys.org/capella/dannotation/DesactivatedFilters">
2828
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_YO5IYSf-Ee-vh6l6UBOpjg" key="hide.computed.component.exchanges.filter" value="true"/>
2929
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_YO5IYif-Ee-vh6l6UBOpjg" key="hide.computed.physical.links.filter" value="true"/>
@@ -166,7 +166,7 @@
166166
<description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/logical.odesign#//@ownedViewpoints[name='Logical%20Architecture']/@ownedRepresentations[name='Logical%20Architecture%20Blank']"/>
167167
<target xmi:type="org.polarsys.capella.core.data.la:LogicalComponentPkg" href="ContextDiagram.capella#84c0978d-9a32-4f5b-8013-5b0b6adbfd73"/>
168168
</ownedRepresentationDescriptors>
169-
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_-F8egEQVEe-HYPkm31BOJA" name="[LFBD] RFNC 1" repPath="#_-F5bMEQVEe-HYPkm31BOJA" changeId="1733759204537">
169+
<ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_-F8egEQVEe-HYPkm31BOJA" name="[LFBD] RFNC 1" repPath="#_-F5bMEQVEe-HYPkm31BOJA" changeId="1733760200581">
170170
<description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/logical.odesign#//@ownedViewpoints[name='Logical%20Architecture']/@ownedRepresentations[name='Logical%20Function%20Breakdown']"/>
171171
<target xmi:type="org.polarsys.capella.core.data.la:LogicalFunction" href="ContextDiagram.capella#fbfb2b20-b711-4211-9b75-25e38390cdbc"/>
172172
</ownedRepresentationDescriptors>
@@ -14091,7 +14091,7 @@
1409114091
</edges>
1409214092
<edges xmi:type="notation:Edge" xmi:id="_kUY6pCf-Ee-vh6l6UBOpjg" type="4001" element="_kT5LYif-Ee-vh6l6UBOpjg" source="_kUVQMCf-Ee-vh6l6UBOpjg" target="_kUUCEif-Ee-vh6l6UBOpjg">
1409314093
<children xmi:type="notation:Node" xmi:id="_kUY6qCf-Ee-vh6l6UBOpjg" type="6001">
14094-
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_kUY6qSf-Ee-vh6l6UBOpjg" x="4" y="-13"/>
14094+
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_kUY6qSf-Ee-vh6l6UBOpjg" x="-7" y="-10"/>
1409514095
</children>
1409614096
<children xmi:type="notation:Node" xmi:id="_kUY6qif-Ee-vh6l6UBOpjg" type="6002">
1409714097
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_kUY6qyf-Ee-vh6l6UBOpjg" x="-1" y="3"/>
@@ -14397,7 +14397,7 @@
1439714397
<target xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#b3ce3115-da3d-4ef7-abb5-bafcf3193c99"/>
1439814398
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#b3ce3115-da3d-4ef7-abb5-bafcf3193c99"/>
1439914399
<semanticElements xmi:type="org.polarsys.capella.core.data.pa:PhysicalComponent" href="ContextDiagram.capella#793e6da2-d019-4716-a5c5-af8ad550ca5e"/>
14400-
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTe7oCf-Ee-vh6l6UBOpjg" name="PP 1" incomingEdges="_kT4kQCf-Ee-vh6l6UBOpjg" width="1" height="1">
14400+
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTe7oCf-Ee-vh6l6UBOpjg" name="Sub BUS" incomingEdges="_kT4kQCf-Ee-vh6l6UBOpjg" width="1" height="1">
1440114401
<target xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#38c69508-f12f-4e1d-a8c1-a422cbf8f358"/>
1440214402
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#38c69508-f12f-4e1d-a8c1-a422cbf8f358"/>
1440314403
<graphicalFilters xmi:type="diagram:HideLabelFilter" uid="_kTe7oif-Ee-vh6l6UBOpjg"/>
@@ -14444,7 +14444,7 @@
1444414444
<target xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#8ea2373f-a397-4a72-b498-15cbbfc37248"/>
1444514445
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#8ea2373f-a397-4a72-b498-15cbbfc37248"/>
1444614446
<semanticElements xmi:type="org.polarsys.capella.core.data.pa:PhysicalComponent" href="ContextDiagram.capella#5bfc516b-c20d-4007-9a38-5ba0e889d0a4"/>
14447-
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTlpUSf-Ee-vh6l6UBOpjg" name="PP 1" outgoingEdges="_kT5LUCf-Ee-vh6l6UBOpjg _6UBaoCf-Ee-vh6l6UBOpjg" width="1" height="1">
14447+
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTlpUSf-Ee-vh6l6UBOpjg" name="X CA" outgoingEdges="_kT5LUCf-Ee-vh6l6UBOpjg _6UBaoCf-Ee-vh6l6UBOpjg" width="1" height="1">
1444814448
<target xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#2d1e2ad5-3439-4820-baa8-189966407ba2"/>
1444914449
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#2d1e2ad5-3439-4820-baa8-189966407ba2"/>
1445014450
<graphicalFilters xmi:type="diagram:HideLabelFilter" uid="_kTlpUyf-Ee-vh6l6UBOpjg"/>
@@ -14540,7 +14540,7 @@
1454014540
<target xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#ea8cd402-3d9a-469a-a2ce-2bc1252c3a01"/>
1454114541
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#ea8cd402-3d9a-469a-a2ce-2bc1252c3a01"/>
1454214542
<semanticElements xmi:type="org.polarsys.capella.core.data.pa:PhysicalComponent" href="ContextDiagram.capella#b51ccc6f-5f96-4e28-b90e-72463a3b50cf"/>
14543-
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTjNEyf-Ee-vh6l6UBOpjg" name="P1" outgoingEdges="_8w2CZCf-Ee-vh6l6UBOpjg" incomingEdges="_kT5LUCf-Ee-vh6l6UBOpjg" width="1" height="1">
14543+
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTjNEyf-Ee-vh6l6UBOpjg" name="X NSwitch" outgoingEdges="_8w2CZCf-Ee-vh6l6UBOpjg" incomingEdges="_kT5LUCf-Ee-vh6l6UBOpjg" width="1" height="1">
1454414544
<target xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#53c9fe29-18e2-4642-906e-b7507bf0ff39"/>
1454514545
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#53c9fe29-18e2-4642-906e-b7507bf0ff39"/>
1454614546
<graphicalFilters xmi:type="diagram:HideLabelFilter" uid="_kTj0ISf-Ee-vh6l6UBOpjg"/>
@@ -14552,7 +14552,7 @@
1455214552
</ownedStyle>
1455314553
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/physical.odesign#//@ownedViewpoints[name='Physical%20Architecture']/@ownedRepresentations[name='Physical%20Architecture%20Blank']/@defaultLayer/@containerMappings[name='PAB_PC']/@borderedNodeMappings[name='PAB_Port']"/>
1455414554
</ownedBorderedNodes>
14555-
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTj0Iif-Ee-vh6l6UBOpjg" name="P3" outgoingEdges="_kT5LWSf-Ee-vh6l6UBOpjg _8w2CaSf-Ee-vh6l6UBOpjg" width="1" height="1">
14555+
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTj0Iif-Ee-vh6l6UBOpjg" name="X Switch" outgoingEdges="_kT5LWSf-Ee-vh6l6UBOpjg _8w2CaSf-Ee-vh6l6UBOpjg" width="1" height="1">
1455614556
<target xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#f1c0db71-1927-4874-bf3e-0603a88f1d9b"/>
1455714557
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#f1c0db71-1927-4874-bf3e-0603a88f1d9b"/>
1455814558
<graphicalFilters xmi:type="diagram:HideLabelFilter" uid="_kTj0JCf-Ee-vh6l6UBOpjg"/>
@@ -14564,7 +14564,7 @@
1456414564
</ownedStyle>
1456514565
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/physical.odesign#//@ownedViewpoints[name='Physical%20Architecture']/@ownedRepresentations[name='Physical%20Architecture%20Blank']/@defaultLayer/@containerMappings[name='PAB_PC']/@borderedNodeMappings[name='PAB_Port']"/>
1456614566
</ownedBorderedNodes>
14567-
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTj0JSf-Ee-vh6l6UBOpjg" name="P2" outgoingEdges="_8w2Cbif-Ee-vh6l6UBOpjg" incomingEdges="_kT5LYif-Ee-vh6l6UBOpjg" width="1" height="1">
14567+
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTj0JSf-Ee-vh6l6UBOpjg" name="X FSwitch" outgoingEdges="_8w2Cbif-Ee-vh6l6UBOpjg" incomingEdges="_kT5LYif-Ee-vh6l6UBOpjg" width="1" height="1">
1456814568
<target xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#76d9c301-c0ad-4615-9f02-b804b018decf"/>
1456914569
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#76d9c301-c0ad-4615-9f02-b804b018decf"/>
1457014570
<graphicalFilters xmi:type="diagram:HideLabelFilter" uid="_kTkbMCf-Ee-vh6l6UBOpjg"/>
@@ -14790,7 +14790,7 @@
1479014790
<target xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#76e9e937-07c3-4462-b5b3-df5c220b8372"/>
1479114791
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:Part" href="ContextDiagram.capella#76e9e937-07c3-4462-b5b3-df5c220b8372"/>
1479214792
<semanticElements xmi:type="org.polarsys.capella.core.data.pa:PhysicalComponent" href="ContextDiagram.capella#8a6c6ec9-095d-4d8b-9728-69bc79af5f27"/>
14793-
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTmQYif-Ee-vh6l6UBOpjg" name="PP 1" outgoingEdges="_kT4kQCf-Ee-vh6l6UBOpjg" width="1" height="1">
14793+
<ownedBorderedNodes xmi:type="diagram:DNode" uid="_kTmQYif-Ee-vh6l6UBOpjg" name="Deploy BUS 1" outgoingEdges="_kT4kQCf-Ee-vh6l6UBOpjg" width="1" height="1">
1479414794
<target xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#7400c2a3-913f-4a08-aca7-8dd7c389e5e9"/>
1479514795
<semanticElements xmi:type="org.polarsys.capella.core.data.cs:PhysicalPort" href="ContextDiagram.capella#7400c2a3-913f-4a08-aca7-8dd7c389e5e9"/>
1479614796
<graphicalFilters xmi:type="diagram:HideLabelFilter" uid="_kTm3cCf-Ee-vh6l6UBOpjg"/>
@@ -15353,9 +15353,9 @@
1535315353
<children xmi:type="notation:Node" xmi:id="_-GU5A0QVEe-HYPkm31BOJA" type="5002">
1535415354
<layoutConstraint xmi:type="notation:Location" xmi:id="_-G79AUQVEe-HYPkm31BOJA" y="5"/>
1535515355
</children>
15356-
<children xmi:type="notation:Node" xmi:id="_-GU5BUQVEe-HYPkm31BOJA" type="3003" element="_-GAv80QVEe-HYPkm31BOJA">
15357-
<styles xmi:type="notation:ShapeStyle" xmi:id="_-GU5BkQVEe-HYPkm31BOJA" fontName="Fira Code"/>
15358-
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_-GU5B0QVEe-HYPkm31BOJA"/>
15356+
<children xmi:type="notation:Node" xmi:id="_HFCQ8LZHEe-GE6DbV--fbg" type="3003" element="_HE344LZHEe-GE6DbV--fbg">
15357+
<styles xmi:type="notation:ShapeStyle" xmi:id="_HFCQ8bZHEe-GE6DbV--fbg" fontName="Fira Code"/>
15358+
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_HFCQ8rZHEe-GE6DbV--fbg"/>
1535915359
</children>
1536015360
<styles xmi:type="notation:ShapeStyle" xmi:id="_-GU5AUQVEe-HYPkm31BOJA" fontName="Fira Code" fontHeight="8" bold="true"/>
1536115361
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_-G79AEQVEe-HYPkm31BOJA" x="10" y="30" width="131" height="50"/>
@@ -15419,7 +15419,7 @@
1541915419
</ownedAnnotationEntries>
1542015420
<ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_-GAv8EQVEe-HYPkm31BOJA" source="DANNOTATION_CUSTOMIZATION_KEY">
1542115421
<data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_-GAv8UQVEe-HYPkm31BOJA">
15422-
<computedStyleDescriptions xmi:type="style:SquareDescription" xmi:id="_-GAv8kQVEe-HYPkm31BOJA" borderSizeComputationExpression="1" labelExpression="service:capellaLabelService(view, diagram)" sizeComputationExpression="7" labelPosition="node" resizeKind="NSEW">
15422+
<computedStyleDescriptions xmi:type="style:SquareDescription" xmi:id="_HE3R0LZHEe-GE6DbV--fbg" borderSizeComputationExpression="1" labelExpression="service:capellaLabelService(view, diagram)" sizeComputationExpression="7" labelPosition="node" resizeKind="NSEW" width="-1" height="-1">
1542315423
<borderColor xmi:type="description:UserFixedColor" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/common.odesign#//@userColorsPalettes[name='Migration%20Palette']/@entries[name='_CAP_xAB_Function_Border_Green']"/>
1542415424
<labelFormat>bold</labelFormat>
1542515425
<labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
@@ -15430,7 +15430,7 @@
1543015430
<ownedDiagramElements xmi:type="diagram:DNode" uid="_-GAI4EQVEe-HYPkm31BOJA" name="RFNC 1" incomingEdges="_-d9V4kQVEe-HYPkm31BOJA _-u5U6kQVEe-HYPkm31BOJA" width="7" height="7" resizeKind="NSEW">
1543115431
<target xmi:type="org.polarsys.capella.core.data.la:LogicalFunction" href="ContextDiagram.capella#fbfb2b20-b711-4211-9b75-25e38390cdbc"/>
1543215432
<semanticElements xmi:type="org.polarsys.capella.core.data.la:LogicalFunction" href="ContextDiagram.capella#fbfb2b20-b711-4211-9b75-25e38390cdbc"/>
15433-
<ownedStyle xmi:type="diagram:Square" uid="_-GAv80QVEe-HYPkm31BOJA" description="_-GAv8kQVEe-HYPkm31BOJA" borderSize="1" borderSizeComputationExpression="1" borderColor="9,92,46" labelPosition="node" width="-1" height="-1" color="197,255,166">
15433+
<ownedStyle xmi:type="diagram:Square" uid="_HE344LZHEe-GE6DbV--fbg" description="_HE3R0LZHEe-GE6DbV--fbg" borderSize="1" borderSizeComputationExpression="1" borderColor="9,92,46" labelPosition="node" width="-1" height="-1" color="197,255,166">
1543415434
<labelFormat>bold</labelFormat>
1543515435
</ownedStyle>
1543615436
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/logical.odesign#//@ownedViewpoints[name='Logical%20Architecture']/@ownedRepresentations[name='Logical%20Function%20Breakdown']/@defaultLayer/@nodeMappings[name='LFB_LogicalFunction']"/>

tests/data/ContextDiagram.capella

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5076,7 +5076,7 @@ The predator is far away</bodies>
50765076
id="793e6da2-d019-4716-a5c5-af8ad550ca5e" name="Sub PC" kind="FIRMWARE"
50775077
nature="NODE">
50785078
<ownedFeatures xsi:type="org.polarsys.capella.core.data.cs:PhysicalPort"
5079-
id="38c69508-f12f-4e1d-a8c1-a422cbf8f358" name="PP 1">
5079+
id="38c69508-f12f-4e1d-a8c1-a422cbf8f358" name="Sub BUS">
50805080
<ownedComponentPortAllocations xsi:type="org.polarsys.capella.core.data.fa:ComponentPortAllocation"
50815081
id="c2cb630e-be2f-4857-8358-83f4a13da7ad" targetElement="#dea08a09-7a9f-4d65-bd65-9514237e5553"
50825082
sourceElement="#38c69508-f12f-4e1d-a8c1-a422cbf8f358"/>
@@ -5217,19 +5217,19 @@ The predator is far away</bodies>
52175217
id="b51ccc6f-5f96-4e28-b90e-72463a3b50cf" name="Network Switch"
52185218
kind="HARDWARE" nature="NODE">
52195219
<ownedFeatures xsi:type="org.polarsys.capella.core.data.cs:PhysicalPort"
5220-
id="53c9fe29-18e2-4642-906e-b7507bf0ff39" name="P1">
5220+
id="53c9fe29-18e2-4642-906e-b7507bf0ff39" name="X NSwitch">
52215221
<ownedComponentPortAllocations xsi:type="org.polarsys.capella.core.data.fa:ComponentPortAllocation"
52225222
id="56ec9c8a-00ba-4dc2-9183-5c440b6f8198" targetElement="#c014f9ce-eb57-42ed-96f4-42072d4e8827"
52235223
sourceElement="#53c9fe29-18e2-4642-906e-b7507bf0ff39"/>
52245224
</ownedFeatures>
52255225
<ownedFeatures xsi:type="org.polarsys.capella.core.data.cs:PhysicalPort"
5226-
id="f1c0db71-1927-4874-bf3e-0603a88f1d9b" name="P3">
5226+
id="f1c0db71-1927-4874-bf3e-0603a88f1d9b" name="X Switch">
52275227
<ownedComponentPortAllocations xsi:type="org.polarsys.capella.core.data.fa:ComponentPortAllocation"
52285228
id="e6ffdec4-a443-46b5-b190-e6e006ae28b7" targetElement="#debe5e5c-c234-4f20-b04f-213f826eac1e"
52295229
sourceElement="#f1c0db71-1927-4874-bf3e-0603a88f1d9b"/>
52305230
</ownedFeatures>
52315231
<ownedFeatures xsi:type="org.polarsys.capella.core.data.cs:PhysicalPort"
5232-
id="76d9c301-c0ad-4615-9f02-b804b018decf" name="P2">
5232+
id="76d9c301-c0ad-4615-9f02-b804b018decf" name="X FSwitch">
52335233
<ownedComponentPortAllocations xsi:type="org.polarsys.capella.core.data.fa:ComponentPortAllocation"
52345234
id="fea4735b-7774-466a-819a-169d7df71692" targetElement="#4c37367f-9098-4fd4-a60c-4807b03976f2"
52355235
sourceElement="#76d9c301-c0ad-4615-9f02-b804b018decf"/>
@@ -5249,7 +5249,7 @@ The predator is far away</bodies>
52495249
id="5bfc516b-c20d-4007-9a38-5ba0e889d0a4" name="Camera Assembly"
52505250
kind="HARDWARE" nature="NODE">
52515251
<ownedFeatures xsi:type="org.polarsys.capella.core.data.cs:PhysicalPort"
5252-
id="2d1e2ad5-3439-4820-baa8-189966407ba2" name="PP 1">
5252+
id="2d1e2ad5-3439-4820-baa8-189966407ba2" name="X CA">
52535253
<ownedComponentPortAllocations xsi:type="org.polarsys.capella.core.data.fa:ComponentPortAllocation"
52545254
id="efe9f882-148c-4c9d-8a73-a0e6e401ae73" targetElement="#43b6cfff-89ab-4777-ac72-ce9de12626a8"
52555255
sourceElement="#2d1e2ad5-3439-4820-baa8-189966407ba2"/>
@@ -5260,7 +5260,7 @@ The predator is far away</bodies>
52605260
id="8a6c6ec9-095d-4d8b-9728-69bc79af5f27" name="Deploy Sub PC" kind="PERSON"
52615261
nature="NODE">
52625262
<ownedFeatures xsi:type="org.polarsys.capella.core.data.cs:PhysicalPort"
5263-
id="7400c2a3-913f-4a08-aca7-8dd7c389e5e9" name="PP 1">
5263+
id="7400c2a3-913f-4a08-aca7-8dd7c389e5e9" name="Deploy BUS 1">
52645264
<ownedComponentPortAllocations xsi:type="org.polarsys.capella.core.data.fa:ComponentPortAllocation"
52655265
id="b549b1da-6f26-4ce1-84ed-a013f3dfe33b" targetElement="#4f45fbfd-f397-4a4a-9dee-6b8231f39f68"
52665266
sourceElement="#7400c2a3-913f-4a08-aca7-8dd7c389e5e9"/>

tests/test_diagram_view.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-FileCopyrightText: 2022 Copyright DB InfraGO AG and the capellambse-context-diagrams contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
import capellambse
5+
import capellambse.model as m
6+
import pytest
7+
8+
9+
@pytest.mark.parametrize(
10+
"name",
11+
[
12+
pytest.param("[SAB] Example Interface Context", id="Simple SAB diagram"),
13+
pytest.param("[LAB] Hierarchy", id="Simple LAB diagram"),
14+
pytest.param("[LAB] Hierarchy Function example", id="Nested LAB diagram"),
15+
pytest.param("[PAB] Sub-component Cable Tree", id="Simple PAB diagram"),
16+
pytest.param(
17+
"[PAB] Example Physical Function Context Diagram", id="Nested PAB diagram"
18+
),
19+
],
20+
)
21+
def test_capability_and_mission_context_diagrams(
22+
model: capellambse.MelodyModel, name: str
23+
) -> None:
24+
obj = model.diagrams.by_name(name)
25+
assert isinstance(obj, m.Diagram), "Precondition failed"
26+
27+
diag = obj.auto_layout
28+
29+
assert diag.nodes

0 commit comments

Comments
 (0)