~ubuntu-branches/ubuntu/natty/otrs2/natty-updates

« back to all changes in this revision

Viewing changes to scripts/test/Queue.t

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2007-04-14 17:58:55 UTC
  • mto: (20.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: package-import@ubuntu.com-20070414175855-9ne0w01yu1q44ch0
Tags: upstream-2.1.7
ImportĀ upstreamĀ versionĀ 2.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# --
 
2
# Queue.t - Queue tests
 
3
# Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
 
4
# --
 
5
# $Id: Queue.t,v 1.3 2006/08/26 17:36:26 martin Exp $
 
6
# --
 
7
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
 
8
# the enclosed file COPYING for license information (GPL). If you
 
9
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
 
10
# --
 
11
 
 
12
use Kernel::System::Queue;
 
13
 
 
14
$Self->{QueueObject} = Kernel::System::Queue->new(%{$Self});
 
15
 
 
16
my $QueueRand = 'Some::Queue'.int(rand(1000000));
 
17
my $QueueID = $Self->{QueueObject}->QueueAdd(
 
18
    Name            => $QueueRand,
 
19
    ValidID         => 1,
 
20
    GroupID         => 1,
 
21
    SystemAddressID => 1,
 
22
    SalutationID    => 1,
 
23
    SignatureID     => 1,
 
24
    UserID          => 1,
 
25
    MoveNotify      => 0,
 
26
    StateNotify     => 0,
 
27
    LockNotify      => 0,
 
28
    OwnerNotify     => 0,
 
29
);
 
30
 
 
31
$Self->True(
 
32
    $QueueID,
 
33
    'QueueAdd()',
 
34
);
 
35
 
 
36
my $QueueUpdate = $Self->{QueueObject}->QueueUpdate(
 
37
    QueueID         => $QueueID,
 
38
    Name            => $QueueRand."1",
 
39
    ValidID         => 1,
 
40
    GroupID         => 1,
 
41
    SystemAddressID => 1,
 
42
    SalutationID    => 1,
 
43
    SignatureID     => 1,
 
44
    FollowUpID      => 1,
 
45
    UserID          => 1,
 
46
    MoveNotify      => 0,
 
47
    StateNotify     => 0,
 
48
    LockNotify      => 0,
 
49
    OwnerNotify     => 0,
 
50
);
 
51
 
 
52
$Self->True(
 
53
    $QueueUpdate,
 
54
    'QueueUpdate()',
 
55
);
 
56
 
 
57
my %QueueGet = $Self->{QueueObject}->QueueGet(
 
58
    ID => $QueueID,
 
59
);
 
60
 
 
61
$Self->True(
 
62
    $QueueGet{Name} eq $QueueRand."1",
 
63
    'QueueGet()',
 
64
);
 
65
 
 
66
my $Queue = $Self->{QueueObject}->QueueLookup(QueueID => $QueueID);
 
67
 
 
68
$Self->True(
 
69
    $Queue eq $QueueRand."1",
 
70
    'QueueLookup() by ID',
 
71
);
 
72
 
 
73
my $QueueIDLookup = $Self->{QueueObject}->QueueLookup(Queue => $Queue);
 
74
 
 
75
$Self->True(
 
76
    $QueueID eq $QueueIDLookup,
 
77
    'QueueLookup() by Name',
 
78
);
 
79
 
 
80
 
 
81
1;