~ubuntu-branches/ubuntu/saucy/rabbitmq-server/saucy

« back to all changes in this revision

Viewing changes to plugins-src/rabbitmq-federation/test/src/rabbit_federation_test.erl

  • Committer: Package Import Robot
  • Author(s): Emile Joubert
  • Date: 2013-03-13 10:53:18 UTC
  • mfrom: (0.5.1) (0.1.36 sid)
  • Revision ID: package-import@ubuntu.com-20130313105318-8juqvm5209o27hbu
Tags: 3.0.4-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
 
125
125
              Msg = #amqp_msg{props   = #'P_basic'{user_id = <<"hare-user">>},
126
126
                              payload = <<"HELLO">>},
 
127
 
 
128
              SafeUri = fun (H) ->
 
129
                                {array, [{table, Recv}]} =
 
130
                                    rabbit_misc:table_lookup(
 
131
                                      H, <<"x-received-from">>),
 
132
                                ?assertEqual(
 
133
                                   {longstr, <<"amqp://localhost:5673">>},
 
134
                                   rabbit_misc:table_lookup(Recv, <<"uri">>))
 
135
                        end,
127
136
              ExpectUser =
128
137
                  fun (ExpUser) ->
129
138
                          fun () ->
131
140
                                      {#'basic.deliver'{},
132
141
                                       #amqp_msg{props   = Props,
133
142
                                                 payload = Payload}} ->
134
 
                                          #'P_basic'{user_id = ActUser} = Props,
 
143
                                          #'P_basic'{user_id = ActUser,
 
144
                                                     headers = Headers} = Props,
 
145
                                          SafeUri(Headers),
135
146
                                          ?assertEqual(<<"HELLO">>, Payload),
136
147
                                          ?assertEqual(ExpUser, ActUser)
137
148
                                  end