Search in sources :

Example 6 with RskTestContext

use of org.ethereum.util.RskTestContext 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();
}
Also used : RskTestContext(org.ethereum.util.RskTestContext) RskContext(co.rsk.RskContext) Test(org.junit.Test)

Example 7 with RskTestContext

use of org.ethereum.util.RskTestContext 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();
}
Also used : RskTestContext(org.ethereum.util.RskTestContext) RskContext(co.rsk.RskContext) Test(org.junit.Test)

Example 8 with RskTestContext

use of org.ethereum.util.RskTestContext 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();
}
Also used : RskTestContext(org.ethereum.util.RskTestContext) RskContext(co.rsk.RskContext) Test(org.junit.Test)

Example 9 with RskTestContext

use of org.ethereum.util.RskTestContext in project rskj by rsksmart.

the class NodeRunnerSmokeTest method regtestSmokeTest.

@Test
public void regtestSmokeTest() {
    RskTestContext rskContext = new RskTestContext(new String[] { "--regtest" });
    assertThat(rskContext.getNodeRunner(), notNullValue());
    rskContext.close();
}
Also used : RskTestContext(org.ethereum.util.RskTestContext) Test(org.junit.Test)

Example 10 with RskTestContext

use of org.ethereum.util.RskTestContext in project rskj by rsksmart.

the class NodeRunnerSmokeTest method mainnetSmokeTest.

@Test
public void mainnetSmokeTest() {
    RskTestContext rskContext = new RskTestContext(new String[0]);
    assertThat(rskContext.getNodeRunner(), notNullValue());
    rskContext.close();
}
Also used : RskTestContext(org.ethereum.util.RskTestContext) Test(org.junit.Test)

Aggregations

RskTestContext (org.ethereum.util.RskTestContext)16 Test (org.junit.Test)13 RskContext (co.rsk.RskContext)8 Before (org.junit.Before)3 TestGenesisLoader (co.rsk.core.genesis.TestGenesisLoader)2 Keccak256 (co.rsk.crypto.Keccak256)2 Genesis (org.ethereum.core.Genesis)2 GenesisLoader (org.ethereum.core.genesis.GenesisLoader)2 RskSystemProperties (co.rsk.config.RskSystemProperties)1 RepositoryLocator (co.rsk.db.RepositoryLocator)1 BlockValidator (co.rsk.validators.BlockValidator)1 ActivationConfig (org.ethereum.config.blockchain.upgrades.ActivationConfig)1 BlockStore (org.ethereum.db.BlockStore)1