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 @@ -123,8 +123,8 @@ object RdfValidate extends JellyCommand[RdfValidateOptions]:
if streamOptions != o then
throw CriticalException(
s"Stream options do not match the expected options in $optionsFileName\n" +
s"Expected: $o\n" +
s"Actual: $streamOptions",
s"Expected: ${StreamOptionsUtil.prettyPrint(o)}\n" +
s"Actual: ${StreamOptionsUtil.prettyPrint(streamOptions)}",
)
o
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package eu.neverblink.jelly.cli.command.rdf.util

import eu.neverblink.jelly.core.proto.google.v1 as google
import eu.neverblink.jelly.core.proto.v1.RdfStreamOptions

object StreamOptionsUtil:

def prettyPrint(streamOptions: RdfStreamOptions): String = {
val streamOptionsBytes = streamOptions.toByteArray
val googleStreamOptions = google.RdfStreamOptions.parseFrom(streamOptionsBytes)
return googleStreamOptions.toString
}
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,22 @@ class RdfValidateSpec extends AnyWordSpec, Matchers, TestFixtureHelper:
}
e.cause.get shouldBe a[CriticalException]
e.cause.get.getMessage should include("Stream options do not match the expected options")
e.cause.get.getMessage should include("Stream options do not match the expected options")
e.cause.get.getMessage should include("""Expected: stream_name: "Stream"
|physical_type: PHYSICAL_STREAM_TYPE_TRIPLES
|generalized_statements: true
|rdf_star: true
|max_name_table_size: 128
|max_prefix_table_size: 16
|max_datatype_table_size: 16
|logical_type: LOGICAL_STREAM_TYPE_FLAT_TRIPLES
|version: 1""".stripMargin)

e.cause.get.getMessage should include("""Actual: physical_type: PHYSICAL_STREAM_TYPE_TRIPLES
|max_name_table_size: 4000
|max_prefix_table_size: 150
|max_datatype_table_size: 32
|version: 1""".stripMargin)
}
}

Expand Down