-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Almost done. Missing: stream API (maybe do it in a separate PR?) and RIOT/Rio tests with stuff like serializing a whole dataset / graph. It's hard to test this sensibly in integration-tests, because there are too many different APIs to work with...
- Loading branch information
1 parent
d6b8e96
commit 3abe032
Showing
10 changed files
with
96 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+2.11 KB
integration-tests/src/test/resources/backcompat/riverbench_main_v1_1_0.jelly
Binary file not shown.
Binary file added
BIN
+23 KB
integration-tests/src/test/resources/backcompat/riverbench_nanopubs_v1_1_0.jelly
Binary file not shown.
Binary file added
BIN
+3.25 KB
integration-tests/src/test/resources/backcompat/weather_quads_v1_1_0.jelly
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...s/src/test/scala/eu/ostrzyciel/jelly/integration_tests/util/MakeBackCompatTestCases.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package eu.ostrzyciel.jelly.integration_tests.util | ||
|
||
import eu.ostrzyciel.jelly.convert.jena.riot.{JellyFormatVariant, JellyLanguage} | ||
import eu.ostrzyciel.jelly.core.Constants | ||
import eu.ostrzyciel.jelly.integration_tests.BackCompatSpec.testCases | ||
import org.apache.jena.riot.{Lang, RDFDataMgr, RDFFormat} | ||
import org.apache.jena.sparql.core.DatasetGraphFactory | ||
|
||
import java.nio.file.{Files, Path} | ||
|
||
/** | ||
* Utility to generate *.jelly files for later back-compat testing. | ||
* These live in resources/backcompat. | ||
* | ||
* Run this utility after increasing the protocol version in the Constants class. | ||
*/ | ||
object MakeBackCompatTestCases: | ||
|
||
@main | ||
def runMakeBackCompatTestCases(): Unit = | ||
val version = Constants.protoSemanticVersion.replace(".", "_") | ||
for (fileName, description, versions) <- testCases do | ||
val jenaDg = DatasetGraphFactory.create() | ||
RDFDataMgr.read( | ||
jenaDg, | ||
getClass.getResourceAsStream(s"/backcompat/$fileName.trig"), | ||
Lang.TRIG | ||
) | ||
val v2Format = new RDFFormat( | ||
JellyLanguage.JELLY, | ||
// enable this to make this into a Jelly 1.1.0 file | ||
JellyFormatVariant(enableNamespaceDeclarations = true) | ||
) | ||
RDFDataMgr.write( | ||
Files.newOutputStream(Path.of(s"integration-tests/src/test/resources/backcompat/${fileName}_v$version.jelly")), | ||
jenaDg, | ||
v2Format | ||
) | ||
println(s"Generated ${fileName}_v$version.jelly") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters