Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed h2database dependency from tests that use JSON Reader #803

Merged
merged 1 commit into from Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions rskj-core/build.gradle
Expand Up @@ -97,7 +97,6 @@ dependencies {
testCompile "org.powermock:powermock-module-junit4:${powermockitoVersion}"
testCompile "org.powermock:powermock-api-mockito:${powermockitoVersion}"
testCompile "co.rsk:lll-compiler:${rskLllVersion}"
testCompile "com.h2database:h2:1.4.193"
testCompile "org.awaitility:awaitility:3.0.0"
testCompile 'commons-io:commons-io:2.5'
testCompile 'commons-codec:commons-codec:1.10'
Expand All @@ -113,12 +112,11 @@ dependencyVerification {
'com.fasterxml.jackson.core:jackson-annotations:4caf3936315439b509b8c3ef494d4e47eaa6d25c3b5299aadb0eafb3944ed32f',
'com.fasterxml.jackson.core:jackson-core:256ff34118ab292d1b4f3ee4d2c3e5e5f0f609d8e07c57e8ad1f51c46d4fbb46',
'com.fasterxml.jackson.core:jackson-databind:4f74337b6d18664be0f5b15c6664b17aa3972c9c175092328b139b894ff66f19',
'com.github.briandilley.jsonrpc4j:jsonrpc4j:bb2cde1f554e152e69741353c6630e02e69f217abbd6703f8c038e6ed637c105',
'com.github.briandilley.jsonrpc4j:jsonrpc4j:bb2cde1f554e152e69741353c6630e02e69f217abbd6703f8c038e6ed637c105',
'com.google.code.findbugs:jsr305:1e7f53fa5b8b5c807e986ba335665da03f18d660802d8bf061823089d1bee468',
'com.google.guava:guava:d664fbfc03d2e5ce9cab2a44fb01f1d0bf9dfebeccc1a473b1f9ea31f79f6f99',
'com.google.protobuf:protobuf-java:55aa554843983f431df5616112cf688d38aa17c132357afd1c109435bfdac4e6',
'com.googlecode.json-simple:json-simple:4e69696892b88b41c55d49ab2fdcc21eead92bf54acc588c0050596c3b75199c',
'com.h2database:h2:b1cf34c64871014aa73580281cc464dfa72450d8860cc0752fc175e87edd6544',
'com.lambdaworks:scrypt:9a82d218099fb14c10c0e86e7eefeebd8c104de920acdc47b8b4b7a686fb73b4',
'com.madgag.spongycastle:core:07a401edbe26e1028e2324754557b741cc57306008df7b71a9e12ec32d65be8f',
'com.squareup.okhttp:okhttp:b4c943138fcef2bcc9d2006b2250c4aabbedeafc5947ed7c0af7fd103ceb2707',
Expand Down
17 changes: 5 additions & 12 deletions rskj-core/src/test/java/org/ethereum/jsontestsuite/JSONReader.java
Expand Up @@ -21,7 +21,7 @@

import co.rsk.config.TestSystemProperties;
import org.apache.commons.codec.binary.Base64;
import org.h2.util.IOUtils;
import org.apache.commons.io.IOUtils;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
Expand All @@ -32,6 +32,7 @@
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -51,20 +52,12 @@ public static String loadJSON(String filename) {
public static String loadJSONFromResource(String resname, ClassLoader loader) {
System.out.println("Loading local resource: " + resname);

try {
InputStreamReader reader = new InputStreamReader(loader.getResourceAsStream(resname));
StringWriter writer = new StringWriter();

IOUtils.copyAndCloseInput(reader, writer, 100000000);

writer.close();

return writer.toString();
try (InputStream reader = loader.getResourceAsStream(resname)) {
return IOUtils.toString(reader, StandardCharsets.UTF_8);
} catch (IOException e) {
e.printStackTrace();
return "";
}

return "";
}

public static String loadJSONFromCommit(String filename, String shacommit) {
Expand Down