ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/test/test_ActiveDoc.pm
Revision: 1.2
Committed: Mon Aug 28 07:43:22 2000 UTC (24 years, 8 months ago) by williamc
Content type: text/plain
Branch: MAIN
CVS Tags: v102p1, V1_0_1, V1_0_0, V1_pre0, SCRAM_V1, SCRAMV1_IMPORT, V0_19_7, V0_19_6, V0_19_6p1, V0_19_5, SFATEST, V0_19_4, V0_19_4_pre3, V0_19_4_pre2, V0_19_4_pre1, V0_19_3, V0_19_2, V0_19_1, V0_19_0, V0_18_5, V0_18_4, V0_18_2, V0_18_1
Branch point for: V1_pre1, SCRAM_V1_BRANCH, V0_19_4_B
Changes since 1.1: +27 -7 lines
Log Message:
merge from HPWbranch

File Contents

# User Rev Content
1 williamc 1.1 #
2     # ActiveDoc test suite
3     #
4    
5     package ActiveDoc::test::test_ActiveDoc;
6     use ActiveDoc::ActiveDoc;
7 williamc 1.2 use ActiveDoc::ActiveStore;
8     use Utilities::TestClass;
9     use ObjectUtilities::ObjectStore;
10     use URL::URLcache;
11     require 5.004;
12 williamc 1.1
13 williamc 1.2 @ISA = ("Utilities::TestClass"); #methods both from the test class
14 williamc 1.1
15     sub init {
16     my $self=shift;
17     $self->{testfile}=$self->datadir()."/ActiveDocTest";
18 williamc 1.2 $self->{verifyfile}=$self->datadir()."/ActiveDocTest-verify";
19 williamc 1.1 $self->{configarea}=$self->temparea()."/ActiveDoc";
20 williamc 1.2 $self->{Ostore}=ActiveDoc::ActiveStore->new($self->{configarea});
21     # $self->{db}=ObjectUtilities::ObjectStore->new(
22     # $self->{configarea}."/db");
23     # $self->{cache}=URL::URLcache->new($self->{configarea}."/cache");
24 williamc 1.1 }
25    
26     sub test {
27     my $self=shift;
28     $self->{expectedstring}="";
29    
30     $self->newtest("Initiation test");
31 williamc 1.2 $self->newobject($self->{Ostore});
32     $self->testinterface("verbosity",1);
33    
34 williamc 1.1 $self->newtest("url test");
35     $self->testinterface("url","file:".$self->{testfile});
36 williamc 1.2 my $file=$self->testinterface("ProcessFile");
37     $self->verify($self->{verifyfile},$file);
38     $self->newtest("url called twice");
39     $self->testinterface("url","file:".$self->{testfile});
40    
41     $self->newtest("direct use of getfile");
42     $file=$self->testinterface("getfile","file:".$self->{testfile});
43    
44     $self->newtest("line matching");
45     my ($line,$fileobj)=$self->testinterface(line,10);
46     $self->cmpstring("2",$line);
47     $self->cmpstring("cvs://cmscvs.cern.ch/cvs_server/repositories/SCRAM?auth=pserver&module=test/testinclude2&passkey=AA_:yZZ3e&user=anonymous",$fileobj->url());
48    
49 williamc 1.1 $self->newtest("activatedoc test");
50     $self->testinterface("activatedoc","file:".$self->{testfile});
51     }
52    
53     sub printout {
54     my $self=shift; # This self not necessarily that of the rest of obj!
55     my $name=shift;
56     my $string=shift;
57    
58     print " ++++++++++++++++++++ Printing ++++++++++++++++++++ ";
59     print $string;
60     if ( $self->{expectedstring} ne "" ) {
61     if ( $string=~/$self->{expectedstring}/ ) {
62     TestClass->testpass("Test Passed");
63     }
64     else {
65     TestClass->testfail("Expecting $self->{expectedstring}, got $string");
66     }
67     }
68     }