Search in sources :

Example 1 with DslProcessorException

use of co.rsk.test.dsl.DslProcessorException in project rskj by rsksmart.

the class WorldDslProcessorTest method failedAssertBestCommand.

@Test
public void failedAssertBestCommand() {
    World world = new World();
    WorldDslProcessor processor = new WorldDslProcessor(world);
    DslParser parser = new DslParser("block_chain g00 b01 b02\nblock_connect b01 b02\nassert_best b01");
    try {
        processor.processCommands(parser);
        Assert.fail();
    } catch (DslProcessorException ex) {
        Assert.assertEquals("Expected best block 'b01'", ex.getMessage());
    }
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) World(co.rsk.test.World) DslProcessorException(co.rsk.test.dsl.DslProcessorException) Test(org.junit.Test)

Example 2 with DslProcessorException

use of co.rsk.test.dsl.DslProcessorException in project rskj by rsksmart.

the class WorldDslProcessorTest method raiseIfUnknownCommand.

@Test
public void raiseIfUnknownCommand() {
    WorldDslProcessor processor = new WorldDslProcessor(new World());
    try {
        processor.processCommands(new DslParser("foo"));
        Assert.fail();
    } catch (DslProcessorException ex) {
        Assert.assertEquals("Unknown command 'foo'", ex.getMessage());
    }
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) World(co.rsk.test.World) DslProcessorException(co.rsk.test.dsl.DslProcessorException) Test(org.junit.Test)

Aggregations

World (co.rsk.test.World)2 DslParser (co.rsk.test.dsl.DslParser)2 DslProcessorException (co.rsk.test.dsl.DslProcessorException)2 WorldDslProcessor (co.rsk.test.dsl.WorldDslProcessor)2 Test (org.junit.Test)2