ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Configuration/test/test_Tool2.pm
Revision: 1.1
Committed: Thu Jan 20 18:24:17 2000 UTC (25 years, 4 months ago) by williamc
Content type: text/plain
Branch: MAIN
CVS Tags: ProtoEnd
Log Message:
bring up to current status

File Contents

# User Rev Content
1 williamc 1.1 #
2     # Tool test suite
3     #
4    
5     package Configuration::test::test_Tool2;
6     require 5.001;
7     use ActiveDoc::ActiveDoc;
8     use ActiveDoc::ActiveConfig;
9     use Configuration::Tool2;
10    
11     @ISA = ("TestClass"); #methods both from the test class
12    
13     sub init {
14     my $self=shift;
15     $self->{testfile}=$self->datadir()."/Tool";
16     $self->{Configuration}=ActiveDoc::ActiveConfig->new($self->temparea());
17     }
18    
19     sub test {
20     my $self=shift;
21     $self->newtest("Initiation test - file not existing");
22     $self->newobject($self->{Configuration});
23     $self->newtest("feature testing - empty feature");
24     $self->testinterface("feature","non-exist");
25     $self->newtest("feature testing - simple add");
26     $self->testinterface("feature","feature1","value1");
27     $self->testinterface("feature","feature2","value2");
28     $self->testinterface("feature","feature3","value3");
29     $self->expect("value1");
30     $self->testinterface("feature","feature1");
31     $self->clearexpect();
32     $self->expect("value2");
33     $self->testinterface("feature","feature2");
34     $self->clearexpect();
35     $self->newtest("feature testing - extending feature defn");
36     $self->testinterface("feature","feature2","value2B");
37     $self->expect("value2","value2B");
38     $self->testinterface("feature","feature2");
39     $self->clearexpect();
40     $self->newtest("feature testing - listing and removing");
41     $self->expect("feature1","feature2","feature3");
42     $self->testinterface("featurelist");
43     $self->clearexpect();
44     $self->testinterface("deletefeature","feature3");
45     $self->expect("feature1","feature2");
46     $self->testinterface("featurelist");
47     $self->clearexpect();
48    
49     my $location=$self->temparea()."/".$self->newfilename();
50     $self->newtest("persistence testing");
51     print "Storing to file $location\n";
52     $self->testinterface("store",$location);
53     undef $self->{object};
54     $self->newobject($self->{Configuration});
55     $self->testinterface("restore",$location);
56     $self->expect("feature1","feature2");
57     $self->testinterface("featurelist");
58     $self->clearexpect();
59     }