src/network_client_test.erl
author Ben Hood <0x6e6562@gmail.com>
Fri Jan 09 18:28:35 2009 +0000 (2009-01-09)
branchbug20103
changeset 206 437d0e4d66c8
parent 191 cc91e197bcae
child 211 3fd37b2db3f1
permissions -rw-r--r--
Switched over to gen_server2 handling
     1 %%   The contents of this file are subject to the Mozilla Public License
     2 %%   Version 1.1 (the "License"); you may not use this file except in
     3 %%   compliance with the License. You may obtain a copy of the License at
     4 %%   http://www.mozilla.org/MPL/
     5 %%
     6 %%   Software distributed under the License is distributed on an "AS IS"
     7 %%   basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
     8 %%   License for the specific language governing rights and limitations
     9 %%   under the License.
    10 %%
    11 %%   The Original Code is the RabbitMQ Erlang Client.
    12 %%
    13 %%   The Initial Developers of the Original Code are LShift Ltd.,
    14 %%   Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.
    15 %%
    16 %%   Portions created by LShift Ltd., Cohesive Financial
    17 %%   Technologies LLC., and Rabbit Technologies Ltd. are Copyright (C)
    18 %%   2007 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit
    19 %%   Technologies Ltd.;
    20 %%
    21 %%   All Rights Reserved.
    22 %%
    23 %%   Contributor(s): Ben Hood <0x6e6562@gmail.com>.
    24 %%
    25 
    26 -module(network_client_test).
    27 
    28 -export([test_coverage/0]).
    29 
    30 -include_lib("eunit/include/eunit.hrl").
    31 
    32 basic_get_test() ->
    33     test_util:basic_get_test(new_connection()).
    34 
    35 basic_return_test() ->
    36     test_util:basic_return_test(new_connection()).
    37 
    38 basic_qos_test() ->
    39     test_util:basic_qos_test(new_connection()).
    40 
    41 basic_recover_test() -> 
    42     test_util:basic_recover_test(new_connection()).
    43 
    44 basic_consume_test() -> 
    45     test_util:basic_consume_test(new_connection()).
    46 
    47 lifecycle_test() ->
    48     test_util:lifecycle_test(new_connection()).
    49 
    50 basic_ack_test() ->
    51     test_util:basic_ack_test(new_connection()).
    52 
    53 channel_lifecycle_test() ->
    54     test_util:channel_lifecycle_test(new_connection()).
    55 
    56 queue_unbind_test() ->
    57     test_util:queue_unbind_test(new_connection()).
    58 
    59 command_serialization_test() ->
    60     test_util:command_serialization_test(new_connection()).
    61 
    62 teardown_test() ->
    63     test_util:teardown_test(new_connection()).
    64 
    65 rpc_test() ->
    66     test_util:rpc_test(new_connection()).
    67 
    68 %%---------------------------------------------------------------------------
    69 %% Negative Tests
    70 
    71 non_existent_exchange_test() -> 
    72   negative_test_util:non_existent_exchange_test(new_connection()).
    73 
    74 %%---------------------------------------------------------------------------
    75 %% Common Functions
    76 
    77 new_connection() ->
    78   amqp_connection:start("guest", "guest", "localhost").
    79 
    80 test_coverage() ->
    81     rabbit_misc:enable_cover(),
    82     test(),
    83     rabbit_misc:report_cover().