Skip to content

Commit 17a46a5

Browse files
authored
Merge pull request #209 from com-pas/develop
New release
2 parents bc57e31 + 08b62f7 commit 17a46a5

File tree

55 files changed

+1115
-1891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1115
-1891
lines changed

pom.xml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,36 @@
3737
<sonar.coverage.exclusions>sct-coverage/**</sonar.coverage.exclusions>
3838
<aggregate.report.dir>../sct-coverage/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
3939
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
40-
<scl-extension.version>0.9.1</scl-extension.version>
40+
<compas-core.version>0.12.0</compas-core.version>
4141
<compas-scl-xsd.version>0.0.4</compas-scl-xsd.version>
4242
<maven.plugin.javadoc>3.4.1</maven.plugin.javadoc>
4343
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
4444
<junit-version>5.9.0</junit-version>
45+
<logback-classic.version>1.4.5</logback-classic.version>
46+
<assertj.version>3.22.0</assertj.version>
47+
<lombok.version>1.18.24</lombok.version>
4548
</properties>
4649

50+
<dependencies>
51+
<dependency>
52+
<groupId>org.lfenergy.compas.core</groupId>
53+
<artifactId>scl2007b4</artifactId>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.lfenergy.compas.core</groupId>
57+
<artifactId>scl-extension</artifactId>
58+
</dependency>
59+
<dependency>
60+
<groupId>ch.qos.logback</groupId>
61+
<artifactId>logback-classic</artifactId>
62+
</dependency>
63+
</dependencies>
4764
<dependencyManagement>
4865
<dependencies>
4966
<dependency>
5067
<groupId>org.projectlombok</groupId>
5168
<artifactId>lombok</artifactId>
52-
<version>1.18.24</version>
69+
<version>${lombok.version}</version>
5370
</dependency>
5471
<dependency>
5572
<groupId>org.junit.jupiter</groupId>
@@ -72,12 +89,12 @@
7289
<dependency>
7390
<groupId>org.lfenergy.compas.core</groupId>
7491
<artifactId>scl2007b4</artifactId>
75-
<version>0.2.1</version>
92+
<version>${compas-core.version}</version>
7693
</dependency>
7794
<dependency>
7895
<groupId>org.lfenergy.compas.core</groupId>
7996
<artifactId>scl-extension</artifactId>
80-
<version>${scl-extension.version}</version>
97+
<version>${compas-core.version}</version>
8198
</dependency>
8299
<dependency>
83100
<groupId>org.lfenergy.compas.xsd</groupId>
@@ -87,24 +104,15 @@
87104
<dependency>
88105
<groupId>ch.qos.logback</groupId>
89106
<artifactId>logback-classic</artifactId>
90-
<version>1.2.6</version>
107+
<version>${logback-classic.version}</version>
108+
</dependency>
109+
<dependency>
110+
<groupId>org.assertj</groupId>
111+
<artifactId>assertj-core</artifactId>
112+
<version>${assertj.version}</version>
91113
</dependency>
92114
</dependencies>
93115
</dependencyManagement>
94-
<dependencies>
95-
<dependency>
96-
<groupId>org.lfenergy.compas.core</groupId>
97-
<artifactId>scl2007b4</artifactId>
98-
</dependency>
99-
<dependency>
100-
<groupId>org.lfenergy.compas.core</groupId>
101-
<artifactId>scl-extension</artifactId>
102-
</dependency>
103-
<dependency>
104-
<groupId>ch.qos.logback</groupId>
105-
<artifactId>logback-classic</artifactId>
106-
</dependency>
107-
</dependencies>
108116
<modules>
109117
<module>sct-commons</module>
110118
<module>sct-coverage</module>
@@ -123,12 +131,16 @@
123131
<plugin>
124132
<groupId>org.lfenergy.compas.core</groupId>
125133
<artifactId>scl-extension</artifactId>
126-
<version>${scl-extension.version}</version>
134+
<version>${compas-core.version}</version>
127135
</plugin>
128136
<plugin>
129137
<groupId>org.apache.maven.plugins</groupId>
130138
<artifactId>maven-compiler-plugin</artifactId>
131139
<version>3.8.1</version>
140+
<configuration>
141+
<source>${java.version}</source>
142+
<target>${java.version}</target>
143+
</configuration>
132144
</plugin>
133145
<plugin>
134146
<groupId>org.jacoco</groupId>

sct-app/pom.xml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,16 @@
5454
<artifactId>junit-jupiter-engine</artifactId>
5555
<scope>test</scope>
5656
</dependency>
57-
<dependency>
58-
<groupId>org.mockito</groupId>
59-
<artifactId>mockito-core</artifactId>
60-
<version>3.6.28</version>
61-
<scope>test</scope>
62-
</dependency>
6357
<dependency>
6458
<groupId>org.assertj</groupId>
6559
<artifactId>assertj-core</artifactId>
66-
<version>3.23.1</version>
6760
</dependency>
6861
</dependencies>
6962
<build>
7063
<plugins>
7164
<plugin>
7265
<groupId>org.apache.maven.plugins</groupId>
7366
<artifactId>maven-compiler-plugin</artifactId>
74-
<configuration>
75-
<source>17</source>
76-
<target>17</target>
77-
</configuration>
7867
</plugin>
7968
<plugin>
8069
<groupId>org.apache.maven.plugins</groupId>
@@ -102,6 +91,7 @@
10291
<plugin>
10392
<groupId>org.apache.maven.plugins</groupId>
10493
<artifactId>maven-dependency-plugin</artifactId>
94+
<version>3.3.0</version>
10595
<executions>
10696
<execution>
10797
<id>unpack</id>
@@ -120,11 +110,6 @@
120110
<groupId>org.lfenergy.compas.core</groupId>
121111
<artifactId>scl-extension</artifactId>
122112
</artifactItem>
123-
<artifactItem>
124-
<groupId>org.lfenergy.compas.core</groupId>
125-
<artifactId>scl-extension</artifactId>
126-
<version>0.8.0</version>
127-
</artifactItem>
128113
</artifactItems>
129114
<outputDirectory>${project.build.directory}</outputDirectory>
130115
</configuration>

sct-app/src/test/resources/std_1.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<compas:SystemVersion MainSystemVersion="01.00" MinorSystemVersion="009.001.001"/>
3535
</Private>
3636
<Private type="COMPAS-ICDHeader">
37-
<compas:ICDHeader IEDType="GTW" 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"/>
37+
<compas:ICDHeader IEDType="SCU" 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"/>
3838
</Private>
3939
<Services nameLength="64">
4040
<ConfLNs fixPrefix="true" fixLnInst="true"/>
@@ -341,4 +341,4 @@
341341
<EnumVal ord="24">Y</EnumVal>
342342
</EnumType>
343343
</DataTypeTemplates>
344-
</SCL>
344+
</SCL>

sct-commons/pom.xml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
<properties>
2121
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
2222
<sonar.jacoco.excludes>**/scl2007b4/**/*</sonar.jacoco.excludes>
23-
<assertJ.version>3.22.0</assertJ.version>
24-
<opencsv.version>5.6</opencsv.version>
23+
<opencsv.version>5.7.1</opencsv.version>
2524
<mockito.version>4.9.0</mockito.version>
2625
</properties>
2726

@@ -91,11 +90,6 @@
9190
<version>${mockito.version}</version>
9291
<scope>test</scope>
9392
</dependency>
94-
<dependency>
95-
<groupId>com.fasterxml.jackson.dataformat</groupId>
96-
<artifactId>jackson-dataformat-yaml</artifactId>
97-
<version>2.12.3</version>
98-
</dependency>
9993
<dependency>
10094
<groupId>jakarta.annotation</groupId>
10195
<artifactId>jakarta.annotation-api</artifactId>
@@ -110,7 +104,6 @@
110104
<dependency>
111105
<groupId>org.assertj</groupId>
112106
<artifactId>assertj-core</artifactId>
113-
<version>${assertJ.version}</version>
114107
<scope>test</scope>
115108
</dependency>
116109
<dependency>
@@ -125,10 +118,6 @@
125118
<plugin>
126119
<groupId>org.apache.maven.plugins</groupId>
127120
<artifactId>maven-compiler-plugin</artifactId>
128-
<configuration>
129-
<source>17</source>
130-
<target>17</target>
131-
</configuration>
132121
</plugin>
133122
<plugin>
134123
<groupId>org.apache.maven.plugins</groupId>
@@ -161,6 +150,7 @@
161150
<plugin>
162151
<groupId>org.apache.maven.plugins</groupId>
163152
<artifactId>maven-dependency-plugin</artifactId>
153+
<version>3.3.0</version>
164154
<executions>
165155
<execution>
166156
<id>unpack</id>
@@ -179,11 +169,6 @@
179169
<groupId>org.lfenergy.compas.core</groupId>
180170
<artifactId>scl-extension</artifactId>
181171
</artifactItem>
182-
<artifactItem>
183-
<groupId>org.lfenergy.compas.core</groupId>
184-
<artifactId>scl-extension</artifactId>
185-
<version>0.8.0</version>
186-
</artifactItem>
187172
</artifactItems>
188173
<outputDirectory>${project.build.directory}</outputDirectory>
189174
</configuration>

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/DataSetInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static DataSetInfo from(TDataSet tDataSet) {
6565
* @return Set of DataSetInfo
6666
*/
6767
public static Set<DataSetInfo> getDataSets(AbstractLNAdapter<? extends TAnyLN> lnAdapter){
68-
return lnAdapter.getDataSet(null)
68+
return lnAdapter.getDataSetMatchingExtRefInfo(null)
6969
.stream().map(DataSetInfo::from).collect(Collectors.toSet());
7070
}
7171

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/dto/ExtRefInfo.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
66

77

88
import lombok.*;
9-
import org.apache.commons.lang3.StringUtils;
109
import org.lfenergy.compas.scl2007b4.model.TExtRef;
1110
import org.lfenergy.compas.scl2007b4.model.TFCDA;
12-
import org.lfenergy.compas.scl2007b4.model.TLLN0Enum;
13-
import org.lfenergy.compas.sct.commons.scl.ied.AbstractLNAdapter;
14-
15-
import java.util.Objects;
1611
/**
1712
* A representation of the model object <em><b>ExtRef</b></em>.
1813
*
@@ -75,48 +70,6 @@ public static ExtRefInfo from(TExtRef tExtRef, String iedName, String ldInst,
7570
return extRefInfo;
7671
}
7772

78-
/**
79-
* Check match between FCDA and ExtRef information (for binding)
80-
* @param tfcda FCDA data object
81-
* @return match state
82-
*/
83-
//TODO this method should be checked, return if parameter tested are not present in FCDA even if two object are different
84-
public boolean matchFCDA(@NonNull TFCDA tfcda){
85-
boolean returnValue = true;
86-
if(AbstractLNAdapter.isFCDANull(tfcda)) {
87-
returnValue = false;
88-
}
89-
90-
if(tfcda.getLdInst() != null &&
91-
(bindingInfo == null || !tfcda.getLdInst().equals(bindingInfo.getLdInst()))){
92-
returnValue = false;
93-
}
94-
if (!tfcda.getLnClass().isEmpty() &&
95-
( bindingInfo == null || !tfcda.getLnClass().contains(bindingInfo.getLnClass())) ){
96-
returnValue = false;
97-
}
98-
99-
boolean isLN0 = tfcda.getLnClass().contains(TLLN0Enum.LLN_0.value());
100-
if (!isLN0 && tfcda.getLnInst() != null &&
101-
(bindingInfo == null || !tfcda.getLnInst().equals(bindingInfo.getLnInst()))) {
102-
returnValue = false;
103-
}
104-
if (!isLN0 && !StringUtils.isBlank(tfcda.getPrefix()) &&
105-
(bindingInfo == null || !tfcda.getPrefix().equals(bindingInfo.getPrefix()))) {
106-
returnValue = false;
107-
}
108-
109-
if(!StringUtils.isBlank(tfcda.getDoName()) &&
110-
(signalInfo == null || !Objects.equals(signalInfo.getPDO(),tfcda.getDoName())) ){
111-
returnValue = false;
112-
}
113-
114-
if(!StringUtils.isBlank(tfcda.getDaName()) &&
115-
(signalInfo == null || !Objects.equals(signalInfo.getPDA(),tfcda.getDaName())) ){
116-
returnValue = false;
117-
}
118-
return returnValue;
119-
}
12073
/**
12174
* Check matching between FCDA and ExtRef information (for external binding)
12275
* Check is done for parameter lDInst(mandatory), lNClass(mandatory), lNInst, prefix doName as pDO(mandatory) and daName as pDA

sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/SclService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public static TExtRef updateExtRefSource(SCL scd, ExtRefInfo extRefInfo) throws
365365
if (bindingInfo == null || !bindingInfo.isValid()) {
366366
throw new ScdException(INVALID_OR_MISSING_ATTRIBUTES_IN_EXT_REF_BINDING_INFO);
367367
}
368-
if (bindingInfo.getIedName().equals(iedName)) {
368+
if (bindingInfo.getIedName().equals(iedName) || TServiceType.POLL.equals(bindingInfo.getServiceType())) {
369369
throw new ScdException("Internal binding can't have control block");
370370
}
371371
ExtRefSourceInfo sourceInfo = extRefInfo.getSourceInfo();
@@ -377,7 +377,7 @@ public static TExtRef updateExtRefSource(SCL scd, ExtRefInfo extRefInfo) throws
377377
IEDAdapter iedAdapter = sclRootAdapter.getIEDAdapterByName(iedName);
378378
LDeviceAdapter lDeviceAdapter = iedAdapter.findLDeviceAdapterByLdInst(ldInst)
379379
.orElseThrow(() -> new ScdException(String.format(UNKNOWN_LDEVICE_S_IN_IED_S, ldInst, iedName)));
380-
var anLNAdapter = AbstractLNAdapter.builder()
380+
AbstractLNAdapter<?> anLNAdapter = AbstractLNAdapter.builder()
381381
.withLDeviceAdapter(lDeviceAdapter)
382382
.withLnClass(lnClass)
383383
.withLnInst(lnInst)

0 commit comments

Comments
 (0)