diff --git a/test/interoptests/messages/event_test.dart b/test/interoptests/messages/event_test.dart index 42bb0cb..bda4b61 100644 --- a/test/interoptests/messages/event_test.dart +++ b/test/interoptests/messages/event_test.dart @@ -10,7 +10,6 @@ import "../helper.dart"; void main() { group("Event", () { const equality = DeepCollectionEquality(); - const baseEventCommand = "message event 1 1"; bool isEqual(Event msg1, Event msg2) => msg1.subscriptionID == msg2.subscriptionID && @@ -21,7 +20,7 @@ void main() { test("JSONSerializer", () async { var msg = Event(1, 1); - var command = "$baseEventCommand --serializer json"; + var command = "message event ${msg.subscriptionID} ${msg.publicationID} --serializer json"; var output = await runCommand(command); @@ -32,7 +31,7 @@ void main() { test("CBORSerializer", () async { var msg = Event(1, 1, args: ["abc"]); - var command = "$baseEventCommand abc --serializer cbor --output hex"; + var command = "message event ${msg.subscriptionID} ${msg.publicationID} abc --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -44,7 +43,8 @@ void main() { test("MsgPackSerializer", () async { var msg = Event(1, 1, details: {"abc": 1}, args: ["abc"], kwargs: {"a": 1}); - var command = "$baseEventCommand abc -d abc=1 -k a=1 --serializer msgpack --output hex"; + var command = + "message event ${msg.subscriptionID} ${msg.publicationID} abc -d abc=1 -k a=1 --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); diff --git a/test/interoptests/messages/publish_test.dart b/test/interoptests/messages/publish_test.dart index 814857d..6148f8a 100644 --- a/test/interoptests/messages/publish_test.dart +++ b/test/interoptests/messages/publish_test.dart @@ -10,7 +10,6 @@ import "../helper.dart"; void main() { group("Publish", () { const equality = DeepCollectionEquality(); - const basePubCommand = "message publish 1 io.xconn.topic"; bool isEqual(Publish msg1, Publish msg2) => msg1.requestID == msg2.requestID && @@ -21,7 +20,7 @@ void main() { test("JSONSerializer", () async { var msg = Publish(1, "io.xconn.topic"); - var command = "$basePubCommand --serializer json"; + var command = "message publish ${msg.requestID} ${msg.uri} --serializer json"; var output = await runCommand(command); @@ -32,7 +31,7 @@ void main() { test("CBORSerializer", () async { var msg = Publish(1, "io.xconn.topic", args: ["abc"]); - var command = "$basePubCommand abc --serializer cbor --output hex"; + var command = "message publish ${msg.requestID} ${msg.uri} abc --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -44,7 +43,7 @@ void main() { test("MsgPackSerializer", () async { var msg = Publish(1, "io.xconn.topic", options: {"abc": 1}, args: ["abc"], kwargs: {"a": 1}); - var command = "$basePubCommand abc -o abc=1 -k a=1 --serializer msgpack --output hex"; + var command = "message publish ${msg.requestID} ${msg.uri} abc -o abc=1 -k a=1 --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); diff --git a/test/interoptests/messages/published_test.dart b/test/interoptests/messages/published_test.dart index 1a73e2e..9ff33c5 100644 --- a/test/interoptests/messages/published_test.dart +++ b/test/interoptests/messages/published_test.dart @@ -8,14 +8,12 @@ import "../helper.dart"; void main() { group("Published", () { - const basePubCmd = "message published 1 1"; - bool isEqual(Published msg1, Published msg2) => msg1.requestID == msg2.requestID && msg1.publicationID == msg2.publicationID; test("JSONSerializer", () async { var msg = Published(1, 1); - var command = "$basePubCmd --serializer json"; + var command = "message published ${msg.requestID} ${msg.publicationID} --serializer json"; var output = await runCommand(command); @@ -26,7 +24,7 @@ void main() { test("CBORSerializer", () async { var msg = Published(1, 1); - var command = "$basePubCmd --serializer cbor --output hex"; + var command = "message published ${msg.requestID} ${msg.publicationID} --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -38,7 +36,7 @@ void main() { test("MsgPackSerializer", () async { var msg = Published(1, 1); - var command = "$basePubCmd --serializer msgpack --output hex"; + var command = "message published ${msg.requestID} ${msg.publicationID} --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); diff --git a/test/interoptests/messages/subscribe_test.dart b/test/interoptests/messages/subscribe_test.dart index 8be6ef2..b9b594a 100644 --- a/test/interoptests/messages/subscribe_test.dart +++ b/test/interoptests/messages/subscribe_test.dart @@ -11,14 +11,13 @@ void main() { group("Subscribe", () { const equality = DeepCollectionEquality(); const topic = "io.xconn.test"; - const baseSubCommand = "message subscribe 1 $topic"; bool isEqual(Subscribe msg1, Subscribe msg2) => msg1.requestID == msg2.requestID && msg1.topic == msg2.topic && equality.equals(msg1.options, msg2.options); test("JSONSerializer", () async { var msg = Subscribe(1, topic); - var command = "$baseSubCommand --serializer json"; + var command = "message subscribe ${msg.requestID} ${msg.topic} --serializer json"; var output = await runCommand(command); @@ -29,7 +28,7 @@ void main() { test("CBORSerializer", () async { var msg = Subscribe(1, topic); - var command = "$baseSubCommand --serializer cbor --output hex"; + var command = "message subscribe ${msg.requestID} ${msg.topic} --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -41,7 +40,7 @@ void main() { test("MsgPackSerializer", () async { var msg = Subscribe(1, topic, options: {"a": 1}); - var command = "$baseSubCommand -o a=1 --serializer msgpack --output hex"; + var command = "message subscribe ${msg.requestID} ${msg.topic} -o a=1 --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); diff --git a/test/interoptests/messages/subscribed_test.dart b/test/interoptests/messages/subscribed_test.dart index 8d7f92c..c819d8d 100644 --- a/test/interoptests/messages/subscribed_test.dart +++ b/test/interoptests/messages/subscribed_test.dart @@ -8,14 +8,12 @@ import "../helper.dart"; void main() { group("Subscribed", () { - const baseSubCommand = "message subscribed 1 1"; - bool isEqual(Subscribed msg1, Subscribed msg2) => msg1.requestID == msg2.requestID && msg1.subscriptionID == msg2.subscriptionID; test("JSONSerializer", () async { var msg = Subscribed(1, 1); - var command = "$baseSubCommand --serializer json"; + var command = "message subscribed ${msg.requestID} ${msg.subscriptionID} --serializer json"; var output = await runCommand(command); @@ -26,7 +24,7 @@ void main() { test("CBORSerializer", () async { var msg = Subscribed(1, 1); - var command = "$baseSubCommand --serializer cbor --output hex"; + var command = "message subscribed ${msg.requestID} ${msg.subscriptionID} --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -38,7 +36,7 @@ void main() { test("MsgPackSerializer", () async { var msg = Subscribed(1, 1); - var command = "$baseSubCommand --serializer msgpack --output hex"; + var command = "message subscribed ${msg.requestID} ${msg.subscriptionID} --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); diff --git a/test/interoptests/messages/unsubscribed_test.dart b/test/interoptests/messages/unsubscribed_test.dart index 5c057c6..4f08756 100644 --- a/test/interoptests/messages/unsubscribed_test.dart +++ b/test/interoptests/messages/unsubscribed_test.dart @@ -8,13 +8,11 @@ import "../helper.dart"; void main() { group("Unsubscribed", () { - const baseSubCommand = "message unsubscribed 1"; - bool isEqual(UnSubscribed msg1, UnSubscribed msg2) => msg1.requestID == msg2.requestID; test("JSONSerializer", () async { var msg = UnSubscribed(1); - var command = "$baseSubCommand --serializer json"; + var command = "message unsubscribed ${msg.requestID} --serializer json"; var output = await runCommand(command); @@ -25,7 +23,7 @@ void main() { test("CBORSerializer", () async { var msg = UnSubscribed(1); - var command = "$baseSubCommand --serializer cbor --output hex"; + var command = "message unsubscribed ${msg.requestID} --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -37,7 +35,7 @@ void main() { test("MsgPackSerializer", () async { var msg = UnSubscribed(1); - var command = "$baseSubCommand --serializer msgpack --output hex"; + var command = "message unsubscribed ${msg.requestID} --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); diff --git a/test/interoptests/messages/unsusbcribe_test.dart b/test/interoptests/messages/unsusbcribe_test.dart index dbf1c2a..779c357 100644 --- a/test/interoptests/messages/unsusbcribe_test.dart +++ b/test/interoptests/messages/unsusbcribe_test.dart @@ -8,14 +8,12 @@ import "../helper.dart"; void main() { group("Unsubscribe", () { - const baseSubCommand = "message unsubscribe 1 1"; - bool isEqual(UnSubscribe msg1, UnSubscribe msg2) => msg1.requestID == msg2.requestID && msg1.subscriptionID == msg2.subscriptionID; test("JSONSerializer", () async { var msg = UnSubscribe(1, 1); - var command = "$baseSubCommand --serializer json"; + var command = "message unsubscribe ${msg.requestID} ${msg.subscriptionID} --serializer json"; var output = await runCommand(command); @@ -26,7 +24,7 @@ void main() { test("CBORSerializer", () async { var msg = UnSubscribe(1, 1); - var command = "$baseSubCommand --serializer cbor --output hex"; + var command = "message unsubscribe ${msg.requestID} ${msg.subscriptionID} --serializer cbor --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim()); @@ -38,7 +36,7 @@ void main() { test("MsgPackSerializer", () async { var msg = UnSubscribe(1, 1); - var command = "$baseSubCommand --serializer msgpack --output hex"; + var command = "message unsubscribe ${msg.requestID} ${msg.subscriptionID} --serializer msgpack --output hex"; var output = await runCommand(command); var outputBytes = Base16Encoder.instance.decode(output.trim());