<commit_before># --
# IndexAccelerator.t - ticket module testscript
# Copyright (C) 2001-2014 OTRS AG, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

use strict;
use warnings;

use utf8;
use vars (qw($Self));

use Kernel::System::Ticket;

# get needed objects
my $ConfigObject = $Kernel::OM->Get('Kernel::Config');
my $UserObject   = $Kernel::OM->Get('Kernel::System::User');
my $QueueObject  = $Kernel::OM->Get('Kernel::System::Queue');

# ticket index accelerator tests
for my $Module ( 'RuntimeDB', 'StaticDB' ) {

    my $QueueID = $QueueObject->QueueLookup( Queue => 'Raw' );

    $ConfigObject->Set(
        Key   => 'Ticket::IndexModule',
        Value => "Kernel::System::Ticket::IndexAccelerator::$Module",
    );

    # create test ticket object
    my $TicketObject = Kernel::System::Ticket->new();

    my @TicketIDs;
    my $TicketID = $TicketObject->TicketCreate(
        Title        => 'Some Ticket_Title - ticket index accelerator tests',
        Queue        => 'Raw',
        Lock         => 'unlock',
        Priority     => '3 normal',
        State        => 'new',<commit_msg>Fixed unit test. The ticket object needs to be fetched from the OM to make sure it is the same as the one in the event handler modules.<commit_after># --
# IndexAccelerator.t - ticket module testscript
# Copyright (C) 2001-2014 OTRS AG, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

use strict;
use warnings;

use utf8;
use vars (qw($Self));

# ticket index accelerator tests
for my $Module ( 'RuntimeDB', 'StaticDB' ) {

    # Load all objects fresh for each loop to make sure that the TicketObject
    #   gets recreated.
    $Kernel::OM->ObjectsDiscard();

    my $ConfigObject = $Kernel::OM->Get('Kernel::Config');
    my $UserObject   = $Kernel::OM->Get('Kernel::System::User');
    my $QueueObject  = $Kernel::OM->Get('Kernel::System::Queue');

    my $QueueID = $QueueObject->QueueLookup( Queue => 'Raw' );

    $ConfigObject->Set(
        Key   => 'Ticket::IndexModule',
        Value => "Kernel::System::Ticket::IndexAccelerator::$Module",
    );

    # create test ticket object
    my $TicketObject = $Kernel::OM->Get('Kernel::System::Ticket');

    $Self->True(
        $TicketObject->isa("Kernel::System::Ticket::IndexAccelerator::$Module"),
        "TicketObject loaded the correct backend",
    );

    my @TicketIDs;
    my $TicketID = $TicketObject->TicketCreate(
        Title        => 'Some Ticket_Title - ticket index accelerator tests',
        Queue        => 'Raw',
        Lock         => 'unlock',
        Priority     => '3 normal',
        State        => 'new',
{'fraction_non_alphanumeric': 0.14709851551956815, 'fraction_numerical': 0.006747638326585695, 'mean_word_length': 3.1701828410689172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6256194', 'n_tokens_mistral': 923, 'n_tokens_neox': 885, 'n_words': 260}