working on unit tests

This commit is contained in:
Rob Harrop 2010-10-01 12:27:10 +01:00
parent d6a2963b3c
commit cfd1efb994
2 changed files with 35 additions and 0 deletions

View File

@ -5,8 +5,14 @@ DEPS=rabbitmq-server rabbitmq-erlang-client
START_RABBIT_IN_TESTS=true
TEST_APPS=rabbit_stomp
TEST_SCRIPTS=./test/test.py
UNIT_TEST_COMMANDS=eunit:test(rabbit_stomp_test_destination_parser,[verbose])
TEST_ARGS=-rabbit_stomp listeners "[{\"0.0.0.0\",61613}]"
include ../include.mk
test: unittest
unittest: $(TARGETS) $(TEST_TARGETS)
ERL_LIBS=$(LIBS_PATH) $(ERL) $(TEST_LOAD_PATH) $(foreach CMD,$(UNIT_TEST_COMMANDS),-eval '$(CMD)')

View File

@ -0,0 +1,29 @@
%% The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% http://www.mozilla.org/MPL/
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
%% License for the specific language governing rights and limitations
%% under the License.
%%
%% The Original Code is RabbitMQ Management Console.
%%
%% The Initial Developers of the Original Code are Rabbit Technologies Ltd.
%%
%% Copyright (C) 2010 Rabbit Technologies Ltd.
%%
%% All Rights Reserved.
%%
%% Contributor(s): ______________________________________.
%%
-module(rabbit_stomp_test_destination_parser).
-include_lib("eunit/include/eunit.hrl").
valid_queue_test() ->
{queue, "test"} = parse_destination("/queue/test").
parse_destination(Destination) ->
rabbit_stomp_destination_parser:parse_destination(Destination).