1 |
williamc |
1.1.2.1 |
#
|
2 |
|
|
# Requirements.pm test suite
|
3 |
|
|
#
|
4 |
|
|
|
5 |
|
|
package BuildSystem::test::test_Requirements;
|
6 |
|
|
require 5.001;
|
7 |
|
|
use BuildSystem::Requirements;
|
8 |
williamc |
1.1.2.1.2.1 |
use URL::URLcache;
|
9 |
williamc |
1.1.2.1 |
|
10 |
|
|
@ISA=qw(Utilities::TestClass); #methods both from the test class
|
11 |
|
|
|
12 |
|
|
sub init {
|
13 |
|
|
my $self=shift;
|
14 |
|
|
$self->{testfile}=$self->datadir()."/RequirementsDocTest";
|
15 |
|
|
|
16 |
|
|
# make a dummy toolbox
|
17 |
|
|
$self->{toolbox}=$self;
|
18 |
williamc |
1.1.2.1.2.1 |
$self->{cachedir}=$self->temparea()."/RequirementsTest/cache";
|
19 |
williamc |
1.1.2.1.2.2 |
$self->{dbdir}=$self->temparea()."/RequirementsTest/db";
|
20 |
williamc |
1.1.2.1.2.1 |
$self->{cache}=URL::URLcache->new($self->{cachedir});
|
21 |
williamc |
1.1.2.1.2.2 |
$self->{db}=ObjectUtilities::ObjectStore->new($self->{dbdir});
|
22 |
williamc |
1.1.2.1 |
}
|
23 |
|
|
|
24 |
|
|
sub test {
|
25 |
|
|
my $self=shift;
|
26 |
|
|
$self->newtest("Initiation test");
|
27 |
williamc |
1.1.2.1.2.2 |
$self->newobject("file:".$self->{testfile}, $self->{cache}, $self->{db});
|
28 |
williamc |
1.1.2.1.2.1 |
$self->newtest("Download test");
|
29 |
|
|
$self->testinterface("download");
|
30 |
|
|
|
31 |
williamc |
1.1.2.1.2.3 |
$self->newtest("Selection test");
|
32 |
|
|
$self->expect("test","yetanothertool","toolb");
|
33 |
|
|
$self->testinterface("selectedtools");
|
34 |
|
|
$self->clearexpect();
|
35 |
|
|
|
36 |
|
|
$self->newtest("Tool list test");
|
37 |
|
|
$self->expect("test","anothertest","yetanothertool","toola","toolb");
|
38 |
|
|
$self->testinterface("tools");
|
39 |
|
|
$self->clearexpect();
|
40 |
|
|
|
41 |
williamc |
1.1.2.1 |
$self->newtest("Setup Testing");
|
42 |
|
|
$self->testinterface("setup",$self);
|
43 |
williamc |
1.1.2.1.2.3 |
$self->cmparray($self->{toolsetups},"test","yetanothertool","toolb");
|
44 |
williamc |
1.1.2.1.2.1 |
|
45 |
|
|
$self->newtest("URL Test");
|
46 |
|
|
$self->expect("cvs://cmscvs.cern.ch/cvs_server/repositories/SCRAM?auth=pserver&module=test/testtool&passkey=AA_:yZZ3e&user=anonymous&version=A");
|
47 |
|
|
$self->testinterface("url","test");
|
48 |
|
|
$self->clearexpect();
|
49 |
williamc |
1.1.2.1 |
}
|
50 |
|
|
|
51 |
|
|
# --- stubs
|
52 |
|
|
sub toolsetup {
|
53 |
|
|
my $self=shift;
|
54 |
|
|
push @{$self->{toolsetups}}, shift;
|
55 |
|
|
}
|