Convert extends ConsoleCommand { @Override public void execute(String... tokens) { if (tokens.length < 3) { writeln(getHelpLong()); return; } convert(tokens[1], tokens[2]); } Convert(ConsoleIO consoleIO, ConsoleState state, Map<String, ConsoleSetting> settings); @Override String getName(); @Override String getHelpShort(); @Override String getHelpLong(); @Override String[] usesSettings(); @Override void execute(String... tokens);  }
@Test public final void testConvertParseError() throws IOException { File wrong = LOCATION.newFile("wrong.nt"); Files.write(wrong.toPath(), "error".getBytes()); File json = LOCATION.newFile("empty.jsonld"); cmd.execute("convert", wrong.toString(), json.toString()); verify(mockConsoleIO).writeError(anyString()); assertFalse(mockConsoleIO.wasErrorWritten()); }
@Test public final void testConvertInvalidFormat() throws IOException { File qyx = LOCATION.newFile("alien.qyx"); cmd.execute("convert", from.toString(), qyx.toString()); verify(mockConsoleIO).writeError("No RDF writer for " + qyx.toString()); }