Skip to content

Commit 6983c0d

Browse files
authored
build: fresh build (#88)
* build(deps): bump commons-io to 2.15.1 * build(test): bump junit to 5.10.2 Junit test suite was using junit 4. * build: remove deprecated properties in pom * build(java): java 21 in pom * build(logging): switch for log4j2 impl * chore: bump version * ci: update workflows with java 21
1 parent 1dce061 commit 6983c0d

8 files changed

+75
-93
lines changed

.github/workflows/create-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
- name: Set up Maven Central Repository
8888
uses: actions/setup-java@v3
8989
with:
90-
java-version: 8
91-
distribution: adopt
90+
java-version: '21'
91+
distribution: 'temurin'
9292
server-id: ossrh
9393
server-username: MAVEN_USERNAME
9494
server-password: MAVEN_PASSWORD

.github/workflows/create-snapshot.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
steps:
4848
- uses: actions/checkout@v3
4949

50-
- name: Set up JDK 8
50+
- name: Set up JDK
5151
uses: actions/setup-java@v3
5252
with:
53-
distribution: "temurin"
54-
java-version: "8"
53+
java-version: '21'
54+
distribution: 'temurin'
5555

5656
- name: Tests
5757
run: mvn test --no-transfer-progress
@@ -79,8 +79,8 @@ jobs:
7979
- name: Set up Maven Central Repository
8080
uses: actions/setup-java@v3
8181
with:
82-
java-version: 8
83-
distribution: adopt
82+
java-version: '21'
83+
distribution: 'temurin'
8484
server-id: ossrh
8585
server-username: MAVEN_USERNAME
8686
server-password: MAVEN_PASSWORD

.github/workflows/tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313

14-
- name: Set up JDK 8
14+
- name: Set up JDK
1515
uses: actions/setup-java@v3
1616
with:
17-
distribution: "temurin"
18-
java-version: "8"
17+
java-version: '21'
18+
distribution: 'temurin'
1919

2020
- name: Tests
2121
run: mvn test --no-transfer-progress

pom.xml

+27-18
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44
<groupId>fr.insee.pogues</groupId>
55
<artifactId>pogues-model</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.1.0</version>
7+
<version>1.2.0</version>
88
<name>Pogues Model</name>
99
<description>Classes and converters for the Pogues model</description>
1010
<url>https://inseefr.github.io/Pogues-Model/</url>
1111

12+
<properties>
13+
<!-- Java version -->
14+
<maven.compiler.release>21</maven.compiler.release>
15+
<!-- Project encoding -->
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<!-- Dependency version properties -->
18+
<junit.version>5.10.2</junit.version>
19+
</properties>
20+
1221
<licenses>
1322
<license>
1423
<name>MIT License</name>
@@ -62,23 +71,29 @@
6271
<dependency>
6372
<groupId>commons-io</groupId>
6473
<artifactId>commons-io</artifactId>
65-
<version>2.4</version>
74+
<version>2.15.1</version>
6675
</dependency>
6776
<dependency>
6877
<groupId>org.slf4j</groupId>
6978
<artifactId>slf4j-api</artifactId>
70-
<version>1.7.25</version>
79+
<version>2.0.12</version>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.junit.jupiter</groupId>
83+
<artifactId>junit-jupiter-api</artifactId>
84+
<version>${junit.version}</version>
85+
<scope>test</scope>
7186
</dependency>
7287
<dependency>
73-
<groupId>junit</groupId>
74-
<artifactId>junit</artifactId>
75-
<version>4.8</version>
88+
<groupId>org.junit.jupiter</groupId>
89+
<artifactId>junit-jupiter-engine</artifactId>
90+
<version>${junit.version}</version>
7691
<scope>test</scope>
7792
</dependency>
7893
<dependency>
7994
<groupId>org.apache.logging.log4j</groupId>
80-
<artifactId>log4j-slf4j-impl</artifactId>
81-
<version>2.16.0</version>
95+
<artifactId>log4j-slf4j2-impl</artifactId>
96+
<version>2.22.1</version>
8297
<scope>test</scope>
8398
</dependency>
8499
<dependency>
@@ -95,12 +110,9 @@
95110
<groupId>org.apache.maven.plugins</groupId>
96111
<artifactId>maven-compiler-plugin</artifactId>
97112
<configuration>
98-
<source>1.8</source>
99-
<target>1.8</target>
113+
<source>21</source>
114+
<target>21</target>
100115
<encoding>UTF-8</encoding>
101-
<inputEncoding>UTF-8</inputEncoding>
102-
<outputEncoding>UTF-8</outputEncoding>
103-
<argLine>-Dfile.encoding=UTF-8</argLine>
104116
</configuration>
105117
</plugin>
106118
</plugins>
@@ -112,10 +124,7 @@
112124
<version>2.22.0</version>
113125
<configuration>
114126
<encoding>UTF-8</encoding>
115-
<inputEncoding>UTF-8</inputEncoding>
116-
<outputEncoding>UTF-8</outputEncoding>
117-
<argLine>-Dfile.encoding=UTF-8
118-
-Djavax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory</argLine>
127+
<argLine>-Djavax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory</argLine>
119128
</configuration>
120129
</plugin>
121130
<plugin>
@@ -220,7 +229,6 @@
220229
</execution>
221230
</executions>
222231
</plugin>
223-
224232
<plugin>
225233
<groupId>org.sonatype.plugins</groupId>
226234
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -263,4 +271,5 @@
263271
<url>https://raw.github.com/eXist-db/mvn-repo/master/</url>
264272
</repository>
265273
</repositories>
274+
266275
</project>

src/test/java/fr/insee/pogues/test/JSONDeserializerTest.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package fr.insee.pogues.test;
22

3-
import static org.junit.Assert.assertEquals;
4-
5-
import org.junit.Test;
6-
73
import fr.insee.pogues.conversion.JSONDeserializer;
84
import fr.insee.pogues.model.Questionnaire;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertEquals;
98

10-
public class JSONDeserializerTest {
9+
class JSONDeserializerTest {
1110

1211
@Test
13-
public void testQuestionnaire() throws Exception {
12+
void testQuestionnaire() throws Exception {
1413

1514
long startTime = System.currentTimeMillis();
1615

src/test/java/fr/insee/pogues/test/JSONSerializerTest.java

+13-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
package fr.insee.pogues.test;
22

3-
import java.io.File;
4-
3+
import fr.insee.pogues.conversion.JSONSerializer;
4+
import fr.insee.pogues.mock.*;
5+
import fr.insee.pogues.model.*;
56
import org.apache.commons.io.FileUtils;
6-
import org.junit.BeforeClass;
7-
import org.junit.Test;
7+
import org.junit.jupiter.api.Test;
88

9-
import fr.insee.pogues.conversion.JSONSerializer;
10-
import fr.insee.pogues.mock.CodeListFactory;
11-
import fr.insee.pogues.mock.QuestionFactory;
12-
import fr.insee.pogues.mock.QuestionnaireFactory;
13-
import fr.insee.pogues.mock.ResponseFactory;
14-
import fr.insee.pogues.mock.SequenceFactory;
15-
import fr.insee.pogues.model.CodeList;
16-
import fr.insee.pogues.model.QuestionType;
17-
import fr.insee.pogues.model.Questionnaire;
18-
import fr.insee.pogues.model.ResponseType;
19-
import fr.insee.pogues.model.SequenceType;
20-
21-
public class JSONSerializerTest {
22-
23-
@BeforeClass
24-
public static void setUpBeforeClass() throws Exception {
25-
}
9+
import java.io.File;
10+
11+
class JSONSerializerTest {
2612

2713
@Test
28-
public void testQuestionnaire() throws Exception {
14+
void testQuestionnaire() throws Exception {
2915

3016
QuestionnaireFactory factory = new QuestionnaireFactory();
3117
Questionnaire fakeQuestionnaire = factory.createQuestionnaire();
@@ -42,7 +28,7 @@ public void testQuestionnaire() throws Exception {
4228
}
4329

4430
@Test
45-
public void testSequence() throws Exception {
31+
void testSequence() throws Exception {
4632

4733
SequenceFactory factory = new SequenceFactory();
4834
SequenceType fakeSequence = factory.createSequence(2);
@@ -59,7 +45,7 @@ public void testSequence() throws Exception {
5945
}
6046

6147
@Test
62-
public void testCodeList() throws Exception {
48+
void testCodeList() throws Exception {
6349

6450
CodeListFactory factory = new CodeListFactory();
6551
CodeList fakeCodeList = factory.createCodeList();
@@ -76,7 +62,7 @@ public void testCodeList() throws Exception {
7662
}
7763

7864
@Test
79-
public void testQuestion() throws Exception {
65+
void testQuestion() throws Exception {
8066

8167
QuestionFactory factory = new QuestionFactory();
8268
QuestionType fakeQuestion = factory.createQuestion(42);
@@ -93,7 +79,7 @@ public void testQuestion() throws Exception {
9379
}
9480

9581
@Test
96-
public void testQuestionOnly() throws Exception {
82+
void testQuestionOnly() throws Exception {
9783

9884
QuestionFactory factory = new QuestionFactory();
9985
QuestionType fakeQuestion = factory.createQuestionOnly(50);
@@ -110,7 +96,7 @@ public void testQuestionOnly() throws Exception {
11096
}
11197

11298
@Test
113-
public void testResponse() throws Exception {
99+
void testResponse() throws Exception {
114100

115101
ResponseFactory factory = new ResponseFactory();
116102
ResponseType fakeResponse = factory.createResponse();

src/test/java/fr/insee/pogues/test/TranslatorsTest.java

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
package fr.insee.pogues.test;
22

3-
import java.io.File;
4-
5-
import org.apache.commons.io.FileUtils;
6-
import org.junit.BeforeClass;
7-
import org.junit.Test;
8-
93
import fr.insee.pogues.conversion.JSONToXMLTranslator;
104
import fr.insee.pogues.conversion.XMLToJSONTranslator;
5+
import org.apache.commons.io.FileUtils;
6+
import org.junit.jupiter.api.Test;
117

12-
public class TranslatorsTest {
8+
import java.io.File;
139

14-
@BeforeClass
15-
public static void setUpBeforeClass() throws Exception {
16-
}
10+
class TranslatorsTest {
1711

1812
@Test
19-
public void testQuestionnaireJSONToXML() throws Exception {
13+
void testQuestionnaireJSONToXML() throws Exception {
2014

2115
long startTime = System.currentTimeMillis();
2216

@@ -32,7 +26,7 @@ public void testQuestionnaireJSONToXML() throws Exception {
3226
}
3327

3428
@Test
35-
public void testQuestionnaireXMLToJSON() throws Exception {
29+
void testQuestionnaireXMLToJSON() throws Exception {
3630

3731
long startTime = System.currentTimeMillis();
3832

@@ -48,7 +42,7 @@ public void testQuestionnaireXMLToJSON() throws Exception {
4842
}
4943

5044
@Test
51-
public void testSequenceJSONToXML() throws Exception {
45+
void testSequenceJSONToXML() throws Exception {
5246

5347
long startTime = System.currentTimeMillis();
5448

@@ -65,7 +59,7 @@ public void testSequenceJSONToXML() throws Exception {
6559
}
6660

6761
@Test
68-
public void testSequenceXMLToJSON() throws Exception {
62+
void testSequenceXMLToJSON() throws Exception {
6963

7064
long startTime = System.currentTimeMillis();
7165

@@ -84,7 +78,7 @@ public void testSequenceXMLToJSON() throws Exception {
8478

8579

8680
@Test
87-
public void testQuestionJSONToXML() throws Exception {
81+
void testQuestionJSONToXML() throws Exception {
8882

8983
long startTime = System.currentTimeMillis();
9084

@@ -100,7 +94,7 @@ public void testQuestionJSONToXML() throws Exception {
10094
}
10195

10296
@Test
103-
public void testQuestionXMLToJSON() throws Exception {
97+
void testQuestionXMLToJSON() throws Exception {
10498

10599
long startTime = System.currentTimeMillis();
106100

@@ -116,7 +110,7 @@ public void testQuestionXMLToJSON() throws Exception {
116110
}
117111

118112
@Test
119-
public void testCodeListsJSONToXML() throws Exception {
113+
void testCodeListsJSONToXML() throws Exception {
120114

121115
long startTime = System.currentTimeMillis();
122116

@@ -132,7 +126,7 @@ public void testCodeListsJSONToXML() throws Exception {
132126
}
133127

134128
@Test
135-
public void testCodeListsXMLToJSON() throws Exception {
129+
void testCodeListsXMLToJSON() throws Exception {
136130

137131
long startTime = System.currentTimeMillis();
138132

0 commit comments

Comments
 (0)