Skip to content

Commit 449a8ca

Browse files
committed
add copyright to test files
Signed-off-by: Mohamed Sylla <[email protected]>
1 parent 2a9ccd1 commit 449a8ca

File tree

8 files changed

+28
-15
lines changed

8 files changed

+28
-15
lines changed

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@
5757
<artifactId>logback-classic</artifactId>
5858
<version>1.2.6</version>
5959
</dependency>
60-
<!--<dependency>
61-
<groupId>org.slf4j</groupId>
62-
<artifactId>slf4j-log4j12</artifactId>
63-
<version>1.7.32</version>
64-
<scope>test</scope>
65-
</dependency>-->
6660
</dependencies>
6761
</dependencyManagement>
6862
<dependencies>

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
package org.lfenergy.compas.sct.commons.scl.ied;
66

7-
import com.fasterxml.jackson.databind.node.NullNode;
7+
import lombok.extern.slf4j.Slf4j;
88
import org.lfenergy.compas.scl2007b4.model.TIED;
99
import org.lfenergy.compas.scl2007b4.model.TLLN0Enum;
1010
import org.lfenergy.compas.scl2007b4.model.TServices;
11+
import org.lfenergy.compas.sct.commons.Utils;
1112
import org.lfenergy.compas.sct.commons.dto.ControlBlock;
1213
import org.lfenergy.compas.sct.commons.dto.ExtRefBindingInfo;
1314
import org.lfenergy.compas.sct.commons.dto.ExtRefInfo;
@@ -24,6 +25,7 @@
2425
import java.util.stream.Collectors;
2526

2627

28+
@Slf4j
2729
public class IEDAdapter extends SclElementAdapter<SclRootAdapter, TIED> {
2830

2931
public IEDAdapter(SclRootAdapter parentAdapter) {
@@ -118,11 +120,13 @@ public List<ExtRefBindingInfo> getExtRefBinders(ExtRefSignalInfo signalInfo) thr
118120
return potentialBinders;
119121
}
120122

121-
public List<ControlBlock<?>> getControlSetByBindingInfo(ExtRefInfo extRefInfo) {
123+
public List<ControlBlock<?>> getControlBlocksByBindingInfo(ExtRefInfo extRefInfo) {
124+
log.debug(Utils.entering());
125+
long startTime = System.nanoTime();
122126
if(extRefInfo.getBindingInfo() == null) {
123127
throw new IllegalArgumentException("ExtRef binding information are missing");
124128
}
125-
return getLDeviceAdapters()
129+
var cbs = getLDeviceAdapters()
126130
.stream()
127131
.map(lDeviceAdapter -> {
128132
List<AbstractLNAdapter<?>> lnAdapters = new ArrayList<>();
@@ -146,11 +150,10 @@ public List<ControlBlock<?>> getControlSetByBindingInfo(ExtRefInfo extRefInfo) {
146150
return lnAdapters;
147151
})
148152
.flatMap(Collection::stream)
149-
.map(lnAdapter -> {
150-
151-
return lnAdapter.getControlSetByExtRefInfo(extRefInfo);
152-
})
153+
.map(lnAdapter -> lnAdapter.getControlSetByExtRefInfo(extRefInfo))
153154
.flatMap(Collection::stream)
154155
.collect(Collectors.toList());
156+
log.debug(Utils.leaving(startTime));
157+
return cbs;
155158
}
156159
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void testGetControlSetByBindingInfo() throws Exception {
125125

126126
ExtRefInfo extRefInfo = new ExtRefInfo();
127127
extRefInfo.setBindingInfo(new ExtRefBindingInfo());
128-
List<ControlBlock<?>> controlBlocks = iAdapter.getControlSetByBindingInfo(extRefInfo);
128+
List<ControlBlock<?>> controlBlocks = iAdapter.getControlBlocksByBindingInfo(extRefInfo);
129129

130130
assertFalse(controlBlocks.isEmpty());
131131
assertEquals(ReportControlBlock.class,controlBlocks.get(0).getClass());

sct-commons/src/test/resources/scd-extref-cb/scd_get_binders_test.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
3+
<!-- -->
4+
<!-- SPDX-License-Identifier: Apache-2.0 -->
5+
26
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1">
37
<Header id="hId" version="2007" revision="B" toolID="COMPAS"/>
48
<IED name="IED_NAME1">

sct-commons/src/test/resources/scd-extref-cb/scd_get_cbs_test.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
3+
<!-- -->
4+
<!-- SPDX-License-Identifier: Apache-2.0 -->
5+
26
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL">
37
<Header id="hId" version="2007" revision="B" toolID="COMPAS"/>
48
<IED name="IED_NAME1">

sct-service/src/main/java/org/lfenergy/compas/service/SclManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public List<ControlBlock<?>> getExtRefSourceInfo(SCL scd, ExtRefInfo extRefInfo)
159159

160160
// Get CBs
161161
IEDAdapter srcIEDAdapter = sclRootAdapter.getIEDAdapter(bindingInfo.getIedName());
162-
return srcIEDAdapter.getControlSetByBindingInfo(extRefInfo);
162+
return srcIEDAdapter.getControlBlocksByBindingInfo(extRefInfo);
163163
}
164164

165165
public TExtRef updateExtRefSource(SCL scd, ExtRefInfo extRefInfo) throws ScdException {

sct-service/src/test/resources/scd-extref-cb/scd_get_binders_test.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
3+
<!-- -->
4+
<!-- SPDX-License-Identifier: Apache-2.0 -->
5+
26
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:compas="https://www.lfenergy.org/compas/extension/v1">
37
<Header id="hId" version="2007" revision="B" toolID="COMPAS"/>
48
<IED name="IED_NAME1">

sct-service/src/test/resources/scd-extref-cb/scd_get_cbs_test.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
3+
<!-- -->
4+
<!-- SPDX-License-Identifier: Apache-2.0 -->
5+
26
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL">
37
<Header id="hId" version="2007" revision="B" toolID="COMPAS"/>
48
<IED name="IED_NAME1">

0 commit comments

Comments
 (0)