summaryrefslogtreecommitdiff
path: root/t/060Initialized.t
blob: 5a13e5e0ded378289431a9d690fb6a2415c0aba2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
BEGIN { 
    if($ENV{INTERNAL_DEBUG}) {
        require Log::Log4perl::InternalDebug;
        Log::Log4perl::InternalDebug->enable();
    }
}

use warnings;
use strict;

use Test::More tests => 3;

use Log::Log4perl;
use Log::Log4perl::Appender::TestBuffer;

eval {
    Log::Log4perl->init('nonexistant_file');
};

ok((not Log::Log4perl->initialized()), 'Failed init doesn\'t flag initialized');

Log::Log4perl->reset();

eval {
    Log::Log4perl->init_once('nonexistant_file');
};

ok((not Log::Log4perl->initialized()), 'Failed init_once doesn\'t flag '
                                    .'initialized');

Log::Log4perl->reset();

eval {
    Log::Log4perl->init(\ <<EOT);
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=Log::Log4perl::Appender::TestBuffer
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c - %m%n
EOT
};

ok(Log::Log4perl->initialized(), 'init flags initialized');

1; # End of 060Initialized.t