ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/URL/test/test_URLcache.pm
Revision: 1.1
Committed: Fri Nov 12 17:39:39 1999 UTC (25 years, 6 months ago) by williamc
Content type: text/plain
Branch: MAIN
Log Message:
basic tests - no portabilty test yet

File Contents

# User Rev Content
1 williamc 1.1 #
2     # URLcache test suite
3     #
4    
5     package URL::test::test_URLcache;
6     use URL::URLcache;
7     require 5.001;
8     @ISA = ("TestClass"); #methods both from the test class
9    
10     sub test {
11     my $self=shift;
12    
13     # test 1
14     $self->newtest("New Object");
15     $self->newobject($self->temparea()."/cacheindex");
16     $self->newtest("Store some urls");
17     $self->testinterface("store", "url1", "file1");
18     $self->testinterface("store", "url2", "file2");
19     $self->testinterface("store", "url3", "file3");
20     $self->newtest("Close Down and Restore");
21    
22     # kill off the old object and attempt a restore
23     undef $self->{object};
24     $self->newobject($self->temparea()."/cacheindex");
25     $self->datacheck();
26    
27     # Test the filename function
28     $self->newtest("test filename(url) interface");
29     $self->expect("file1");
30     $self->testinterface("filename", "url1");
31     $self->clearexpect();
32     my $temp=$self->testinterface("filename", "url-random");
33     $self->testinterface("store", "url-random", $temp);
34     $self->expect($temp);
35     $temp=$self->testinterface("filename", "url-random");
36     $self->clearexpect();
37    
38     # Test the update function
39     $self->newtest("test sequence number change on updates");
40     $self->expect(1);
41     $self->testinterface("updatenumber", "url1");
42     $self->clearexpect();
43     $numb=$self->testinterface("store", "url1", "file1");
44     $self->expect($numb+1);
45     $self->testinterface("updatenumber", "url1");
46     $self->clearexpect();
47     }
48    
49     sub datacheck {
50     my $self=shift;
51     $self->newtest("Get a URL");
52     $self->expect("file2");
53     $self->testinterface("file","url2");
54     $self->clearexpect();
55     }