1 |
#
|
2 |
# Requirements.pm test suite
|
3 |
#
|
4 |
|
5 |
package BuildSystem::test::test_Requirements;
|
6 |
require 5.001;
|
7 |
use BuildSystem::Requirements;
|
8 |
use ActiveDoc::ActiveStore;
|
9 |
|
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 |
$self->{dbdir}=$self->temparea()."/RequirementsTest";
|
19 |
$self->{db}=ActiveDoc::ActiveStore->new($self->{dbdir});
|
20 |
}
|
21 |
|
22 |
sub test {
|
23 |
my $self=shift;
|
24 |
$self->newtest("Initiation test");
|
25 |
$self->newobject($self->{db}, "file:".$self->{testfile});
|
26 |
$self->newtest("Download test");
|
27 |
$self->testinterface("download");
|
28 |
|
29 |
$self->newtest("Selection test");
|
30 |
$self->expect("test","yetanothertool","toolb");
|
31 |
$self->testinterface("selectedtools");
|
32 |
$self->clearexpect();
|
33 |
|
34 |
$self->newtest("Tool list test");
|
35 |
$self->expect("test","anothertest","yetanothertool","toola","toolb");
|
36 |
$self->testinterface("tools");
|
37 |
$self->clearexpect();
|
38 |
|
39 |
$self->newtest("Setup Testing");
|
40 |
$self->testinterface("setup",$self);
|
41 |
$self->cmparray($self->{toolsetups},"test","yetanothertool","toolb");
|
42 |
|
43 |
$self->newtest("URL Test");
|
44 |
$self->expect("cvs://cmscvs.cern.ch/cvs_server/repositories/SCRAM?auth=pserver&module=test/testtool&passkey=AA_:yZZ3e&user=anonymous&version=A");
|
45 |
$self->testinterface("toolurl","test");
|
46 |
$self->clearexpect();
|
47 |
|
48 |
$self->newtest("Arch listing test");
|
49 |
$self->expect("testarchA","testarchB");
|
50 |
$self->testinterface("archlist");
|
51 |
$self->clearexpect();
|
52 |
|
53 |
$self->newtest("arch specific selections");
|
54 |
my $req=$self->testinterface("getreqforarch","testarchA");
|
55 |
$self->cmparray([$req->selectedtools()]
|
56 |
,"test","yetanothertool","toola","toolb");
|
57 |
$req=$self->testinterface("getreqforarch","testarchB");
|
58 |
$self->cmparray([$req->selectedtools()],"test","yetanothertool");
|
59 |
|
60 |
$self->newtest("toolcomment");
|
61 |
$self->expect("Some comments\n");
|
62 |
$self->testinterface("toolcomment","test","version1");
|
63 |
$self->clearexpect();
|
64 |
}
|
65 |
|
66 |
# --- stubs
|
67 |
sub toolsetup {
|
68 |
my $self=shift;
|
69 |
push @{$self->{toolsetups}}, shift;
|
70 |
}
|