@@ -4,50 +4,10 @@ Library Collections
44Library String
55
66Suite Setup Starting Test
7- Suite Teardown Stop Thread
87
98
109*** Test Cases ***
11- Avro Producer With Schemas As String Argument
12- [Setup] Clear Messages From Thread ${MAIN_THREAD }
13- ${value_schema } = Set Variable {"namespace": "example.avro","type": "record","name": "User","fields": [{"name": "name","type": "string"},{"name": "number","type": ["int","null"]}]}
14- ${key_schema } = Set Variable {"namespace": "example.avro","type": "record","name": "User","fields": [{"name": "name","type": "string"}]}
15- ${producer_id } = Create Producer schema_registry_url=http://127.0.0.1:8081
16- ... value_schema=${value_schema } key_schema=${key_schema }
17- ${value } = Create Dictionary name=Robot number=${10 }
18- Produce group_id=${producer_id } topic=avro_testing1 partition=${0 } value=${value } key=${KEY_FOR_SCHEMA }
19- Wait Until Keyword Succeeds 10x 0.5s All Messages Are Delivered ${producer_id }
20- Sleep 1s
21-
22- ${consumer_group_id } = Create Consumer auto_offset_reset=earliest schema_registry_url=http://127.0.0.1:8081
23- Subscribe Topic group_id=${consumer_group_id } topics=avro_testing1
24- ${messages } = Poll group_id=${consumer_group_id }
25- Should Be Equal ${TEST_DATA } ${messages }
26- ${thread_messages } = Get Messages From Thread ${MAIN_THREAD }
27- Should Be Equal ${TEST_DATA } ${thread_messages }
28- [Teardown] Basic Teardown ${consumer_group_id }
29-
30- Avro Producer With Path To Schemas
31- [Setup] Clear Messages From Thread ${MAIN_THREAD }
32- ${value_schema_file_path } = Set Variable examples/schema/avro/ValueSchema.avsc
33- ${key_schema_file_path } = Set Variable examples/schema/avro/KeySchema.avsc
34- ${producer_id } = Create Producer schema_registry_url=http://127.0.0.1:8081
35- ... value_schema=${value_schema_file_path } key_schema=${key_schema_file_path }
36- ${value } = Create Dictionary name=Robot number=${10 }
37- Produce group_id=${producer_id } topic=avro_testing2 partition=${0 } value=${value } key=${KEY_FOR_SCHEMA }
38- Wait Until Keyword Succeeds 10x 0.5s All Messages Are Delivered ${producer_id }
39- Sleep 1s
40-
41- ${consumer_group_id } = Create Consumer auto_offset_reset=earliest schema_registry_url=http://127.0.0.1:8081
42- Subscribe Topic group_id=${consumer_group_id } topics=avro_testing2
43- ${messages } = Poll group_id=${consumer_group_id }
44- Should Be Equal ${TEST_DATA } ${messages }
45- ${thread_messages } = Get Messages From Thread ${MAIN_THREAD }
46- Should Be Equal ${TEST_DATA } ${thread_messages }
47- [Teardown] Basic Teardown ${consumer_group_id }
48-
4910Avro Producer Consumer With Serializers
50- [Setup] Clear Messages From Thread ${MAIN_THREAD }
5111 ${schema_registry_conf } = Create Dictionary url=http://127.0.0.1:8081
5212 ${schema_registry_client } = Get Schema Registry Client ${schema_registry_conf }
5313 ${schema_str } = Set Variable {"namespace": "example.avro","type": "record","name": "User","fields": [{"name": "name","type": "string"},{"name": "number","type": ["int","null"]}]}
@@ -56,16 +16,16 @@ Avro Producer Consumer With Serializers
5616 ${string_serializer } = Get String Serializer
5717 ${string_deserializer } = Get String Deserializer
5818
59- ${producer_id } = Create Producer key_serializer=${string_serializer } value_serializer=${avro_serializer } legacy =${False }
19+ ${producer_id } = Create Producer key_serializer=${string_serializer } value_serializer=${avro_serializer } serializing =${True }
6020 ${value } = Create Dictionary name=Robot number=${10 }
61- Produce group_id=${producer_id } topic=avro_testing3 partition=${0 } value=${value } key=568a68fd-2785-44cc-8997-1295c3755d28
21+ Produce group_id=${producer_id } topic=avro_testing1 partition=${0 } value=${value } key=${ KEY }
6222 Wait Until Keyword Succeeds 10x 0.5s All Messages Are Delivered ${producer_id }
6323
64- ${consumer_group_id } = Create Consumer auto_offset_reset=latest key_deserializer=${string_deserializer } value_deserializer=${avro_deserializer } legacy =${False }
65- Subscribe Topic group_id=${consumer_group_id } topics=avro_testing3
24+ ${consumer_group_id } = Create Consumer auto_offset_reset=latest key_deserializer=${string_deserializer } value_deserializer=${avro_deserializer } deserializing =${True }
25+ Subscribe Topic group_id=${consumer_group_id } topics=avro_testing1
6626 Poll group_id=${consumer_group_id } # Dummy poll when using offset reset 'latest'
6727
68- Produce group_id=${producer_id } topic=avro_testing3 value=${value } partition=${0 } key=568a68fd-2785-44cc-8997-1295c3755d28
28+ Produce group_id=${producer_id } topic=avro_testing1 value=${value } partition=${0 } key=${ KEY }
6929 Wait Until Keyword Succeeds 10x 0.5s All Messages Are Delivered ${producer_id }
7030 ${messages } = Poll group_id=${consumer_group_id }
7131 Should Be Equal ${messages } ${TEST_DATA }
@@ -74,28 +34,13 @@ Avro Producer Consumer With Serializers
7434
7535*** Keywords ***
7636Starting Test
77- Set Suite Variable @{TEST_TOPIC } avro_testing1 avro_testing2 avro_testing3
37+ Set Suite Variable @{TEST_TOPIC } avro_testing1
7838 Set Suite Variable ${KEY } 568a68fd-2785-44cc-8997-1295c3755d28
79- Set Suite Variable &{KEY_FOR_SCHEMA } name=testkey
8039
8140 ${value } = Create Dictionary name=Robot number=${10 }
8241 ${data } = Create List ${value }
8342 Set Suite Variable ${TEST_DATA } ${data }
8443
85- # Rewrite to support topic creation via AdminClient
86- ${value_schema } = Set Variable {"namespace": "example.avro","type": "record","name": "User","fields": [{"name": "name","type": "string"},{"name": "number","type": ["int","null"]}]}
87- ${key_schema } = Set Variable {"namespace": "example.avro","type": "record","name": "User","fields": [{"name": "name","type": "string"}]}
88- ${producer_id } = Create Producer schema_registry_url=http://127.0.0.1:8081
89- ... value_schema=${value_schema } key_schema=${key_schema }
90-
91- Produce group_id=${producer_id } topic=avro_testing1 partition=${0 } value=${value } key=${KEY_FOR_SCHEMA }
92- Wait Until Keyword Succeeds 10x 0.5s All Messages Are Delivered ${producer_id }
93- Produce group_id=${producer_id } topic=avro_testing2 partition=${0 } value=${value } key=${KEY_FOR_SCHEMA }
94- Wait Until Keyword Succeeds 10x 0.5s All Messages Are Delivered ${producer_id }
95-
96- ${thread } = Start Consumer Threaded topics=${TEST_TOPIC } schema_registry_url=http://127.0.0.1:8081 auto_offset_reset=latest
97- Set Suite Variable ${MAIN_THREAD } ${thread }
98-
9944All Messages Are Delivered
10045 [Arguments] ${producer_id }
10146 ${count } = Flush ${producer_id }
@@ -109,8 +54,4 @@ Basic Teardown
10954 ${groups } = Create List ${group_id }
11055 ${admin_client_id } = Create Admin Client
11156 ${resp } = Delete Groups ${admin_client_id } group_ids=${groups }
112- Log ${resp }
113-
114- Stop Thread
115- ${resp } = Stop Consumer Threaded ${MAIN_THREAD }
11657 Log ${resp }
0 commit comments