Skip to content

Commit 7cef056

Browse files
committed
[#57] : file correction && add new test
Signed-off-by: Aliou DIAITE <[email protected]>
1 parent e6a6852 commit 7cef056

File tree

5 files changed

+42
-23
lines changed

5 files changed

+42
-23
lines changed

sct-commons/src/test/java/org/lfenergy/compas/sct/commons/scl/SclServiceTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ void testGetEnumTypeElements() throws Exception {
351351
);
352352
assertFalse(enumList.isEmpty());
353353
}
354+
@Test
355+
void testAddSubstation_SSD_Without_Substation() throws Exception {
356+
SCL scd = SclTestMarshaller.getSCLFromFile("/scl-root-test-schema-conf/add_ied_test.xml");
357+
SCL ssd = SclTestMarshaller.getSCLFromFile("/scd-substation-import-ssd/ssd_without_substations.xml");
358+
359+
assertThrows(ScdException.class,
360+
() ->SclService.addSubstation(scd, ssd));
361+
}
354362

355363
@Test
356364
void testAddSubstation_SSD_With_TWO_Substation() throws Exception {

sct-commons/src/test/resources/scd-substation-import-ssd/scd_with_substation.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
<!-- -->
33
<!-- SPDX-License-Identifier: Apache-2.0 -->
44

5-
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4">
5+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1" version="2007" revision="B" release="4">
66
<Header id="HeaderID" version="version" revision="Revision" toolID="toolID"/>
77

88
<Substation name="SITE">
99
<VoltageLevel nomFreq="50" numPhases="3" name="4">
1010
<Voltage unit="V" multiplier="k">90</Voltage>
1111
<Bay name="BAY_2">
1212
<Private type="COMPAS-Bay">
13-
<compas:Bay xmlns:compas="https://www.lfenergy.org/compas/extension/v1" BayCodif="CB00001101" UUID="4214a755-3420-42ed-ac2d-766c5149b58a" Version="1" MainLabel="BAY2" SecondLabel="SITE-P41-SS1.12" NumBay="1" ZoneNumber="N/A"/>
13+
<compas:Bay BayCodif="CB00001101" UUID="4214a755-3420-42ed-ac2d-766c5149b58a" Version="1" MainLabel="BAY2" SecondLabel="SITE-P41-SS1.12" NumBay="1" ZoneNumber="N/A"/>
1414
</Private>
1515
<Private type="COMPAS-Criteria">
16-
<compas:Criteria xmlns:compas="https://www.lfenergy.org/compas/extension/v1" ObjectID="4214a755-3420-42ed-ac2d-766c5149b58a" CriteriaAssociationID="CriteriaAssociationID"/>
16+
<compas:Criteria ObjectID="4214a755-3420-42ed-ac2d-766c5149b58a" CriteriaAssociationID="CriteriaAssociationID"/>
1717
</Private>
1818
<Private type="COMPAS-SystemVersion">
19-
<compas:SystemVersion xmlns:compas="https://www.lfenergy.org/compas/extension/v1" MainSystemVersion="01.00" MinorSystemVersion="004.001.001"/>
19+
<compas:SystemVersion MainSystemVersion="01.00" MinorSystemVersion="004.001.001"/>
2020
</Private>
2121
<Function name="FUNCTION_3">
2222
<Private type="COMPAS-Function">
23-
<compas:Function xmlns:compas="https://www.lfenergy.org/compas/extension/v1" UUID="386365c5-3e99-4499-b3c9-297fcf454f11" Label="FUNCTION_3"/>
23+
<compas:Function UUID="386365c5-3e99-4499-b3c9-297fcf454f11" Label="FUNCTION_3"/>
2424
</Private>
2525
<Private type="COMPAS-Criteria">
26-
<compas:Criteria xmlns:compas="https://www.lfenergy.org/compas/extension/v1" ObjectID="386365c5-3e99-4499-b3c9-297fcf454f11" CriteriaAssociationID="CriteriaAssociationID"/>
26+
<compas:Criteria ObjectID="386365c5-3e99-4499-b3c9-297fcf454f11" CriteriaAssociationID="CriteriaAssociationID"/>
2727
</Private>
2828
<LNode iedName="None" ldInst="LDFUNCTION_3" lnClass="LLN0">
2929
<Private type="COMPAS-ICDHeader">
30-
<compas:ICDHeader xmlns:compas="https://www.lfenergy.org/compas/extension/v1" IEDType="BCU" IEDinstance="11" BayLabel="BAY2" iedName="SITEBAY2BCU44" ICDSystemVersionUUID="ed36220c-5577-4f0c-aaef-c6efa9f7d7c8" VendorName="RTE" IEDredundancy="Nominal" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="9aea4c6f-7ab8-4341-8d84-14c17d73a57d" headerVersion="01.00.00" headerRevision="01.00.00"></compas:ICDHeader>
30+
<compas:ICDHeader IEDType="BCU" IEDinstance="11" BayLabel="BAY2" IEDName="SITEBAY2BCU44" ICDSystemVersionUUID="ed36220c-5577-4f0c-aaef-c6efa9f7d7c8" VendorName="RTE" IEDredundancy="A" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="9aea4c6f-7ab8-4341-8d84-14c17d73a57d" headerVersion="01.00.00" headerRevision="01.00.00"/>
3131
</Private>
3232
</LNode>
3333
</Function>

sct-commons/src/test/resources/scd-substation-import-ssd/ssd.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
33
<!-- -->
44
<!-- SPDX-License-Identifier: Apache-2.0 -->
5-
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4">
5+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1" version="2007" revision="B" release="4">
66
<Private type="COMPAS-SclFileType">
7-
<compas:SclFileType xmlns:compas="https://www.lfenergy.org/compas/extension/v1" Name="SSD"></compas:SclFileType>
7+
<compas:SclFileType>SSD</compas:SclFileType>
88
</Private>
9-
<Header id="HeaderId" version="HeaderVersion" revision="HeaderRevision"></Header>
9+
<Header id="HeaderId" version="HeaderVersion" revision="HeaderRevision"/>
1010
<Substation name="SITE">
1111
<VoltageLevel nomFreq="50" numPhases="3" name="0">
1212
<Voltage unit="V" multiplier="k">0</Voltage>
1313
<Bay name="BAY_1">
1414
<Private type="COMPAS-Bay">
15-
<compas:Bay xmlns:compas="https://www.lfenergy.org/compas/extension/v1" BayCodif="TG00000001" UUID="9cd6f05b-1bbd-4ba3-86c5-41c99103e06d" Indice="1" MainLabel="SITE1" SecondLabel="SITE-TGENE" NumBay="7" NumSection="N/A"></compas:Bay>
15+
<compas:Bay BayCodif="TG00000001" UUID="9cd6f05b-1bbd-4ba3-86c5-41c99103e06d" Version="1" MainLabel="SITE1" SecondLabel="SITE-TGENE" NumBay="7" ZoneNumber="N/A"/>
1616
</Private>
1717
<Private type="COMPAS-Criteria">
18-
<compas:Criteria xmlns:compas="https://www.lfenergy.org/compas/extension/v1" ObjectID="9cd6f05b-1bbd-4ba3-86c5-41c99103e06d" CriteriaAssociationID="CriteriaAssociationID"></compas:Criteria>
18+
<compas:Criteria ObjectID="9cd6f05b-1bbd-4ba3-86c5-41c99103e06d" CriteriaAssociationID="CriteriaAssociationID"/>
1919
</Private>
2020
<Function name="FUNCTION_1">
2121
<Private type="COMPAS-Function">
22-
<compas:Function xmlns:compas="https://www.lfenergy.org/compas/extension/v1" UUID="8f4cda3f-828c-4006-9b87-2af96b19304b" Label="FUNCTION_1"></compas:Function>
22+
<compas:Function UUID="8f4cda3f-828c-4006-9b87-2af96b19304b" Label="FUNCTION_1"/>
2323
</Private>
2424
<LNode iedName="None" ldInst="LDGW" lnClass="LLN0">
2525
<Private type="COMPAS-ICDHeader">
26-
<compas:ICDHeader xmlns:compas="https://www.lfenergy.org/compas/extension/v1" IEDType="GTW" IEDinstance="3" BayLabel="SITE1" iedName="SITESITE1GTW0" ICDSystemVersionUUID="b4f8089e-4170-47f1-b6ad-dd1f50885518" VendorName="RTE" IEDredundancy="Nominal" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="f8dbc8c1-2db7-4652-a9d6-0b414bdeccfa" headerVersion="01.00.00" headerRevision="01.00.00"></compas:ICDHeader>
26+
<compas:ICDHeader IEDType="GTW" IEDinstance="3" BayLabel="SITE1" IEDName="SITESITE1GTW0" ICDSystemVersionUUID="b4f8089e-4170-47f1-b6ad-dd1f50885518" VendorName="RTE" IEDredundancy="A" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="f8dbc8c1-2db7-4652-a9d6-0b414bdeccfa" headerVersion="01.00.00" headerRevision="01.00.00"/>
2727
</Private>
2828
</LNode>
2929
</Function>
3030
<Function name="FUNCTION_2">
3131
<LNode iedName="None" ldInst="LDPDB" lnClass="LLN0">
3232
<Private type="COMPAS-ICDHeader">
33-
<compas:ICDHeader xmlns:compas="https://www.lfenergy.org/compas/extension/v1" IEDType="PDB" IEDinstance="4" BayLabel="SITE1" iedName="SITESITE1PDB0" ICDSystemVersionUUID="ad27d262-7c90-46df-b480-68088f9fe8a4" VendorName="RTE" IEDredundancy="Nominal" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="6b4d51eb-c391-4eef-b118-f516bc09f20c" headerVersion="01.00.00" headerRevision="01.00.00"></compas:ICDHeader>
33+
<compas:ICDHeader IEDType="PDB" IEDinstance="4" BayLabel="SITE1" IEDName="SITESITE1PDB0" ICDSystemVersionUUID="ad27d262-7c90-46df-b480-68088f9fe8a4" VendorName="RTE" IEDredundancy="A" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="6b4d51eb-c391-4eef-b118-f516bc09f20c" headerVersion="01.00.00" headerRevision="01.00.00"/>
3434
</Private>
3535
</LNode>
3636
</Function>
@@ -40,24 +40,24 @@
4040
<Voltage unit="V" multiplier="k">90</Voltage>
4141
<Bay name="BAY_2">
4242
<Private type="COMPAS-Bay">
43-
<compas:Bay xmlns:compas="https://www.lfenergy.org/compas/extension/v1" BayCodif="CB00001101" UUID="4214a755-3420-42ed-ac2d-766c5149b58a" Indice="1" MainLabel="BAY2" SecondLabel="SITE-P41-SS1.12" NumBay="1" NumSection="N/A"></compas:Bay>
43+
<compas:Bay BayCodif="CB00001101" UUID="4214a755-3420-42ed-ac2d-766c5149b58a" Version="1" MainLabel="BAY2" SecondLabel="SITE-P41-SS1.12" NumBay="1" ZoneNumber="N/A"/>
4444
</Private>
4545
<Private type="COMPAS-Criteria">
46-
<compas:Criteria xmlns:compas="https://www.lfenergy.org/compas/extension/v1" ObjectID="4214a755-3420-42ed-ac2d-766c5149b58a" CriteriaAssociationID="CriteriaAssociationID"></compas:Criteria>
46+
<compas:Criteria ObjectID="4214a755-3420-42ed-ac2d-766c5149b58a" CriteriaAssociationID="CriteriaAssociationID"/>
4747
</Private>
4848
<Private type="COMPAS-SystemVersion">
49-
<compas:SystemVersion xmlns:compas="https://www.lfenergy.org/compas/extension/v1" MainSystemVersion="01.00" MinorSystemVersion="004.001.001"></compas:SystemVersion>
49+
<compas:SystemVersion MainSystemVersion="01.00" MinorSystemVersion="004.001.001"/>
5050
</Private>
5151
<Function name="FUNCTION_3">
5252
<Private type="COMPAS-Function">
53-
<compas:Function xmlns:compas="https://www.lfenergy.org/compas/extension/v1" UUID="386365c5-3e99-4499-b3c9-297fcf454f11" Label="FUNCTION_3"></compas:Function>
53+
<compas:Function UUID="386365c5-3e99-4499-b3c9-297fcf454f11" Label="FUNCTION_3"/>
5454
</Private>
5555
<Private type="COMPAS-Criteria">
56-
<compas:Criteria xmlns:compas="https://www.lfenergy.org/compas/extension/v1" ObjectID="386365c5-3e99-4499-b3c9-297fcf454f11" CriteriaAssociationID="CriteriaAssociationID"></compas:Criteria>
56+
<compas:Criteria ObjectID="386365c5-3e99-4499-b3c9-297fcf454f11" CriteriaAssociationID="CriteriaAssociationID"/>
5757
</Private>
5858
<LNode iedName="None" ldInst="LDFUNCTION_3" lnClass="LLN0">
5959
<Private type="COMPAS-ICDHeader">
60-
<compas:ICDHeader xmlns:compas="https://www.lfenergy.org/compas/extension/v1" IEDType="BCU" IEDinstance="11" BayLabel="BAY2" iedName="SITEBAY2BCU44" ICDSystemVersionUUID="ed36220c-5577-4f0c-aaef-c6efa9f7d7c8" VendorName="RTE" IEDredundancy="Nominal" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="9aea4c6f-7ab8-4341-8d84-14c17d73a57d" headerVersion="01.00.00" headerRevision="01.00.00"></compas:ICDHeader>
60+
<compas:ICDHeader IEDType="BCU" IEDinstance="11" BayLabel="BAY2" IEDName="SITEBAY2BCU44" ICDSystemVersionUUID="ed36220c-5577-4f0c-aaef-c6efa9f7d7c8" VendorName="RTE" IEDredundancy="A" IEDmodel="ICDfromModeling" hwRev="01.00.00" swRev="01.00.00" headerId="9aea4c6f-7ab8-4341-8d84-14c17d73a57d" headerVersion="01.00.00" headerRevision="01.00.00"/>
6161
</Private>
6262
</LNode>
6363
</Function>

sct-commons/src/test/resources/scd-substation-import-ssd/ssd_with_2_substations.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
33
<!-- -->
44
<!-- SPDX-License-Identifier: Apache-2.0 -->
5-
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4">
5+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1" version="2007" revision="B" release="4">
66
<Private type="COMPAS-SclFileType">
7-
<compas:SclFileType xmlns:compas="https://www.lfenergy.org/compas/extension/v1">SSD</compas:SclFileType>
7+
<compas:SclFileType>SSD</compas:SclFileType>
88
</Private>
99
<Header id="HeaderId" version="HeaderVersion" revision="HeaderRevision"/>
1010
<Substation name="SITE">
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
3+
<!-- -->
4+
<!-- SPDX-License-Identifier: Apache-2.0 -->
5+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1" version="2007" revision="B" release="4">
6+
<Private type="COMPAS-SclFileType">
7+
<compas:SclFileType>SSD</compas:SclFileType>
8+
</Private>
9+
<Header id="HeaderId" version="HeaderVersion" revision="HeaderRevision"/>
10+
11+
</SCL>

0 commit comments

Comments
 (0)