[otrs-cvs] otrs/scripts/test/ProcessManagement Process.t,1.7,1.8

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/scripts/test/ProcessManagement
In directory lancelot:/tmp/cvs-serv28561/scripts/test/ProcessManagement

Modified Files:
	Process.t 
Log Message:
Changed hard coded queues to dynamic to make it work on SaaS environments.

Author: cr

Index: Process.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/ProcessManagement/Process.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -2 -u -d -r1.7 -r1.8
--- Process.t	20 Nov 2012 16:11:04 -0000	1.7
+++ Process.t	7 Dec 2012 20:13:52 -0000	1.8
@@ -17,4 +17,5 @@
 use Kernel::Config;
 use Kernel::System::UnitTest::Helper;
+use Kernel::System::Queue;
 use Kernel::System::ProcessManagement::Activity;
 use Kernel::System::ProcessManagement::Process;
@@ -26,4 +27,10 @@
 
 # create local objects
+my $HelperObject = Kernel::System::UnitTest::Helper->new(
+    UnitTestObject => $Self,
+    %{$Self},
+    RestoreSystemConfiguration => 0,
+);
+
 my $ConfigObject = Kernel::Config->new();
 
@@ -52,8 +59,75 @@
     TransitionActionObject => $TransitionActionObject,
 );
+my $QueueObject = Kernel::System::Queue->new(
+    %{$Self},
+    ConfigObject => $ConfigObject,
+);
+
+my $RandomID = $HelperObject->GetRandomID();
+
+# create some queues in the system
+my %QueueData1 = (
+    Name            => 'Queue1' . $RandomID,
+    ValidID         => 1,
+    GroupID         => 1,
+    SystemAddressID => 1,
+    SalutationID    => 1,
+    SignatureID     => 1,
+    Comment         => 'Some comment',
+    UserID          => 1,
+);
+
+my %QueueData2 = (
+    Name            => 'Queue2' . $RandomID,
+    ValidID         => 1,
+    GroupID         => 1,
+    SystemAddressID => 1,
+    SalutationID    => 1,
+    SignatureID     => 1,
+    Comment         => 'Some comment',
+    UserID          => 1,
+);
+
+my %QueueData3 = (
+    Name            => 'Queue3' . $RandomID,
+    ValidID         => 1,
+    GroupID         => 1,
+    SystemAddressID => 1,
+    SalutationID    => 1,
+    SignatureID     => 1,
+    Comment         => 'Some comment',
+    UserID          => 1,
+);
+
+my $QueueID1 = $QueueObject->QueueAdd(%QueueData1);
+
+# sanity check
+$Self->IsNot(
+    $QueueID1,
+    undef,
+    "QueueAdd() - Added queue '$QueueData1{Name}' for ACL check - should not be undef"
+);
+
+my $QueueID2 = $QueueObject->QueueAdd(%QueueData2);
+
+# sanity check
+$Self->IsNot(
+    $QueueID2,
+    undef,
+    "QueueAdd() - Added queue '$QueueData2{Name}' for ACL check - should not be undef"
+);
+
+my $QueueID3 = $QueueObject->QueueAdd(%QueueData3);
+
+# sanity check
+$Self->IsNot(
+    $QueueID3,
+    undef,
+    "QueueAdd() - Added queue '$QueueData3{Name}' for ACL check - should not be undef"
+);
 
 my $TicketID = $TicketObject->TicketCreate(
     Title    => 'Process Unittest Testticket',
-    Queue    => 'Raw',                           # or QueueID => 123,
+    Queue    => $QueueData3{Name},               # or QueueID => 123,
     Lock     => 'unlock',
     Priority => '3 normal',                      # or PriorityID => 2,
@@ -1369,5 +1443,5 @@
 
   # Transition + QueueMove TransitionAction on matching Transition change ActivityEntityID on Ticket
-  # and move it to Queue Misc
+  # and move it to Queue1
     {
         ProcessTransition => {
@@ -1478,5 +1552,5 @@
                         Module => 'Kernel::System::ProcessManagement::TransitionAction::QueueMove',
                         Config => {
-                            TargetQueue => 'Misc',
+                            TargetQueue => $QueueData1{Name},
                         },
 
@@ -1486,5 +1560,5 @@
                         Module => 'Kernel::System::ProcessManagement::TransitionAction::QueueMove',
                         Config => {
-                            TargetQueue => 'Junk',
+                            TargetQueue => $QueueData2{Name},
                         },
 
@@ -1494,5 +1568,5 @@
                         Module => 'Kernel::System::ProcessManagement::TransitionAction::QueueMove',
                         Config => {
-                            TargetQueue => 'Raw',
+                            TargetQueue => $QueueData3{Name},
                         },
 
@@ -1512,5 +1586,5 @@
 
 # Transition + QueueMove TransitionAction on matching Transition change ActivityEntityID on Ticket 1
-# back to A1 and move it back to Raw Queue
+# back to A1 and move it back to Queue3
     {
         ProcessTransition => {
@@ -1639,5 +1713,5 @@
                         Module => 'Kernel::System::ProcessManagement::TransitionAction::QueueMove',
                         Config => {
-                            TargetQueue => 'Misc',
+                            TargetQueue => $QueueData1{Name},
                         },
 
@@ -1647,5 +1721,5 @@
                         Module => 'Kernel::System::ProcessManagement::TransitionAction::QueueMove',
                         Config => {
-                            TargetQueue => 'Junk',
+                            TargetQueue => $QueueData2{Name},
                         },
 
@@ -1655,5 +1729,5 @@
                         Module => 'Kernel::System::ProcessManagement::TransitionAction::QueueMove',
                         Config => {
-                            TargetQueue => 'Raw',
+                            TargetQueue => $QueueData3{Name},
                         },
 
@@ -2090,4 +2164,41 @@
 }
 
+# queue
+my $Success = $QueueObject->QueueUpdate(
+    %QueueData1,
+    QueueID    => $QueueID1,
+    FollowUpID => 1,
+    ValidID    => 2,
+);
+
+$Self->True(
+    $Success,
+    "QueueUpdate() - Invalidate queue '$QueueData1{Name}' for ACL check."
+);
+
+$Success = $QueueObject->QueueUpdate(
+    %QueueData2,
+    QueueID    => $QueueID2,
+    FollowUpID => 1,
+    ValidID    => 2,
+);
+
+$Self->True(
+    $Success,
+    "QueueUpdate() - Invalidate queue '$QueueData2{Name}' for ACL check."
+);
+
+$Success = $QueueObject->QueueUpdate(
+    %QueueData2,
+    QueueID    => $QueueID2,
+    FollowUpID => 1,
+    ValidID    => 2,
+);
+
+$Self->True(
+    $Success,
+    "QueueUpdate() - Invalidate queue '$QueueData3{Name}' for ACL check."
+);
+
 if ($TicketID) {
     my $Success = $TicketObject->TicketDelete(
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.