X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=t%2F26-packages.t;h=7624e689831799cb834e2aeb62213b1aaa03b5e7;hb=bc1064f676d60c92f03cb0cf5d05fbca4f2fd7a6;hp=becab67f3738a1636537974ab55d5389f6843919;hpb=1ca1d4abecce01941183fa3bed64df468b43c50d;p=ZOOM-Perl-moved-to-github.git diff --git a/t/26-packages.t b/t/26-packages.t index becab67..7624e68 100644 --- a/t/26-packages.t +++ b/t/26-packages.t @@ -1,4 +1,4 @@ -# $Id: 26-packages.t,v 1.4 2005-12-13 17:35:20 mike Exp $ +# $Id: 26-packages.t,v 1.8 2006-06-07 09:58:56 mike Exp $ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 26-packages.t' @@ -10,9 +10,8 @@ use Test::More tests => 40; BEGIN { use_ok('ZOOM') }; -# For now, use a local database: later establish a public one for this. # We will create, and destroy, a new database with a random name -my $host = "test.indexdata.com:8017"; +my $host = "test.indexdata.com:2118"; my $dbname = join("", map { chr(ord("a") + int(rand(26))) } 1..10); # Connect anonymously, and expect this to fail @@ -58,8 +57,7 @@ count_hits($conn, "the", 0, 2); dropdb($conn, $dbname, 0); # A second dropping should fail, as the database is no longer there. -### But at present, it's "always successful" (though not really) -dropdb($conn, $dbname, 0); +dropdb($conn, $dbname, 10004); sub makeconn { @@ -120,8 +118,7 @@ sub dropdb { my $p = $conn->package(); # No need to keep ok()ing this, or checking the option-setting $p->option(databaseName => $dbname); - ### Don't send the package at the moment -- it corrupts Zebra - #$p->send("drop"); + eval { $p->send("drop") }; my($errcode, $errmsg, $addinfo) = maybe_error($@); ok($errcode == $expected_error, "database drop '$dbname'" . ($errcode ? " refused $errcode" : "")); @@ -194,3 +191,13 @@ sub maybe_error { return (0, undef, undef); } } + + +# To investigate the set of databases created, use Explain Classic: +# +# $ yaz-client -u admin/fish test.indexdata.com:2118/IR-Explain-1 +# Z> find @attr exp1 1=1 databaseinfo +# Z> format xml +# Z> show 3 +# +# It seems that Explain still knows about dropped databases.