--- trunk/t/5_Node.t 2006/01/05 21:51:29 35 +++ trunk/t/5_Node.t 2006/01/05 22:36:10 39 @@ -3,7 +3,7 @@ use strict; use blib; -use Test::More tests => 11; +use Test::More tests => 12; use Test::Exception; use Data::Dumper; @@ -12,24 +12,29 @@ # name of node for test my $test_node = 'Search-Estraier'; -ok(my $node = new Search::Estraier::Node, 'new'); +ok(my $node = new Search::Estraier::Node(1), 'new'); isa_ok($node, 'Search::Estraier::Node'); ok($node->set_url('http://localhost:1978/'), 'set_url'); -ok($node->set_proxy('proxy.example.com', 8080), 'set_proxy'); +ok($node->set_proxy('', 8080), 'set_proxy'); throws_ok {$node->set_proxy('proxy.example.com', 'foo') } qr/port/, 'set_proxy port NaN'; ok($node->set_timeout(42), 'set_timeout'); throws_ok {$node->set_timeout('foo') } qr/timeout/, 'set_timeout NaN'; -ok($node->set_auth('foo','bar'), 'set_auth'); +ok($node->set_auth('admin','admin'), 'set_auth'); cmp_ok($node->status, '==', -1, 'status'); +my @res = ( -1, 200 ); + my $nodelist; -cmp_ok($node->shuttle_url( '?action=nodelist', 'text/plain', undef, \$nodelist), - '==', 200, 'nodelist'); +foreach my $url (qw{?action=nodelist http://localhost:1978/master?action=nodelist}) { + cmp_ok( + $node->shuttle_url( $url, 'text/plain', undef, \$nodelist) + ,'==', shift @res, 'nodelist'); +} my $draft = <<'_END_OF_DRAFT_'; @uri=data001