From ccf67d04af1cb14d91ba5a5ac1c4bc85317ffe01 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Wed, 28 Apr 2010 22:24:34 -0400 Subject: switch join types to init,join,replace,leave and add first json-rpc handler for membership (init) - BugzID 9726 --- test/mem3_test.erl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'test/mem3_test.erl') diff --git a/test/mem3_test.erl b/test/mem3_test.erl index 80699559..b8622005 100644 --- a/test/mem3_test.erl +++ b/test/mem3_test.erl @@ -29,8 +29,8 @@ all_tests_test_() -> [ fun init/1, fun clock/1, - fun join_first/1, - fun join_first_with_hints/1, + fun join_init/1, + fun join_init_with_hints/1, fun join_new_node/1, fun join_two_new_nodes/1, fun join_with_wrong_order/1 @@ -64,17 +64,17 @@ clock(_Pid) -> ?assertMatch([], Clock). -join_first(_Pid) -> +join_init(_Pid) -> mem3:reset(), - mem3:join(first, [{1, a, []}, {2, b, []}], nil), + mem3:join(init, [{1, a, []}, {2, b, []}], nil), {ok, Nodes} = mem3:nodes(), ?assertEqual(2, length(Nodes)), ok. -join_first_with_hints(_Pid) -> +join_init_with_hints(_Pid) -> mem3:reset(), - mem3:join(first, [{1, a, []}, + mem3:join(init, [{1, a, []}, {2, b, []}, {3, c, [{hints, [?HINT_C1, ?HINT_C2]}]}, {4, d, []}, @@ -90,10 +90,10 @@ join_first_with_hints(_Pid) -> join_new_node(_Pid) -> mem3:reset(), - mem3:join(first, [{1, a, []}, {2, b, []}, {3, c, []}], nil), + mem3:join(init, [{1, a, []}, {2, b, []}, {3, c, []}], nil), {ok, Nodes1} = mem3:nodes(), ?assertEqual(3, length(Nodes1)), - mem3:join(new, [{4, d, []}], a), + mem3:join(join, [{4, d, []}], a), {ok, Nodes2} = mem3:nodes(), ?assertEqual(4, length(Nodes2)), ok. @@ -101,10 +101,10 @@ join_new_node(_Pid) -> join_two_new_nodes(_Pid) -> mem3:reset(), - mem3:join(first, [{1, a, []}, {2, b, []}, {3, c, []}], nil), + mem3:join(init, [{1, a, []}, {2, b, []}, {3, c, []}], nil), {ok, Nodes1} = mem3:nodes(), ?assertEqual(3, length(Nodes1)), - Res = mem3:join(new, [{4, d, []}, {5, e, []}], b), + Res = mem3:join(join, [{4, d, []}, {5, e, []}], b), ?assertEqual(ok, Res), {ok, Nodes2} = mem3:nodes(), ?assertEqual(5, length(Nodes2)), @@ -114,10 +114,10 @@ join_two_new_nodes(_Pid) -> join_with_wrong_order(_Pid) -> mem3:reset(), - mem3:join(first, [{1, a, []}, {2, b, []}, {3, c, []}], nil), + mem3:join(init, [{1, a, []}, {2, b, []}, {3, c, []}], nil), % ?assertEqual([], mem3:parts_for_node(d)), %?debugFmt("~nFullmap: ~p~n", [mem3:fullmap()]), - Res = mem3:join(new, [{3, d, []}], c), + Res = mem3:join(join, [{3, d, []}], c), ?assertEqual({error,{position_exists,3,c}}, Res), %?debugFmt("~nFullmap: ~p~n", [mem3:fullmap()]), ok. -- cgit v1.2.3