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.6 by sashby, Wed Aug 17 11:04:33 2005 UTC

# Line 1 | Line 1
1 + BEGIN
2 +   {
3 +   print " ActiveDoc::DocTester: I AM used!!","\n";
4 +   };
5 +
6 +
7   #
8   # DocTester.pm
9   #
# Line 12 | Line 18
18   # new()         : A new DocTester object
19   # initdoc([docstore]) : initialise starter doc etc.
20   # --- after initdoc can call
21 < # newdoc(url)   : create a new document with the given url
21 > # newtestdoc(url)   : create a new document with the given url
22   # docstore()    : return the base document store
23  
24   package ActiveDoc::DocTester;
# Line 25 | Line 31 | use Utilities::TestClass;
31  
32   sub initdoc {
33          my $self=shift;
28        # make a new tmp store
34          if ( @_ ) {
35 <         $self->{docstore}=shift;
35 >          $self->{docstore}=shift;
36          }
37 <        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());
37 >        $self->appl();
38   }
39  
40 < sub newdoc {
40 > sub newtestdoc {
41          my $self=shift;
42          $self->{object}=$self->{appl}->activatedoc(@_);
43 +        $self->{inttest}{"new"}++;
44 + }
45 +
46 + sub docstore {
47 +        my $self=shift;
48 +        if ( ! defined $self->{docstore} ) {
49 +         $self->{storedir}=$self->temparea()."/DocTester/".$self->newfilename();
50 +         $self->{docstore}=ActiveDoc::ActiveConfig->new($self->{storedir});
51 +        }
52 +        return $self->{docstore};
53 + }
54 +        
55 + sub appl {
56 +        my $self=shift;
57 +        if ( ! defined $self->{appl} ) {
58 +          my $doc=$self->docstore();
59 +          $self->{appl}=ActiveDoc::Application->new($doc);
60 +                                        
61 +        }
62 +        return $self->{appl};
63   }
64  
65   sub options {
66          my $self=shift;
67 <        $self->{appl}->options(@_);
67 >        $self->appl()->options(@_);
68   }
69  
70 < sub userinterface {
70 > sub setoption {
71          my $self=shift;
72 <        $self->{appl}->userinterface(@_);
72 >        $self->appl()->setoption(@_);
73   }
74  
75 < sub docstore {
75 > sub userinterface {
76          my $self=shift;
77 <        $self->{docstore};
77 >        $self->{appl}->userinterface(@_);
78   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines