java: Update tests to use JUnit 5.7.0

This commit is contained in:
Mizux Seiha
2020-09-14 23:49:23 +02:00
parent 7d413479f6
commit 815be4f486
8 changed files with 341 additions and 308 deletions

View File

@@ -76,17 +76,21 @@ public class Loader {
}
/** Unpack and Load the native libraries needed for using ortools-java.*/
private static boolean loaded = false;
public static void loadNativeLibraries() {
try {
URI resourceURI = getNativeResourceURI();
Path tempPath = unpackNativeResources(resourceURI);
// Load the native library
System.load(
tempPath.resolve(Platform.RESOURCE_PREFIX)
.resolve(System.mapLibraryName("jniortools"))
.toString());
} catch (IOException e) {
throw new RuntimeException(e);
if(!loaded) {
try {
URI resourceURI = getNativeResourceURI();
Path tempPath = unpackNativeResources(resourceURI);
// Load the native library
System.load(
tempPath.resolve(Platform.RESOURCE_PREFIX)
.resolve(System.mapLibraryName("jniortools"))
.toString());
loaded = true;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}