private CRaSHTaskDef validateAndParseCronLine(String cronLine) { // cronLine = cronLine.trim(); if (cronLine.length() == 0 || cronLine.charAt(0) == '#') { return null; } // List<String> cronLineParts = Arrays.asList(cronLine.split("\\s+")); if (cronLineParts.size() < 6) { return null; } // String schedulePart = Utils.join(cronLineParts.subList(0, 5), " "); String commandPart = Utils.join(cronLineParts.subList(5, cronLineParts.size()), " "); try { return new CRaSHTaskDef(new SchedulingPattern(schedulePart), commandPart); } catch (InvalidPatternException e) { // ? return null; } } }
public void assertRender(LineReader renderer, int width, String... expected) { List<String> result = render(renderer, width); if (result.size() != expected.length) { throw failure("Was expecting the same number of lines got:" + Utils.join(result, "/") + " expected:" + Utils.join(Arrays.asList(expected), "/")); } else { for (int i = 0;i < expected.length;i++) { if (!result.get(i).equals(expected[i])) { throw failure("Was expecting line " + i + " <" + result.get(i) + "> to be equals to <" + expected[i] + ">"); } } } } }
final InternetAddress[] addresses = InternetAddress.parse(Utils.join(recipients, ","));
final InternetAddress[] addresses = InternetAddress.parse(Utils.join(recipients, ","));