@@ -11,26 +11,22 @@ import scala.io.Source
1111import scala .util .Using
1212
1313class RdfFromJellySpec extends AnyWordSpec with Matchers with CleanUpAfterTest :
14+
1415 " rdf from-jelly command" should {
1516 " be able to convert a Jelly file to NTriples output stream" in {
1617 val jellyFile = DataGenHelper .generateJellyFile(3 )
1718 val nQuadString = DataGenHelper .generateNQuadString(3 )
18- val options = RdfFromJellyOptions (outputFile = None )
19- val args = RemainingArgs (indexedRemaining = List (Indexed (jellyFile)), Seq .empty)
2019 val (out, err) =
21- RdfFromJelly .runTest(
22- options,
23- args,
24- )
20+ TestAppRunner .runCommand(RdfFromJelly , List (" rdf" , " from-jelly" , jellyFile))
2521 val sortedOut = out.split(" \n " ).map(_.trim).sorted
2622 val sortedQuads = nQuadString.split(" \n " ).map(_.trim).sorted
2723 sortedOut should contain theSameElementsAs sortedQuads
2824 }
25+
2926 " be able to convert a Jelly stream to NTriples output stream" in {
3027 DataGenHelper .generateJellyInputStream(3 )
3128 val nQuadString = DataGenHelper .generateNQuadString(3 )
32- val options = RdfFromJellyOptions (outputFile = None )
33- val (out, err) = RdfFromJelly .runTest(options)
29+ val (out, err) = TestAppRunner .runCommand(RdfFromJelly , List (" rdf" , " from-jelly" ))
3430 val sortedOut = out.split(" \n " ).map(_.trim).sorted
3531 val sortedQuads = nQuadString.split(" \n " ).map(_.trim).sorted
3632 sortedOut should contain theSameElementsAs sortedQuads
@@ -40,8 +36,11 @@ class RdfFromJellySpec extends AnyWordSpec with Matchers with CleanUpAfterTest:
4036 val args = RemainingArgs (indexedRemaining = List (Indexed (jellyFile)), Seq .empty)
4137 val nQuadString = DataGenHelper .generateNQuadString(3 )
4238 val outputFile = DataGenHelper .generateOutputFile(RDFLanguages .NQUADS )
43- val options = RdfFromJellyOptions (outputFile = Some (outputFile))
44- val (out, err) = RdfFromJelly .runTest(options, args)
39+ val (out, err) =
40+ TestAppRunner .runCommand(
41+ RdfFromJelly ,
42+ List (" rdf" , " from-jelly" , jellyFile, " --to" , outputFile),
43+ )
4544 val sortedOut = Using .resource(Source .fromFile(outputFile)) { content =>
4645 content.getLines().toList.map(_.trim).sorted
4746 }
@@ -53,8 +52,8 @@ class RdfFromJellySpec extends AnyWordSpec with Matchers with CleanUpAfterTest:
5352 DataGenHelper .generateJellyInputStream(3 )
5453 val outputFile = DataGenHelper .generateOutputFile(RDFLanguages .NQUADS )
5554 val nQuadString = DataGenHelper .generateNQuadString(3 )
56- val options = RdfFromJellyOptions (outputFile = Some (outputFile))
57- val (out, err) = RdfFromJelly .runTest(options )
55+ val (out, err) =
56+ TestAppRunner .runCommand( RdfFromJelly , List ( " rdf " , " from-jelly " , " --to " , outputFile) )
5857 val sortedOut = Using .resource(Source .fromFile(outputFile)) { content =>
5958 content.getLines().toList.map(_.trim).sorted
6059 }
0 commit comments