Skip to content

Commit

Permalink
Update libraries and fix java 14 compatibility issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshilliard committed Mar 14, 2020
1 parent c9f056e commit af46eb0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ subprojects {
systemProperty 'user.language', 'en'
}
jacoco {
toolVersion = '0.8.4'
toolVersion = '0.8.5'
}
}

Expand Down
2 changes: 1 addition & 1 deletion jpos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}
dependencies {
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1'
classpath 'org.owasp:dependency-check-gradle:5.2.1'
classpath 'org.owasp:dependency-check-gradle:5.3.1'
}
}
apply plugin: 'biz.aQute.bnd.builder'
Expand Down
24 changes: 12 additions & 12 deletions jpos/libraries.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ ext {
jline: 'org.jline:jline:3.14.0',
beanshell: 'org.apache-extras.beanshell:bsh:2.0b6',
javatuples: 'org.javatuples:javatuples:1.2',
javassist: 'org.javassist:javassist:3.25.0-GA',
javassist: 'org.javassist:javassist:3.26.0-GA',
osgi_core: 'org.osgi:org.osgi.core:6.0.0',
mockito: 'org.mockito:mockito-core:3.0.0',
mockito_jupiter: 'org.mockito:mockito-junit-jupiter:3.0.0',
mockito: 'org.mockito:mockito-core:3.3.3',
mockito_jupiter: 'org.mockito:mockito-junit-jupiter:3.3.3',
fest_assert: 'org.easytesting:fest-assert:1.4',
xmlunit: 'xmlunit:xmlunit:1.6',
junit: 'org.junit.jupiter:junit-jupiter:5.5.2',
junit: 'org.junit.jupiter:junit-jupiter:5.6.0',
bouncycastle: [
'org.bouncycastle:bcprov-jdk15on:1.63',
'org.bouncycastle:bcpg-jdk15on:1.63'
'org.bouncycastle:bcprov-jdk15on:1.64',
'org.bouncycastle:bcpg-jdk15on:1.64'
],
hamcrest: 'org.hamcrest:hamcrest:2.1',
sshd: 'org.apache.sshd:sshd-core:2.3.0',
slf4j_api: "org.slf4j:slf4j-api:1.7.28",
slf4j_nop: "org.slf4j:slf4j-nop:1.7.28",
hdrhistogram: 'org.hdrhistogram:HdrHistogram:2.1.11',
yaml: "org.yaml:snakeyaml:1.25"
hamcrest: 'org.hamcrest:hamcrest:2.2',
sshd: 'org.apache.sshd:sshd-core:2.4.0',
slf4j_api: "org.slf4j:slf4j-api:1.7.30",
slf4j_nop: "org.slf4j:slf4j-nop:1.7.30",
hdrhistogram: 'org.hdrhistogram:HdrHistogram:2.1.12',
yaml: "org.yaml:snakeyaml:1.26"
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import java.util.Map;
import static org.junit.jupiter.api.Assertions.*;

import static org.apache.commons.lang3.JavaVersion.JAVA_13;
import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtMost;

import javax.crypto.spec.SecretKeySpec;

import org.javatuples.Pair;
Expand Down Expand Up @@ -886,7 +889,11 @@ public void testVerifyDCVVImplException1() throws Throwable {
,serviceCode, atc, MKDMethod.OPTION_A);
fail("Expected SMException to be thrown");
} catch (SMException ex){
assertEquals("String index out of range: -4", ex.getNested().getMessage(), "ex.getMessage()");
if (isJavaVersionAtMost(JAVA_13)) {
assertEquals("String index out of range: -4", ex.getNested().getMessage(), "ex.getMessage()");
} else {
assertEquals("begin 4, end 0, length 0", ex.getNested().getMessage(), "ex.getMessage()");
}
}
}

Expand Down
21 changes: 18 additions & 3 deletions jpos/src/test/java/org/jpos/util/FSDMsgTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.when;

import static org.apache.commons.lang3.JavaVersion.JAVA_13;
import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtMost;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
Expand Down Expand Up @@ -183,7 +186,11 @@ public void testDumpThrowsStringIndexOutOfBoundsException() throws Throwable {
fSDMsg.dump(p, "testFSDMsgIndent");
fail("Expected StringIndexOutOfBoundsException to be thrown");
} catch (StringIndexOutOfBoundsException ex) {
assertEquals("String index out of range: -2", ex.getMessage(), "ex.getMessage()");
if (isJavaVersionAtMost(JAVA_13)) {
assertEquals("String index out of range: -2", ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("begin 2, end 0, length 0", ex.getMessage(), "ex.getMessage()");
}
assertEquals(0, fSDMsg.fields.size(), "fSDMsg.fields.size()");
}
}
Expand Down Expand Up @@ -364,7 +371,11 @@ public void testGetHexHeaderThrowsStringIndexOutOfBoundsException() throws Throw
fSDMsg.getHexHeader();
fail("Expected StringIndexOutOfBoundsException to be thrown");
} catch (StringIndexOutOfBoundsException ex) {
assertEquals("String index out of range: -2", ex.getMessage(), "ex.getMessage()");
if (isJavaVersionAtMost(JAVA_13)) {
assertEquals("String index out of range: -2", ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("begin 2, end 0, length 0", ex.getMessage(), "ex.getMessage()");
}
}
}

Expand Down Expand Up @@ -956,7 +967,11 @@ public void testToXMLThrowsStringIndexOutOfBoundsException() throws Throwable {
fSDMsg.toXML();
fail("Expected StringIndexOutOfBoundsException to be thrown");
} catch (StringIndexOutOfBoundsException ex) {
assertEquals("String index out of range: -2", ex.getMessage(), "ex.getMessage()");
if (isJavaVersionAtMost(JAVA_13)) {
assertEquals("String index out of range: -2", ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("begin 2, end 0, length 0", ex.getMessage(), "ex.getMessage()");
}
assertEquals(0, fSDMsg.fields.size(), "fSDMsg.fields.size()");
}
}
Expand Down

0 comments on commit af46eb0

Please sign in to comment.