protected List<String> fetchCandidates(String buffer) { List<String> candidates = new ArrayList<String>(); try { ctx.parseCommandLine(buffer); } catch (CommandFormatException e) { // System.out.println(ctx.getPrefixFormatter().format(ctx.getPrefix()) + ", '" + // buffer + "'"); // e.printStackTrace(); return Collections.emptyList(); } completer.complete(ctx, buffer, 0, candidates); return candidates; }
protected void init() { ctx = new MockCommandContext(); ctx.setOperationCandidatesProvider(new MockOperationCandidatesProvider(root)); completer = new OperationRequestCompleter(); }