Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ object RdfValidate extends JellyCommand[RdfValidateOptions]:
)
o
}
if streamOptions.version <= 0 then
throw CriticalException(
"The version field in RdfStreamOptions is <= 0. This field MUST be set to a positive value.",
)
JellyOptions.checkCompatibility(
streamOptions,
expectedOptions.getOrElse(JellyOptions.defaultSupportedOptions),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class RdfValidateSpec extends AnyWordSpec, Matchers, TestFixtureHelper:
val f = RdfStreamFrame(
Seq(
RdfStreamRow(
JellyOptions.smallStrict,
JellyOptions.smallStrict.withVersion(2),
),
),
)
Expand All @@ -349,6 +349,18 @@ class RdfValidateSpec extends AnyWordSpec, Matchers, TestFixtureHelper:
e.cause.get.getMessage should include("Incoming physical stream type is not set")
}

"version in options is set to 0" in {
val f = RdfStreamFrame(
Seq(RdfStreamRow(JellyOptions.smallStrict)),
)
RdfValidate.setStdIn(ByteArrayInputStream(f.toByteArray))
val e = intercept[ExitException] {
RdfValidate.runTestCommand(List("rdf", "validate"))
}
e.cause.get shouldBe a[CriticalException]
e.cause.get.getMessage should include("The version field in RdfStreamOptions is <= 0")
}

"same input options supplied as in the validation source" in withFullJellyFile { j =>
val f = RdfStreamFrame(
Seq(
Expand Down