ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Configuration/test/test_ConfigArea.pm
Revision: 1.6
Committed: Wed Feb 23 15:00:56 2000 UTC (25 years, 2 months ago) by williamc
Content type: text/plain
Branch: MAIN
CVS Tags: ProtoEnd
Branch point for: HPWbranch
Changes since 1.5: +14 -0 lines
Log Message:
updated test suite

File Contents

# User Rev Content
1 williamc 1.1 #
2     # Tool test suite
3     #
4    
5     package Configuration::test::test_ConfigArea;
6     require 5.001;
7     use Configuration::ConfigureStore;
8     use Configuration::ConfigArea;
9     use ActiveDoc::ActiveConfig;
10     use ActiveDoc::Application;
11    
12     @ISA = ("ActiveDoc::DocTester"); #methods both from the test class
13    
14    
15     sub init {
16     my $self=shift;
17     $self->initdoc();
18     $self->{testfile}=$self->datadir("")."/ConfigAreaDoc";
19 williamc 1.6 $self->{satarea}=$self->temparea("")."/ConfigArea/".$self->newfilename();
20 williamc 1.1 }
21    
22     sub test {
23     my $self=shift;
24     $self->newtest("Initiation test - file not existing");
25 williamc 1.5 $self->newtestdoc("file:".$self->{testfile});
26 williamc 1.1 $self->newtest("setup");
27     $self->testinterface("setup");
28 williamc 1.4 $self->_areatest();
29     my $areadir=$self->testinterface("location");
30     $self->verifydir($areadir);
31 williamc 1.6 $self->verifydir($areadir."/downloadsrc/dir_a");
32     $self->verifydir($areadir."/downloadsrc/dir_b");
33     $self->verifydir($areadir."/downloadsrc/dir_c");
34     $self->verifydir($areadir."/lib");
35 williamc 1.4
36 williamc 1.3 $self->newtest("simple persistence testing");
37     $location=$self->temparea("")."/".$self->newfilename();
38     $self->testinterface("store", $location);
39 williamc 1.2 undef $self->{object};
40 williamc 1.4 $self->_restoreit($location);
41    
42     my $area2=$self->temparea("")."/".$self->newfilename();
43     undef $self->{object};
44     rename($areadir,$area2);
45     $self->newtest("Can we Move ConfigArea?");
46     $self->newobject($self->docstore());
47     $self->testinterface("bootstrapfromlocation",$area2);
48     $self->expect($area2);
49     $self->testinterface("location");
50     $self->clearexpect();
51     $self->_areatest();
52 williamc 1.6
53     $self->newtest("Make a satelite area");
54     $self->testinterface("satellite",$self->{satarea});
55     $self->verifydir($self->{satarea}."/lib");
56    
57     $self->newtest("structure access test");
58     $self->expect("lib");
59     $self->testinterface("structurelist");
60     $self->clearexpect();
61 williamc 1.4 }
62    
63     sub _areatest {
64     my $self=shift;
65     $self->expect("testname");
66     $self->testinterface("name");
67     $self->clearexpect();
68     $self->expect("version1");
69     $self->testinterface("version");
70     $self->clearexpect();
71     }
72    
73    
74     sub _restoreit {
75     my $self=shift;
76     my $location=shift;
77    
78 williamc 1.3 $self->newobject($self->docstore());
79 williamc 1.1 $self->testinterface("restore",$location);
80 williamc 1.4
81     # make sure the config items are restored OK
82     my @cfitems=$self->testinterface("configitem");
83     if ( $cfitems[0]->name() ne "ConfigItemTest") {
84     $self->testfail("FAILED: got ".$cfitems[0]->name()." expecting "
85     ."ConfigItemTest");
86     }
87     else {
88     $self->testpass("Configuration Items Name restored OK");
89     }
90 williamc 1.1 }
91 williamc 1.4
92