Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consistent namespace convention #458

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
@@ -1,4 +1,4 @@
namespace cardinality
namespace serialization.test.roundtripfail.cardinality
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The round trip tests all take an input, deserialise it into a Rune object, then serialise it out and assert that the before input matches the resulting output. The error handling tests will assert an error when you attempt to serialise back out on that last step. Could we rename all these error namespaces to remove the roundtrip to avoid confusion. How about serialization.test.error...

Copy link
Contributor Author

@dschwartznyc dschwartznyc Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not plussed about the specific naming as long as there are no clashes and there's a clear delineation between the collection of tests that are expected to pass and the collection that are expected to fail. We use that distinction to automatically differentiate the tests according to their expected outcomes (assert pass vs assert fail).

For example:

passing tests: serialization.test.pass...
failing tests: serialization.test.fail...


annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model": "test.cardinality",
"@type": "test.cardinality.Root",
"@model": "serialization",
"@type": "serialization.test.roundtripfail.cardinality.Root",
"@version": "0.0.0",
"stringList": ["foo", "bar", "baz"]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model": "test.parameterised",
"@type": "test.parameterised.Root",
"@model": "serialization",
"@type": "serialization.test.roundtripfail.parameterised.Root",
"@version": "0.0.0",
"parameterisedNumber": 1.23456789
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model": "test.parameterised",
"@type": "test.parameterised.Root",
"@model": "serialization",
"@type": "serialization.test.roundtripfail.parameterised.Root",
"@version": "0.0.0",
"parameterisedNumber": 123456789
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace parameterised
namespace serialization.test.roundtripfail.parameterised

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model": "test.parameterised",
"@type": "test.parameterised.Root",
"@model": "serialization",
"@type": "serialization.test.roundtripfail.parameterised.Root",
"@version": "0.0.0",
"parameterisedString": "$$"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model": "test.parameterised",
"@type": "test.parameterised.Root",
"@model": "serialization",
"@type": "serialization.test.roundtripfail.parameterised.Root",
"@version": "0.0.0",
"parameterisedString": "abcdefg"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.basic.Root",
"@type" : "serialization.test.roundtrip.basic.Root",
"@version" : "0.0.0",
"basicList" : {
"booleanTypes" : [ true, false, true ],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.basic.Root",
"@type" : "serialization.test.roundtrip.basic.Root",
"@version" : "0.0.0",
"basicSingle" : {
"booleanType" : true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.basic
namespace serialization.test.roundtrip.basic

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.choicetype.Root",
"@type" : "serialization.test.roundtrip.choicetype.Root",
"@version" : "0.0.0",
"choiceBasic" : {
"string" : "foo"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.choicetype.Root",
"@type" : "serialization.test.roundtrip.choicetype.Root",
"@version" : "0.0.0",
"choiceData" : {
"A" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.choicetype.Root",
"@type" : "serialization.test.roundtrip.choicetype.Root",
"@version" : "0.0.0",
"choiceMixed" : {
"B" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.choicetype.Root",
"@type" : "serialization.test.roundtrip.choicetype.Root",
"@version" : "0.0.0",
"choiceMixed" : {
"string" : "foo"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.choicetype
namespace serialization.test.roundtrip.choicetype

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.data.Root",
"@type" : "serialization.test.roundtrip.data.Root",
"@version" : "0.0.0",
"a" : {
"b" : [ { }, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
namespace serialization.test.data

namespace serialization.test.roundtrip.data
annotation rootType: <"Mark a type as a root of the rosetta model">

type A:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.enumtypes.Root",
"@type" : "serialization.test.roundtrip.enumtypes.Root",
"@version" : "0.0.0",
"enumList" : {
"enumType" : [ "A", "B", "C", "B" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.enumtypes.Root",
"@type" : "serialization.test.roundtrip.enumtypes.Root",
"@version" : "0.0.0",
"enumSingle" : {
"enumType" : "A"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.enumtypes
namespace serialization.test.roundtrip.enumtypes

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.extension.Root",
"@type" : "serialization.test.roundtrip.extension.Root",
"@version" : "0.0.0",
"typeA" : {
"fieldA" : "foo"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"@model" : "serialization",
"@type" : "serialization.test.extension.Root",
"@type" : "serialization.test.roundtrip.extension.Root",
"@version" : "0.0.0",
"typeB" : {
"fieldB" : "foo",
"@type" : "serialization.test.extension.B"
"@type" : "serialization.test.roundtrip.extension.B"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"@model" : "serialization",
"@type" : "serialization.test.extension.Root",
"@type" : "serialization.test.roundtrip.extension.Root",
"@version" : "0.0.0",
"typeA" : {
"fieldA" : "bar",
"fieldB" : "foo",
"@type" : "serialization.test.extension.B"
"@type" : "serialization.test.roundtrip.extension.B"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.extension
namespace serialization.test.roundtrip.extension

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metakey.Root",
"@type" : "serialization.test.roundtrip.metakey.Root",
"@version" : "0.0.0",
"attributeRef" : {
"dateField" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metakey.Root",
"@type" : "serialization.test.roundtrip.metakey.Root",
"@version" : "0.0.0",
"attributeRef" : {
"dateReference" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metakey.Root",
"@type" : "serialization.test.roundtrip.metakey.Root",
"@version" : "0.0.0",
"nodeRef" : {
"aReference" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.metakey
namespace serialization.test.roundtrip.metakey

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metakey.Root",
"@type" : "serialization.test.roundtrip.metakey.Root",
"@version" : "0.0.0",
"nodeRef" : {
"typeA" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metalocation.Root",
"@type" : "serialization.test.roundtrip.metalocation.Root",
"@version" : "0.0.0",
"typeA" : {
"b" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metalocation.Root",
"@type" : "serialization.test.roundtrip.metalocation.Root",
"@version" : "0.0.0",
"bAddress" : {
"@ref:scoped" : "someLocation"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.metalocation
namespace serialization.test.roundtrip.metalocation

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metascheme.Root",
"@type" : "serialization.test.roundtrip.metascheme.Root",
"@version" : "0.0.0",
"enumTypeList" : [ {
"@data" : "A",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metascheme.Root",
"@type" : "serialization.test.roundtrip.metascheme.Root",
"@version" : "0.0.0",
"enumType" : {
"@data" : "A",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.metascheme
namespace serialization.test.roundtrip.metascheme

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metascheme.Root",
"@type" : "serialization.test.roundtrip.metascheme.Root",
"@version" : "0.0.0",
"typeAList" : [ {
"fieldA" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.metascheme.Root",
"@type" : "serialization.test.roundtrip.metascheme.Root",
"@version" : "0.0.0",
"typeA" : {
"fieldA" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.record.Root",
"@type" : "serialization.test.roundtrip.record.Root",
"@version" : "0.0.0",
"recordList" : {
"dateType" : [ "2024-12-10", "2024-11-10", "2024-10-20" ],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"@model" : "serialization",
"@type" : "serialization.test.record.Root",
"@type" : "serialization.test.roundtrip.record.Root",
"@version" : "0.0.0",
"recordSingle" : {
"dateType" : "2024-12-10",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace serialization.test.record
namespace serialization.test.roundtrip.record

annotation rootType: <"Mark a type as a root of the rosetta model">

Expand Down