Verify extends ConsoleCommand { @Override public void execute(String... tokens) { if (tokens.length != 2 && tokens.length != 4) { writeln(getHelpLong()); return; } String dataPath = parseDataPath(tokens[1]); verify(dataPath); if (tokens.length == 4) { String shaclPath = parseDataPath(tokens[2]); String reportFile = tokens[3]; shacl(dataPath, shaclPath, reportFile); } } Verify(ConsoleIO consoleIO, 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 testVerifyBrokenFile() throws IOException { cmd.execute("verify", copyFromRes("broken.ttl")); assertTrue(io.wasErrorWritten()); }
@Test public final void testVerifyMissingType() throws IOException { cmd.execute("verify", copyFromRes("missing_type.ttl")); assertTrue(io.wasErrorWritten()); }
@Test public final void testVerifySpaceIRI() throws IOException { cmd.execute("verify", copyFromRes("space_iri.ttl")); assertTrue(io.wasErrorWritten()); }
@Test public final void testVerifyWrongLang() throws IOException { cmd.execute("verify", copyFromRes("wrong_lang.ttl")); assertTrue(io.wasErrorWritten()); }
@Test public final void testShaclInvalid() throws IOException { File report = LOCATION.newFile(); cmd.execute("verify", copyFromRes("ok.ttl"), copyFromRes("shacl_invalid.ttl"), report.toString()); assertTrue(io.wasErrorWritten()); assertTrue(Files.size(report.toPath()) > 0); }
@Test public final void testVerifyWrongFormat() { cmd.execute("verify", "does-not-exist.docx"); assertTrue(io.wasErrorWritten()); }
@Test public final void testVerifyOK() throws IOException { cmd.execute("verify", copyFromRes("ok.ttl")); assertFalse(io.wasErrorWritten()); }
@Test public final void testVerifyOKWorkDir() throws IOException { setWorkingDir(cmd); copyFromRes("ok.ttl"); cmd.execute("verify", "ok.ttl"); assertFalse(io.wasErrorWritten()); }