ExecutableCallContext extends DefaultContext { public boolean isOnLastExecutable() { return currentElement().isLastExecutable(); } ExecutableCallContext(final List<RobotFile> models, final List<ExecutableWithDescriptor> elements, final int index,
            final URI locationUri, final int line, final RobotBreakpointSupplier breakpointSupplier);   ExecutableCallContext(final List<RobotFile> models, final List<ExecutableWithDescriptor> elements, final int index,
            final URI locationUri, final int line, final String errorMessage,
            final RobotBreakpointSupplier breakpointSupplier); @Override boolean isErroneous(); @Override Optional<String> getErrorMessage(); @Override Optional<URI> getAssociatedPath(); @Override Optional<FileRegion> getFileRegion(); boolean isOnLastExecutable(); @Override StackFrameContext moveTo(final RunningKeyword runningKeyword,
            final RobotBreakpointSupplier breakpointSupplier); @Override Optional<RobotBreakpoint> getLineBreakpoint(); @Override Optional<RobotBreakpoint> getKeywordFailBreakpoint(final QualifiedKeywordName currentlyFailedKeyword);  }
@Test public void contextIsOnLastExecutableCheck() { final RobotFile model = ModelBuilder.modelForFile() .withTestCasesTable() .withTestCase("test") .executable("log", "10") .executable("log", "20") .executable("log", "30") .build(); final List<RobotExecutableRow<TestCase>> rows = model.getTestCaseTable() .getTestCases() .get(0) .getExecutionContext(); final List<ExecutableWithDescriptor> executables = ExecutablesCompiler.compileExecutables(rows, null); final ExecutableCallContext context = new ExecutableCallContext(newArrayList(), executables, 2, URI.create("file: assertThat(context.isOnLastExecutable()).isTrue(); }
@Test public void contextIsNotOnLastExecutableCheck() { final RobotFile model = ModelBuilder.modelForFile() .withTestCasesTable() .withTestCase("test") .executable("log", "10") .executable("log", "20") .executable("log", "30") .build(); final List<RobotExecutableRow<TestCase>> rows = model.getTestCaseTable() .getTestCases() .get(0) .getExecutionContext(); final List<ExecutableWithDescriptor> executables = ExecutablesCompiler.compileExecutables(rows, null); final ExecutableCallContext context = new ExecutableCallContext(newArrayList(), executables, 1, URI.create("file: assertThat(context.isOnLastExecutable()).isFalse(); }