--- trunk/t/5_Node.t 2006/05/15 22:26:08 150 +++ trunk/t/5_Node.t 2006/05/16 11:39:53 151 @@ -3,7 +3,7 @@ use strict; use blib; -use Test::More tests => 252; +use Test::More tests => 270; use Test::Exception; use Data::Dumper; @@ -32,11 +32,9 @@ # test master functionality -#diag "not testing shutdown\n"; +diag("node->master shutdown not tested"); -my $msg; - -#diag "not testing backup\n"; +diag("node->master backup not tested"); ok(my @users = $node->master( action => 'userlist' ), 'userlist'); @@ -50,6 +48,7 @@ misc => 'test user', }; +my $msg; ok($msg = $node->master( action => 'useradd', %{ $user }, @@ -107,11 +106,6 @@ } ok($msg = $node->master( - action => 'nodeclr', - name => $temp_node, -), "nodeclr $temp_node: $msg"); - -ok($msg = $node->master( action => 'nodedel', name => $temp_node, ), "nodedel $temp_node: $msg"); @@ -139,6 +133,7 @@ $doc->add_attr('@uri', 'test' . $_); ok( $node->put_doc($doc), "put_doc test$_"); #diag $doc->dump_draft; + cmp_ok( $node->doc_num, '==', ($_ + 1), "node->doc_num " . ($_ + 1)); } ok(! $node->uri_to_id( 'does-not-exists' ), "non-existant uri_to_id"); @@ -167,8 +162,6 @@ cmp_ok( $node->doc_num, '==', $doc_num - $_, "node->doc_num " . ($doc_num - $_)); } -ok($msg = $node->master( action => 'sync' ), "sync: $msg"); - my $doc_num2 = $doc_num - $delete_num; cmp_ok($node->doc_num, '==', $doc_num2, "node->doc_num $doc_num2"); @@ -289,6 +282,13 @@ like($links->[0], qr/^$link_url/, 'link correct'); ok($node->set_link("http://localhost:1978/node/$test2_node", $test2_label, 0), "set_link $test2_node ($test2_label) delete"); +ok($msg = $node->master( + action => 'nodeclr', + name => $node->name, +), "nodeclr $node->name: $msg"); + +cmp_ok($node->doc_num, '==', 0, 'no documents'); + # cleanup test nodes foreach my $node_name ( $test1_node , $test2_node ) { ok($msg = $node->master( @@ -348,4 +348,6 @@ name => $node_name, ), "nodedel $node_name: $msg"); +ok($msg = $node->master( action => 'sync' ), "sync: $msg"); + diag "over";