Revision: | 1.5 |
Committed: | Wed Feb 23 14:54:01 2000 UTC (25 years, 2 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, V_18_3_TEST, VO_18_3, V0_18_2, V0_18_1, ProtoEnd |
Branch point for: | V1_pre1, SCRAM_V1_BRANCH, V0_19_4_B |
Changes since 1.4: | +2 -2 lines |
Log Message: | bring in line |
# | User | Rev | Content |
---|---|---|---|
1 | williamc | 1.1 | # |
2 | # DocTester.pm | ||
3 | # | ||
4 | # Originally Written by Christopher Williams | ||
5 | # | ||
6 | # Description | ||
7 | # ----------- | ||
8 | # Extension of TestUtilities for doc testing | ||
9 | # | ||
10 | # Interface | ||
11 | # --------- | ||
12 | # new() : A new DocTester object | ||
13 | williamc | 1.2 | # initdoc([docstore]) : initialise starter doc etc. |
14 | # --- after initdoc can call | ||
15 | williamc | 1.3 | # newtestdoc(url) : create a new document with the given url |
16 | williamc | 1.2 | # docstore() : return the base document store |
17 | williamc | 1.1 | |
18 | package ActiveDoc::DocTester; | ||
19 | require 5.004; | ||
20 | use ActiveDoc::Application; | ||
21 | use ActiveDoc::Query; | ||
22 | use Utilities::TestClass; | ||
23 | |||
24 | @ISA=qw(Utilities::TestClass); | ||
25 | |||
26 | sub initdoc { | ||
27 | my $self=shift; | ||
28 | if ( @_ ) { | ||
29 | williamc | 1.4 | $self->{docstore}=shift; |
30 | williamc | 1.1 | } |
31 | williamc | 1.4 | $self->appl(); |
32 | williamc | 1.1 | } |
33 | |||
34 | williamc | 1.3 | sub newtestdoc { |
35 | williamc | 1.1 | my $self=shift; |
36 | $self->{object}=$self->{appl}->activatedoc(@_); | ||
37 | williamc | 1.4 | $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 | williamc | 1.1 | } |
58 | |||
59 | sub options { | ||
60 | my $self=shift; | ||
61 | williamc | 1.4 | $self->appl()->options(@_); |
62 | williamc | 1.1 | } |
63 | |||
64 | williamc | 1.5 | sub setoption { |
65 | williamc | 1.1 | my $self=shift; |
66 | williamc | 1.5 | $self->appl()->setoption(@_); |
67 | williamc | 1.2 | } |
68 | |||
69 | williamc | 1.4 | sub userinterface { |
70 | williamc | 1.2 | my $self=shift; |
71 | williamc | 1.4 | $self->{appl}->userinterface(@_); |
72 | williamc | 1.1 | } |