ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/test/test_Tool.pm
Revision: 1.1.2.1
Committed: Tue Apr 11 08:59:15 2000 UTC (25 years, 1 month ago) by williamc
Content type: text/plain
Branch: V0_9branch
CVS Tags: V0_12_3, V0_12_2, V0_12_1, V0_12_0, V0_11_4, V0_11_3, V0_11_2
Changes since 1.1: +68 -0 lines
Log Message:
basic testing - no embedded restoration

File Contents

# User Rev Content
1 williamc 1.1.2.1 #
2     # Tool.pm test suite
3     #
4    
5     package BuildSystem::test::test_Tool;
6     require 5.001;
7     use BuildSystem::Tool;
8    
9     @ISA = ("Utilities::TestClass"); #methods both from the test class
10    
11     sub init {
12     my $self=shift;
13     $self->{testfile}=$self->datadir()."/SimpleDocTest";
14     }
15    
16     sub test {
17     my $self=shift;
18     $self->newtest("Initiation test");
19     $self->newobject();
20     $self->testinterface("name","testname");
21     $self->testinterface("version","V1");
22     $self->_testgeneral();
23    
24     $self->newtest("Feature Testing");
25     $self->testinterface("addfeature","testfeature1","testvalue1" );
26     $self->testinterface("addfeature","testfeature2","testvalue2" );
27     $self->testinterface("addfeature","testfeature3","testvalue3" );
28     $self->testinterface("type","testfeature2","typeA" );
29     $self->testinterface("type","testfeature3","typeA" );
30     $self->_testfeature();
31    
32     $self->newtest("Type listing test");
33     $self->expect("testfeature2","testfeature3");
34     $self->testinterface("listtype","typeA");
35     $self->clearexpect();
36    
37     $self->newtest("Persistency Testing");
38     my $savefile=$self->temparea()."/".$self->newfilename();
39     $self->testinterface("store",$savefile);
40     undef $self->{object};
41     $self->newobject();
42     $self->testinterface("restore",$savefile);
43     $self->_testgeneral();
44     $self->_testfeature();
45     }
46    
47     sub _testgeneral {
48     my $self=shift;
49     $self->expect("testname");
50     $self->testinterface("name");
51     $self->clearexpect();
52     $self->expect("V1");
53     $self->testinterface("version");
54     $self->clearexpect();
55     }
56    
57     sub _testfeature {
58     my $self=shift;
59     $self->expect("testvalue1");
60     $self->testinterface("getfeature","testfeature1" );
61     $self->clearexpect();
62     $self->expect("testvalue2");
63     $self->testinterface("getfeature","testfeature2" );
64     $self->clearexpect();
65     $self->expect("typeA");
66     $self->testinterface("type","testfeature2","typeA" );
67     $self->clearexpect();
68     }