ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/DocTester.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/DocTester.pm (file contents):
Revision 1.2 by williamc, Fri Jan 21 09:42:41 2000 UTC vs.
Revision 1.5 by williamc, Wed Feb 23 14:54:01 2000 UTC

# Line 12 | Line 12
12   # new()         : A new DocTester object
13   # initdoc([docstore]) : initialise starter doc etc.
14   # --- after initdoc can call
15 < # newdoc(url)   : create a new document with the given url
15 > # newtestdoc(url)   : create a new document with the given url
16   # docstore()    : return the base document store
17  
18   package ActiveDoc::DocTester;
# Line 25 | Line 25 | use Utilities::TestClass;
25  
26   sub initdoc {
27          my $self=shift;
28        # make a new tmp store
28          if ( @_ ) {
29 <         $self->{docstore}=shift;
29 >          $self->{docstore}=shift;
30          }
31 <        else {
33 <         $self->{storedir}=$self->temparea()."/DocTester";
34 <         $self->{docstore}=ActiveDoc::ActiveConfig->new($self->{storedir});
35 <        }
36 <        $self->{appl}=ActiveDoc::Application->new($self->{docstore});
37 <        $self->{appl}->options(ActiveDoc::Query->new());
31 >        $self->appl();
32   }
33  
34 < sub newdoc {
34 > sub newtestdoc {
35          my $self=shift;
36          $self->{object}=$self->{appl}->activatedoc(@_);
37 +        $self->{inttest}{"new"}++;
38 + }
39 +
40 + sub docstore {
41 +        my $self=shift;
42 +        if ( ! defined $self->{docstore} ) {
43 +         $self->{storedir}=$self->temparea()."/DocTester/".$self->newfilename();
44 +         $self->{docstore}=ActiveDoc::ActiveConfig->new($self->{storedir});
45 +        }
46 +        return $self->{docstore};
47 + }
48 +        
49 + sub appl {
50 +        my $self=shift;
51 +        if ( ! defined $self->{appl} ) {
52 +          my $doc=$self->docstore();
53 +          $self->{appl}=ActiveDoc::Application->new($doc);
54 +                                        
55 +        }
56 +        return $self->{appl};
57   }
58  
59   sub options {
60          my $self=shift;
61 <        $self->{appl}->options(@_);
61 >        $self->appl()->options(@_);
62   }
63  
64 < sub userinterface {
64 > sub setoption {
65          my $self=shift;
66 <        $self->{appl}->userinterface(@_);
66 >        $self->appl()->setoption(@_);
67   }
68  
69 < sub docstore {
69 > sub userinterface {
70          my $self=shift;
71 <        $self->{docstore};
71 >        $self->{appl}->userinterface(@_);
72   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines