Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
Add JDK 21 to the main build
Remove JDK 13 and 18
Add JDK 21 EA
  • Loading branch information
filiphr committed Sep 30, 2023
1 parent 97c389d commit 8db1bb4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/java-ea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [19-ea]
java: [21-ea]
name: 'Linux JDK ${{ matrix.java }}'
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [13, 17, 18]
java: [17, 21]
name: 'Linux JDK ${{ matrix.java }}'
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<org.apache.maven.plugins.enforcer.version>3.0.0-M3</org.apache.maven.plugins.enforcer.version>
<org.apache.maven.plugins.surefire.version>3.0.0-M5</org.apache.maven.plugins.surefire.version>
<org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version>
<org.springframework.version>5.3.18</org.springframework.version>
<org.springframework.version>5.3.30</org.springframework.version>
<org.eclipse.tycho.compiler-jdt.version>1.6.0</org.eclipse.tycho.compiler-jdt.version>
<com.puppycrawl.tools.checkstyle.version>8.36.1</com.puppycrawl.tools.checkstyle.version>
<org.junit.jupiter.version>5.8.0-M1</org.junit.jupiter.version>
<org.junit.jupiter.version>5.10.0</org.junit.jupiter.version>
<junit-pioneer.version>1.4.2</junit-pioneer.version>
<add.release.arguments />
<forkCount>1</forkCount>
Expand Down Expand Up @@ -576,7 +576,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.10</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testSourceToTargetMappingForStrings() {
}

@ProcessorTest
@EnabledForJreRange(min = JRE.JAVA_11)
@EnabledForJreRange(min = JRE.JAVA_11, max = JRE.JAVA_20)
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
public void testSourceToTargetMappingForStringsJdk11() {
Source src = new Source();
Expand All @@ -127,6 +127,33 @@ public void testSourceToTargetMappingForStringsJdk11() {
assertThat( target.getLocalTime() ).isEqualTo( "00:00:00" );
}

@ProcessorTest
@EnabledForJreRange(min = JRE.JAVA_21)
public void testSourceToTargetMappingForStringsJdk21() {
Source src = new Source();
src.setLocalTime( new LocalTime( 0, 0 ) );
src.setLocalDate( new LocalDate( 2014, 1, 1 ) );
src.setLocalDateTime( new LocalDateTime( 2014, 1, 1, 0, 0 ) );
src.setDateTime( new DateTime( 2014, 1, 1, 0, 0, 0, DateTimeZone.UTC ) );

// with given format
Target target = SourceTargetMapper.INSTANCE.sourceToTarget( src );

assertThat( target ).isNotNull();
assertThat( target.getDateTime() ).isEqualTo( "01.01.2014 00:00 UTC" );
assertThat( target.getLocalDateTime() ).isEqualTo( "01.01.2014 00:00" );
assertThat( target.getLocalDate() ).isEqualTo( "01.01.2014" );
assertThat( target.getLocalTime() ).isEqualTo( "00:00" );

// and now with default mappings
target = SourceTargetMapper.INSTANCE.sourceToTargetDefaultMapping( src );
assertThat( target ).isNotNull();
assertThat( target.getDateTime() ).isEqualTo( "1. Januar 2014, 00:00:00 UTC" );
assertThat( target.getLocalDateTime() ).isEqualTo( "1. Januar 2014, 00:00:00" );
assertThat( target.getLocalDate() ).isEqualTo( "1. Januar 2014" );
assertThat( target.getLocalTime() ).isEqualTo( "00:00:00" );
}

@ProcessorTest
public void testStringToDateTime() {
String dateTimeAsString = "01.01.2014 00:00 UTC";
Expand Down

0 comments on commit 8db1bb4

Please sign in to comment.