Skip to content

Commit bc57e31

Browse files
authored
Merge pull request #200 from com-pas/develop
Upgrade to java 17
2 parents 88291aa + e956419 commit bc57e31

Some content is hidden

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

44 files changed

+41998
-238
lines changed

.github/workflows/automate_javadoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/checkout@v2
2121
with:
2222
distribution: 'zulu'
23-
java-version: '11'
23+
java-version: '17'
2424
ref: ${{ env.target_branch }}
2525

2626
- name: Create custom Maven Settings.xml

.github/workflows/release-project.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
contents: read
1616
packages: write
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
- name: Extract tag name
2020
id: extract_tagname
2121
shell: bash
2222
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
2323
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
24-
- name: Set up JDK 1.11
25-
uses: actions/setup-java@v2.5.0
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v3
2626
with:
2727
distribution: 'zulu'
28-
java-version: '11'
28+
java-version: '17'
2929
- name: Create custom Maven Settings.xml
3030
uses: whelk-io/maven-settings-xml-action@v20
3131
with:

.github/workflows/reuse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- name: REUSE Compliance Check
1515
uses: fsfe/reuse-action@v1

.github/workflows/sonarcloud-analysis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ jobs:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v1
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
1919
with:
20-
java-version: 11
20+
distribution: 'zulu'
21+
java-version: '17'
2122
- name: Cache SonarCloud packages
2223
uses: actions/cache@v1
2324
with:

pom.xml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
</repositories>
3030

3131
<properties>
32+
<java.version>17</java.version>
3233
<compas.core.version>local-SNAPSHOT</compas.core.version>
33-
<maven.compiler.target>11</maven.compiler.target>
34-
<maven.compiler.source>11</maven.compiler.source>
34+
<maven.compiler.target>${java.version}</maven.compiler.target>
35+
<maven.compiler.source>${java.version}</maven.compiler.source>
3536
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3637
<sonar.coverage.exclusions>sct-coverage/**</sonar.coverage.exclusions>
3738
<aggregate.report.dir>../sct-coverage/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
@@ -40,6 +41,7 @@
4041
<compas-scl-xsd.version>0.0.4</compas-scl-xsd.version>
4142
<maven.plugin.javadoc>3.4.1</maven.plugin.javadoc>
4243
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
44+
<junit-version>5.9.0</junit-version>
4345
</properties>
4446

4547
<dependencyManagement>
@@ -52,19 +54,19 @@
5254
<dependency>
5355
<groupId>org.junit.jupiter</groupId>
5456
<artifactId>junit-jupiter-api</artifactId>
55-
<version>5.8.1</version>
57+
<version>${junit-version}</version>
5658
<scope>test</scope>
5759
</dependency>
5860
<dependency>
5961
<groupId>org.junit.jupiter</groupId>
6062
<artifactId>junit-jupiter-engine</artifactId>
61-
<version>5.8.1</version>
63+
<version>${junit-version}</version>
6264
<scope>test</scope>
6365
</dependency>
6466
<dependency>
6567
<groupId>org.junit.jupiter</groupId>
6668
<artifactId>junit-jupiter-params</artifactId>
67-
<version>5.8.1</version>
69+
<version>${junit-version}</version>
6870
<scope>test</scope>
6971
</dependency>
7072
<dependency>
@@ -131,7 +133,7 @@
131133
<plugin>
132134
<groupId>org.jacoco</groupId>
133135
<artifactId>jacoco-maven-plugin</artifactId>
134-
<version>0.8.6</version>
136+
<version>0.8.8</version>
135137
</plugin>
136138
<plugin>
137139
<groupId>org.apache.maven.plugins</groupId>
@@ -157,20 +159,6 @@
157159
</execution>
158160
</executions>
159161
</plugin>
160-
<plugin>
161-
<groupId>org.apache.maven.plugins</groupId>
162-
<artifactId>maven-javadoc-plugin</artifactId>
163-
<version>${maven.plugin.javadoc}</version>
164-
<executions>
165-
<execution>
166-
<id>attach-javadocs</id>
167-
<phase>package</phase>
168-
<goals>
169-
<goal>aggregate</goal>
170-
</goals>
171-
</execution>
172-
</executions>
173-
</plugin>
174162
<plugin>
175163
<groupId>org.apache.maven.plugins</groupId>
176164
<artifactId>maven-source-plugin</artifactId>
@@ -219,7 +207,6 @@
219207
<plugin>
220208
<groupId>org.apache.maven.plugins</groupId>
221209
<artifactId>maven-javadoc-plugin</artifactId>
222-
<version>${maven.plugin.javadoc}</version>
223210
<configuration>
224211
<doctitle>${javadoc.title}</doctitle>
225212
<doclint>${javadoc.lint}</doclint>

sct-app/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<groupId>org.apache.maven.plugins</groupId>
7373
<artifactId>maven-compiler-plugin</artifactId>
7474
<configuration>
75-
<source>11</source>
76-
<target>11</target>
75+
<source>17</source>
76+
<target>17</target>
7777
</configuration>
7878
</plugin>
7979
<plugin>

sct-app/src/test/java/org.lfenergy.compas.sct.app/SclAutomationServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void createSCD_should_delete_ControlBlocks_DataSet_and_ExtRef_src_attributes() t
146146
// Then
147147
LN0 ln0 = expectedSCD.streamIEDAdapters()
148148
.findFirst()
149-
.map(iedAdapter -> iedAdapter.getLDeviceAdapterByLdInst("lDeviceInst1").orElseThrow())
149+
.map(iedAdapter -> iedAdapter.findLDeviceAdapterByLdInst("lDeviceInst1").orElseThrow())
150150
.map(LDeviceAdapter::getLN0Adapter)
151151
.map(SclElementAdapter::getCurrentElem)
152152
.orElseThrow(() -> new RuntimeException("Test shouldn't fail here, please check your XML input file"));

sct-commons/pom.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
2222
<sonar.jacoco.excludes>**/scl2007b4/**/*</sonar.jacoco.excludes>
2323
<assertJ.version>3.22.0</assertJ.version>
24+
<opencsv.version>5.6</opencsv.version>
25+
<mockito.version>4.9.0</mockito.version>
2426
</properties>
2527

2628
<dependencies>
@@ -74,19 +76,19 @@
7476
<dependency>
7577
<groupId>org.mockito</groupId>
7678
<artifactId>mockito-core</artifactId>
77-
<version>3.6.28</version>
79+
<version>${mockito.version}</version>
7880
<scope>test</scope>
7981
</dependency>
8082
<dependency>
8183
<groupId>org.mockito</groupId>
8284
<artifactId>mockito-inline</artifactId>
83-
<version>4.0.0</version>
85+
<version>${mockito.version}</version>
8486
<scope>test</scope>
8587
</dependency>
8688
<dependency>
8789
<groupId>org.mockito</groupId>
8890
<artifactId>mockito-junit-jupiter</artifactId>
89-
<version>3.6.28</version>
91+
<version>${mockito.version}</version>
9092
<scope>test</scope>
9193
</dependency>
9294
<dependency>
@@ -111,6 +113,11 @@
111113
<version>${assertJ.version}</version>
112114
<scope>test</scope>
113115
</dependency>
116+
<dependency>
117+
<groupId>com.opencsv</groupId>
118+
<artifactId>opencsv</artifactId>
119+
<version>${opencsv.version}</version>
120+
</dependency>
114121
</dependencies>
115122

116123
<build>
@@ -119,8 +126,8 @@
119126
<groupId>org.apache.maven.plugins</groupId>
120127
<artifactId>maven-compiler-plugin</artifactId>
121128
<configuration>
122-
<source>11</source>
123-
<target>11</target>
129+
<source>17</source>
130+
<target>17</target>
124131
</configuration>
125132
</plugin>
126133
<plugin>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void validateCB() throws ScdException {
105105
public void validateDestination(SclRootAdapter sclRootAdapter) throws ScdException {
106106
for(TControlWithIEDName.IEDName iedName : iedNames){
107107
IEDAdapter iedAdapter =sclRootAdapter.getIEDAdapterByName(iedName.getValue());
108-
LDeviceAdapter lDeviceAdapter = iedAdapter.getLDeviceAdapterByLdInst(iedName.getLdInst())
108+
LDeviceAdapter lDeviceAdapter = iedAdapter.findLDeviceAdapterByLdInst(iedName.getLdInst())
109109
.orElseThrow(
110110
() -> new ScdException(
111111
String.format(

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
@NoArgsConstructor
4646
@EqualsAndHashCode
4747
public class DataTypeName {
48+
protected static final String DELIMITER = ".";
49+
4850
protected String name = ""; // dataName or DataAttributeName
4951

5052
private List<String> structNames = new ArrayList<>(); // [.DataName[…]] or [.DAComponentName[ ….]]
@@ -98,13 +100,8 @@ public boolean isDefined(){
98100
*/
99101
@Override
100102
public String toString(){
101-
StringBuilder stringBuilder = new StringBuilder();
102-
stringBuilder.append(name);
103-
for(String sName : structNames){
104-
stringBuilder.append('.');
105-
stringBuilder.append(sName);
106-
}
107-
return stringBuilder.toString();
103+
return name
104+
+ (getStructNames().isEmpty() ? StringUtils.EMPTY : DELIMITER + String.join(DELIMITER, getStructNames()));
108105
}
109106

110107
/**

0 commit comments

Comments
 (0)