Ref ANY23-310 - add unit test with options without logging file Signed-off-by:Jacek Grzebyta <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/379b8c8b Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/379b8c8b Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/379b8c8b Branch: refs/heads/master Commit: 379b8c8bdfeab0a0804d94ba5746a8a7b34fb8ff Parents: 38c8028 Author: Jacek Grzebyta <[email protected]> Authored: Wed Jul 26 00:35:30 2017 +0100 Committer: Jacek Grzebyta <[email protected]> Committed: Wed Jul 26 00:35:30 2017 +0100 ---------------------------------------------------------------------- .../org/apache/any23/cli/SimpleRoverTest.java | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/379b8c8b/cli/src/test/java/org/apache/any23/cli/SimpleRoverTest.java ---------------------------------------------------------------------- diff --git a/cli/src/test/java/org/apache/any23/cli/SimpleRoverTest.java b/cli/src/test/java/org/apache/any23/cli/SimpleRoverTest.java index 76cd5cf..f659539 100644 --- a/cli/src/test/java/org/apache/any23/cli/SimpleRoverTest.java +++ b/cli/src/test/java/org/apache/any23/cli/SimpleRoverTest.java @@ -22,6 +22,7 @@ import java.util.Collection; import org.apache.any23.util.FileUtils; import org.apache.pdfbox.util.Charsets; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -93,5 +94,33 @@ public class SimpleRoverTest extends ToolTestBase { Assert.assertFalse(extractors.isEmpty()); Assert.assertEquals("Unexpected exit code.", 0, exitCode); } + + /** + * Ref {@link https://issues.apache.org/jira/browse/ANY23-310} unit test. + * + * Example without the logging file. + * + * By default that test is not active. It might be useful for debugging. + * @throws Exception + */ + @Test + @Ignore + public void ref310ExtendedTest() + throws Exception { + File outputFile = File.createTempFile("rover-test", ".ttl", tempDirectory); + + int exitCode = runTool(String.format("-o %s -f turtle -e yaml,csv -d %s %s", + outputFile.getAbsolutePath(), + baseUri, + copyResourceToTempFile(filePath).getAbsolutePath())); + + Assert.assertTrue(outputFile.exists()); + // check if output file is longer than 10 chracters + String outputFileContent = FileUtils.readFileContent(outputFile); + Assert.assertTrue(outputFileContent.length() > 10); + + + Assert.assertEquals("Unexpected exit code.", 0, exitCode); + } }
