1 # $Id: Explain.pm,v 1.6 2007-03-05 12:15:11 mike Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Search::Explain;
11 use ZOOM::IRSpy::Test;
12 our @ISA = qw(ZOOM::IRSpy::Test);
18 my @explain = qw(CategoryList TargetInfo DatabaseInfo SchemaInfo TagSetInfo
19 RecordSyntaxInfo AttributeSetInfo TermListInfo
20 ExtendedServicesInfo AttributeDetails TermListDetails
21 ElementSetDetails RetrivalRecordDetails SortDetails
22 Processing VariantSetInfo UnitSet);
24 foreach my $category (@explain) {
25 $conn->irspy_search_pqf('@attr exp-1 1=1 ' . $category,
26 {'category' => $category},
27 { databaseName => 'IR-Explain-1' },
28 ZOOM::Event::ZEND, \&found,
29 exception => \&error);
35 my($conn, $task, $test_args, $event) = @_;
36 my $category = $test_args->{'category'};
37 my $n = $task->{rs}->size();
40 $conn->log("irspy_test", "Explain category ", $category, " gave ", $n,
46 update($conn, $category, $ok);
48 return ZOOM::IRSpy::Status::TASK_DONE;
53 my($conn, $task, $test_args, $exception) = @_;
54 my $category = $test_args->{'category'};
56 $conn->log("irspy_test", "Explain category lookup failed: ", $exception);
57 update($conn, $category, 0);
59 return ZOOM::IRSpy::Status::TEST_BAD
60 if ($exception->code() == 109 || # Database unavailable
61 $exception->code() == 235); # Database does not exist
63 return ZOOM::IRSpy::Status::TASK_DONE;
68 my ($conn, $category, $ok) = @_;
69 $conn->record()->store_result('explain', 'category' => $category,