Skip to content

Commit

Permalink
Merge pull request #56 from embulk/test-with-multiple-Jackson-versions
Browse files Browse the repository at this point in the history
Test with multiple Jackson versions
  • Loading branch information
dmikurube authored Aug 25, 2023
2 parents 9f1871d + 6f4f237 commit 8bb882e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
jacksonVersion: [ "2.6.7.5", "2.7.9", "2.8.11", "2.9.10", "2.10.5", "2.11.4", "2.12.7", "2.13.5", "2.14.3", "2.15.2" ]
steps:
- uses: actions/checkout@v3
- name: Set up OpenJDK 8
Expand All @@ -16,5 +18,5 @@ jobs:
java-version: 8
distribution: "temurin"
cache: "gradle"
- name: Check
run: ./gradlew --stacktrace check
- name: Check with Jackson ${{ matrix.jacksonVersion }}
run: ./gradlew --stacktrace -PjacksonVersionForJacksonTest=${{ matrix.jacksonVersion }} check
18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ plugins {
id "checkstyle"
}

ext {
if (!project.hasProperty("jacksonVersionForJacksonTest")) {
jacksonVersionForJacksonTest = "2.6.7.5"
}
}

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -72,12 +78,24 @@ dependencies {
testImplementation "joda-time:joda-time:2.9.2"
testImplementation "ch.qos.logback:logback-classic:1.3.5"

testImplementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersionForJacksonTest")
testImplementation "com.fasterxml.jackson.core:jackson-annotations"
testImplementation "com.fasterxml.jackson.core:jackson-core"
testImplementation "com.fasterxml.jackson.core:jackson-databind"
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" // Required for java.util.Optional.

legacyTestImplementation "junit:junit:4.13.2"

legacyTestImplementation "org.embulk:embulk-core:0.10.44"
legacyTestImplementation "org.embulk:embulk-deps:0.10.44"
legacyTestImplementation "org.embulk:embulk-junit4:0.10.44"
legacyTestImplementation "ch.qos.logback:logback-classic:1.3.5"

legacyTestImplementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersionForJacksonTest")
legacyTestImplementation "com.fasterxml.jackson.core:jackson-annotations"
legacyTestImplementation "com.fasterxml.jackson.core:jackson-core"
legacyTestImplementation "com.fasterxml.jackson.core:jackson-databind"
legacyTestImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" // Required for java.util.Optional.
}

javadoc {
Expand Down
8 changes: 2 additions & 6 deletions src/test/java/org/embulk/util/config/TestDataSourceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public void testFailToGetNestedAsList() {
try {
impl.get(List.class, "object");
} catch (final ConfigException ex) {
assertTrue(ex.getMessage().startsWith(
"com.fasterxml.jackson.databind.JsonMappingException: "
+ "Can not deserialize instance of java.util.ArrayList out of START_OBJECT token"));
assertTrue(ex.getCause() instanceof com.fasterxml.jackson.core.JsonProcessingException);
return;
}
fail("ConfigException should be thrown by getting a String value as a List.");
Expand All @@ -72,9 +70,7 @@ public void testFailToGetStringAsList() {
try {
impl.get(List.class, "string");
} catch (final ConfigException ex) {
assertTrue(ex.getMessage().startsWith(
"com.fasterxml.jackson.databind.JsonMappingException: "
+ "Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token"));
assertTrue(ex.getCause() instanceof com.fasterxml.jackson.core.JsonProcessingException);
return;
}
fail("ConfigException should be thrown by getting a String value as a List.");
Expand Down

0 comments on commit 8bb882e

Please sign in to comment.