-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added `get_client_properties()` to fetch client properties from a connected instance. - Added `get_server_properties()` to fetch server properties from a connected instance. - Added these two methods to tests. - Added these two methods to documentation - Added a handle for `AMQP_FIELD_KIND_BOOLEAN` in the mq conversion code for arrays and tables. - Updated tests for boolean headers to play nice with the boolean type headers.
- Loading branch information
1 parent
60b9493
commit 54f3800
Showing
4 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use Test::More tests => 11; | ||
use strict; | ||
use warnings; | ||
|
||
my $host = $ENV{'MQHOST'} || "dev.rabbitmq.com"; | ||
|
||
use_ok('Net::AMQP::RabbitMQ'); | ||
|
||
my $mq = Net::AMQP::RabbitMQ->new(); | ||
ok($mq, "Created object"); | ||
|
||
|
||
# Verify we enforce server_properties connection requirement | ||
eval { my $results = $mq->get_server_properties(); }; | ||
like( $@, qr/AMQP socket not connected/, "no socket, no get_server_properties" ); | ||
|
||
# Verify we enforce client_properties connection requirement | ||
eval { my $results = $mq->get_client_properties(); }; | ||
like( $@, qr/AMQP socket not connected/, "no socket, no get_client_properties" ); | ||
|
||
# Now connect | ||
eval { $mq->connect($host, { user => "guest", password => "guest" }); }; | ||
is($@, '', "connect"); | ||
|
||
# Now verify server properties | ||
my $server_properties = undef; | ||
eval { $server_properties = $mq->get_server_properties(); }; | ||
is($@, '', "get_server_properties"); | ||
|
||
ok(exists( $server_properties->{product} ), 'product should be returned'); | ||
is($server_properties->{'product'}, 'RabbitMQ', 'product is RabbitMQ'); | ||
|
||
# Now verify client properties | ||
my $client_properties = undef; | ||
eval { $client_properties = $mq->get_client_properties(); }; | ||
is($@, '', "get_server_properties"); | ||
ok(exists( $client_properties->{product} ), 'product should be returned'); | ||
is($client_properties->{'product'}, 'rabbitmq-c', 'product is rabbitmq-c'); | ||
|
||
1; | ||
|