@@ -55,30 +55,40 @@ func TestStringPropertyTextMsg(t *testing.T) {
5555 propValue := "myValue"
5656
5757 // Test the empty value before the property is set.
58- assert .Nil (t , txtMsg .GetStringProperty (propName ))
58+ gotPropValue , propErr := txtMsg .GetStringProperty (propName )
59+ assert .Nil (t , propErr )
60+ assert .Nil (t , gotPropValue )
5961
6062 // Test the ability to set properties before the message is sent.
6163 retErr := txtMsg .SetStringProperty (propName , & propValue )
6264 assert .Nil (t , retErr )
63- assert .Equal (t , propValue , * txtMsg .GetStringProperty (propName ))
65+ gotPropValue , propErr = txtMsg .GetStringProperty (propName )
66+ assert .Nil (t , propErr )
67+ assert .Equal (t , propValue , * gotPropValue )
6468 assert .Equal (t , msgBody , * txtMsg .GetText ())
6569
6670 // Send an empty string property as well
6771 emptyPropName := "myEmptyString"
6872 emptyPropValue := ""
6973 retErr = txtMsg .SetStringProperty (emptyPropName , & emptyPropValue )
7074 assert .Nil (t , retErr )
71- assert .Equal (t , emptyPropValue , * txtMsg .GetStringProperty (emptyPropName ))
75+ gotPropValue , propErr = txtMsg .GetStringProperty (emptyPropName )
76+ assert .Nil (t , propErr )
77+ assert .Equal (t , emptyPropValue , * gotPropValue )
7278
7379 // Set a property then try to unset it by setting to nil
7480 unsetPropName := "mySendThenRemovedString"
7581 unsetPropValue := "someValueThatWillBeOverwritten"
7682 retErr = txtMsg .SetStringProperty (unsetPropName , & unsetPropValue )
7783 assert .Nil (t , retErr )
78- assert .Equal (t , unsetPropValue , * txtMsg .GetStringProperty (unsetPropName ))
84+ gotPropValue , propErr = txtMsg .GetStringProperty (unsetPropName )
85+ assert .Nil (t , propErr )
86+ assert .Equal (t , unsetPropValue , * gotPropValue )
7987 retErr = txtMsg .SetStringProperty (unsetPropName , nil )
8088 assert .Nil (t , retErr )
81- assert .Nil (t , txtMsg .GetStringProperty (unsetPropName ))
89+ gotPropValue , propErr = txtMsg .GetStringProperty (unsetPropName )
90+ assert .Nil (t , propErr )
91+ assert .Nil (t , gotPropValue )
8292
8393 // Set up objects for send/receive
8494 queue := context .CreateQueue ("DEV.QUEUE.1" )
@@ -104,14 +114,22 @@ func TestStringPropertyTextMsg(t *testing.T) {
104114 }
105115
106116 // Check property is available on received message.
107- assert .Equal (t , propValue , * rcvMsg .GetStringProperty (propName ))
117+ gotPropValue , propErr = rcvMsg .GetStringProperty (propName )
118+ assert .Nil (t , propErr )
119+ assert .Equal (t , propValue , * gotPropValue )
108120
109121 // Check the empty string property.
110- assert .Equal (t , emptyPropValue , * rcvMsg .GetStringProperty (emptyPropName ))
122+ gotPropValue , propErr = rcvMsg .GetStringProperty (emptyPropName )
123+ assert .Nil (t , propErr )
124+ assert .Equal (t , emptyPropValue , * gotPropValue )
111125
112126 // Properties that are not set should return nil
113- assert .Nil (t , rcvMsg .GetStringProperty ("nonExistentProperty" ))
114- assert .Nil (t , rcvMsg .GetStringProperty (unsetPropName ))
127+ gotPropValue , propErr = rcvMsg .GetStringProperty ("nonExistentProperty" )
128+ assert .Nil (t , propErr )
129+ assert .Nil (t , gotPropValue )
130+ gotPropValue , propErr = rcvMsg .GetStringProperty (unsetPropName )
131+ assert .Nil (t , propErr )
132+ assert .Nil (t , gotPropValue )
115133
116134}
117135
@@ -141,7 +159,9 @@ func TestPropertyExistsGetNames(t *testing.T) {
141159 propValue := "myValue"
142160
143161 // Test the empty value before the property is set.
144- assert .Nil (t , txtMsg .GetStringProperty (propName ))
162+ gotPropValue , propErr := txtMsg .GetStringProperty (propName )
163+ assert .Nil (t , propErr )
164+ assert .Nil (t , gotPropValue )
145165 propExists , propErr := txtMsg .PropertyExists (propName )
146166 assert .Nil (t , propErr )
147167 assert .False (t , propExists )
@@ -152,7 +172,9 @@ func TestPropertyExistsGetNames(t *testing.T) {
152172 // Test the ability to set properties before the message is sent.
153173 retErr := txtMsg .SetStringProperty (propName , & propValue )
154174 assert .Nil (t , retErr )
155- assert .Equal (t , propValue , * txtMsg .GetStringProperty (propName ))
175+ gotPropValue , propErr = txtMsg .GetStringProperty (propName )
176+ assert .Nil (t , propErr )
177+ assert .Equal (t , propValue , * gotPropValue )
156178 propExists , propErr = txtMsg .PropertyExists (propName )
157179 assert .Nil (t , propErr )
158180 assert .True (t , propExists ) // now exists
@@ -165,7 +187,9 @@ func TestPropertyExistsGetNames(t *testing.T) {
165187 propValue2 := "myValueTwo"
166188 retErr = txtMsg .SetStringProperty (propName2 , & propValue2 )
167189 assert .Nil (t , retErr )
168- assert .Equal (t , propValue2 , * txtMsg .GetStringProperty (propName2 ))
190+ gotPropValue , propErr = txtMsg .GetStringProperty (propName2 )
191+ assert .Nil (t , propErr )
192+ assert .Equal (t , propValue2 , * gotPropValue )
169193 propExists , propErr = txtMsg .PropertyExists (propName2 )
170194 assert .Nil (t , propErr )
171195 assert .True (t , propExists ) // now exists
@@ -184,7 +208,9 @@ func TestPropertyExistsGetNames(t *testing.T) {
184208 unsetPropValue := "someValueThatWillBeOverwritten"
185209 retErr = txtMsg .SetStringProperty (unsetPropName , & unsetPropValue )
186210 assert .Nil (t , retErr )
187- assert .Equal (t , unsetPropValue , * txtMsg .GetStringProperty (unsetPropName ))
211+ gotPropValue , propErr = txtMsg .GetStringProperty (unsetPropName )
212+ assert .Nil (t , propErr )
213+ assert .Equal (t , unsetPropValue , * gotPropValue )
188214 propExists , propErr = txtMsg .PropertyExists (unsetPropName )
189215 assert .Nil (t , propErr )
190216 assert .True (t , propExists )
@@ -193,7 +219,9 @@ func TestPropertyExistsGetNames(t *testing.T) {
193219 assert .Equal (t , 3 , len (allPropNames ))
194220 retErr = txtMsg .SetStringProperty (unsetPropName , nil )
195221 assert .Nil (t , retErr )
196- assert .Nil (t , txtMsg .GetStringProperty (unsetPropName ))
222+ gotPropValue , propErr = txtMsg .GetStringProperty (unsetPropName )
223+ assert .Nil (t , propErr )
224+ assert .Nil (t , gotPropValue )
197225 propExists , propErr = txtMsg .PropertyExists (unsetPropName )
198226 assert .Nil (t , propErr )
199227 assert .False (t , propExists )
@@ -242,7 +270,9 @@ func TestPropertyExistsGetNames(t *testing.T) {
242270
243271 // Properties that are not set should return nil
244272 nonExistentPropName := "nonExistentProperty"
245- assert .Nil (t , rcvMsg .GetStringProperty (nonExistentPropName ))
273+ gotPropValue , propErr = rcvMsg .GetStringProperty (nonExistentPropName )
274+ assert .Nil (t , propErr )
275+ assert .Nil (t , gotPropValue )
246276 propExists , propErr = rcvMsg .PropertyExists (nonExistentPropName )
247277 assert .Nil (t , propErr )
248278 assert .False (t , propExists )
@@ -282,7 +312,9 @@ func TestPropertyClearProperties(t *testing.T) {
282312 // Test the ability to set properties before the message is sent.
283313 retErr := txtMsg .SetStringProperty (propName , & propValue )
284314 assert .Nil (t , retErr )
285- assert .Equal (t , propValue , * txtMsg .GetStringProperty (propName ))
315+ gotPropValue , propErr := txtMsg .GetStringProperty (propName )
316+ assert .Nil (t , propErr )
317+ assert .Equal (t , propValue , * gotPropValue )
286318 propExists , propErr := txtMsg .PropertyExists (propName )
287319 assert .Nil (t , propErr )
288320 assert .True (t , propExists ) // now exists
@@ -293,7 +325,9 @@ func TestPropertyClearProperties(t *testing.T) {
293325
294326 clearErr := txtMsg .ClearProperties ()
295327 assert .Nil (t , clearErr )
296- assert .Nil (t , txtMsg .GetStringProperty (propName ))
328+ gotPropValue , propErr = txtMsg .GetStringProperty (propName )
329+ assert .Nil (t , propErr )
330+ assert .Nil (t , gotPropValue )
297331 propExists , propErr = txtMsg .PropertyExists (propName )
298332 assert .Nil (t , propErr )
299333 assert .False (t , propExists )
@@ -308,10 +342,14 @@ func TestPropertyClearProperties(t *testing.T) {
308342 // Set multiple properties
309343 retErr = txtMsg .SetStringProperty (propName , & propValue )
310344 assert .Nil (t , retErr )
311- assert .Equal (t , propValue , * txtMsg .GetStringProperty (propName ))
345+ gotPropValue , propErr = txtMsg .GetStringProperty (propName )
346+ assert .Nil (t , propErr )
347+ assert .Equal (t , propValue , * gotPropValue )
312348 retErr = txtMsg .SetStringProperty (propName2 , & propValue2 )
313349 assert .Nil (t , retErr )
314- assert .Equal (t , propValue2 , * txtMsg .GetStringProperty (propName2 ))
350+ gotPropValue , propErr = txtMsg .GetStringProperty (propName2 )
351+ assert .Nil (t , propErr )
352+ assert .Equal (t , propValue2 , * gotPropValue )
315353 propExists , propErr = txtMsg .PropertyExists (propName2 )
316354 assert .Nil (t , propErr )
317355 assert .True (t , propExists ) // now exists
@@ -329,7 +367,9 @@ func TestPropertyClearProperties(t *testing.T) {
329367 unsetPropValue := "someValueThatWillBeOverwritten"
330368 retErr = txtMsg .SetStringProperty (unsetPropName , & unsetPropValue )
331369 assert .Nil (t , retErr )
332- assert .Equal (t , unsetPropValue , * txtMsg .GetStringProperty (unsetPropName ))
370+ gotPropValue , propErr = txtMsg .GetStringProperty (unsetPropName )
371+ assert .Nil (t , propErr )
372+ assert .Equal (t , unsetPropValue , * gotPropValue )
333373 propExists , propErr = txtMsg .PropertyExists (unsetPropName )
334374 assert .Nil (t , propErr )
335375 assert .True (t , propExists )
@@ -341,7 +381,9 @@ func TestPropertyClearProperties(t *testing.T) {
341381 assert .Equal (t , unsetPropName , allPropNames [2 ])
342382 retErr = txtMsg .SetStringProperty (unsetPropName , nil )
343383 assert .Nil (t , retErr )
344- assert .Nil (t , txtMsg .GetStringProperty (unsetPropName ))
384+ gotPropValue , propErr = txtMsg .GetStringProperty (unsetPropName )
385+ assert .Nil (t , propErr )
386+ assert .Nil (t , gotPropValue )
345387 propExists , propErr = txtMsg .PropertyExists (unsetPropName )
346388 assert .Nil (t , propErr )
347389 assert .False (t , propExists )
@@ -353,7 +395,9 @@ func TestPropertyClearProperties(t *testing.T) {
353395
354396 clearErr = txtMsg .ClearProperties ()
355397 assert .Nil (t , clearErr )
356- assert .Nil (t , txtMsg .GetStringProperty (propName ))
398+ gotPropValue , propErr = txtMsg .GetStringProperty (propName )
399+ assert .Nil (t , propErr )
400+ assert .Nil (t , gotPropValue )
357401 propExists , propErr = txtMsg .PropertyExists (propName )
358402 assert .Nil (t , propErr )
359403 assert .False (t , propExists )
@@ -399,7 +443,9 @@ func TestPropertyClearProperties(t *testing.T) {
399443
400444 // Properties that are not set should return nil
401445 nonExistentPropName := "nonExistentProperty"
402- assert .Nil (t , rcvMsg .GetStringProperty (nonExistentPropName ))
446+ gotPropValue , propErr = rcvMsg .GetStringProperty (nonExistentPropName )
447+ assert .Nil (t , propErr )
448+ assert .Nil (t , gotPropValue )
403449 propExists , propErr = rcvMsg .PropertyExists (nonExistentPropName )
404450 assert .Nil (t , propErr )
405451 assert .False (t , propExists )
@@ -412,7 +458,9 @@ func TestPropertyClearProperties(t *testing.T) {
412458 // Finally try clearing everything on the received message
413459 clearErr = rcvMsg .ClearProperties ()
414460 assert .Nil (t , clearErr )
415- assert .Nil (t , rcvMsg .GetStringProperty (propName ))
461+ gotPropValue , propErr = rcvMsg .GetStringProperty (propName )
462+ assert .Nil (t , propErr )
463+ assert .Nil (t , gotPropValue )
416464 propExists , propErr = rcvMsg .PropertyExists (propName )
417465 assert .Nil (t , propErr )
418466 assert .False (t , propExists )
@@ -471,7 +519,9 @@ func TestStringPropertyTextMessageNilBody(t *testing.T) {
471519 }
472520
473521 // Check property is available on received message.
474- assert .Equal (t , propValue , * rcvMsg .GetStringProperty (propName ))
522+ gotPropValue , propErr := rcvMsg .GetStringProperty (propName )
523+ assert .Nil (t , propErr )
524+ assert .Equal (t , propValue , * gotPropValue )
475525
476526}
477527
@@ -535,7 +585,11 @@ func TestStringPropertyTextMessageEmptyBody(t *testing.T) {
535585 }
536586
537587 // Check property is available on received message.
538- assert .Equal (t , propAValue , * rcvMsg .GetStringProperty (propAName ))
539- assert .Equal (t , propBValue , * rcvMsg .GetStringProperty (propBName ))
588+ gotPropValue , propErr := rcvMsg .GetStringProperty (propAName )
589+ assert .Nil (t , propErr )
590+ assert .Equal (t , propAValue , * gotPropValue )
591+ gotPropValue , propErr = rcvMsg .GetStringProperty (propBName )
592+ assert .Nil (t , propErr )
593+ assert .Equal (t , propBValue , * gotPropValue )
540594
541595}
0 commit comments