use of co.rsk.RskContext in project rskj by rsksmart.
the class PreflightChecksUtilsTest method runChecks_receivesSkipJavaCheck_skipsJavaChecks.
@Test
public void runChecks_receivesSkipJavaCheck_skipsJavaChecks() throws Exception {
String[] args = { "--skip-java-check" };
RskContext rskContext = new RskTestContext(args);
PreflightChecksUtils preflightChecksUtilsSpy = spy(new PreflightChecksUtils(rskContext));
when(preflightChecksUtilsSpy.getJavaVersion()).thenReturn(null);
preflightChecksUtilsSpy.runChecks();
verify(preflightChecksUtilsSpy, times(0)).getJavaVersion();
rskContext.close();
}
use of co.rsk.RskContext in project rskj by rsksmart.
the class PreflightChecksUtilsTest method runChecks_currentJavaVersionIs1dot8_OK.
@Test
public void runChecks_currentJavaVersionIs1dot8_OK() throws Exception {
RskContext rskContext = new RskTestContext(new String[0]);
PreflightChecksUtils preflightChecksUtilsSpy = spy(new PreflightChecksUtils(rskContext));
when(preflightChecksUtilsSpy.getJavaVersion()).thenReturn("1.8");
preflightChecksUtilsSpy.runChecks();
verify(preflightChecksUtilsSpy, times(1)).getJavaVersion();
verify(preflightChecksUtilsSpy, times(1)).getIntJavaVersion("1.8");
rskContext.close();
}
use of co.rsk.RskContext in project rskj by rsksmart.
the class PreflightChecksUtilsTest method runChecks_runAllChecks_OK.
@Test
public void runChecks_runAllChecks_OK() throws Exception {
RskContext rskContext = new RskTestContext(new String[0]);
PreflightChecksUtils preflightChecksUtilsSpy = spy(new PreflightChecksUtils(rskContext));
when(preflightChecksUtilsSpy.getJavaVersion()).thenReturn("1.8.0_275");
preflightChecksUtilsSpy.runChecks();
verify(preflightChecksUtilsSpy, times(1)).getJavaVersion();
verify(preflightChecksUtilsSpy, times(1)).getIntJavaVersion("1.8.0_275");
verify(preflightChecksUtilsSpy, times(1)).checkSupportedJavaVersion();
rskContext.close();
}
use of co.rsk.RskContext in project rskj by rsksmart.
the class PreflightChecksUtilsTest method getIntJavaVersion_OK.
@Test
public void getIntJavaVersion_OK() {
RskContext rskContext = new RskTestContext(new String[0]);
PreflightChecksUtils preflightChecksUtils = new PreflightChecksUtils(rskContext);
assertEquals(preflightChecksUtils.getIntJavaVersion("1.8.0_275"), 8);
assertEquals(preflightChecksUtils.getIntJavaVersion("1.8.0_72-ea"), 8);
assertEquals(preflightChecksUtils.getIntJavaVersion("11.8.0_71-ea"), 11);
assertEquals(preflightChecksUtils.getIntJavaVersion("11.0"), 11);
assertEquals(preflightChecksUtils.getIntJavaVersion("9"), 9);
assertEquals(preflightChecksUtils.getIntJavaVersion("11"), 11);
assertEquals(preflightChecksUtils.getIntJavaVersion("333"), 333);
assertEquals(preflightChecksUtils.getIntJavaVersion("9-ea"), 9);
rskContext.close();
}
use of co.rsk.RskContext in project rskj by rsksmart.
the class IndexBlooms method main.
public static void main(String[] args) {
try (RskContext ctx = new RskContext(args)) {
BlockStore blockStore = ctx.getBlockStore();
BlocksBloomStore blocksBloomStore = ctx.getBlocksBloomStore();
execute(makeBlockRange(args, blockStore), blockStore, blocksBloomStore);
}
}
Aggregations