Skip to content

Commit

Permalink
Item12023: Fix up copyright, unit tests
Browse files Browse the repository at this point in the history
Add Foswiki contributors to the copyright,  and update the unit tests
to skip all the LogDispatchContrib tests if Log::Dispatch is not
installed,  and skip the eachEvent related tests for LogDispatch if
Log4perl is not available.

git-svn-id: http://svn.foswiki.org/trunk@15310 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Aug 22, 2012
1 parent 2a36ddc commit 584b736
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions UnitTestContrib/test/unit/LoggerTests.pm
Expand Up @@ -37,6 +37,60 @@ sub tear_down {
return;
}

sub skip {
my ( $this, $test ) = @_;

return $this->SUPER::skip_test_if(
$test,
{
condition => { without_dep => 'Log::Log4perl::DateFormat' },
tests => {
'LoggerTests::verify_eachEventSinceOnEmptyLog_LogDispatchFileRollingLogger'
=> 'Missing Log::Log4perl::DateFormat',
'LoggerTests::verify_simpleWriteAndReplay_LogDispatchFileRollingLogger'
=> 'Missing Log::Log4perl::DateFormat',
}
},
{
condition => { without_dep => 'Log::Dispatch' },
tests => {
'LoggerTests::verify_eachEventSinceOnEmptyLog_LogDispatchFileLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_eachEventSinceOnSeveralLogs_LogDispatchFileLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_eachEventSinceOnSeveralLogs_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_filter_LogDispatchFileLogger' =>
'Missing Log::Dispatch',
'LoggerTests::verify_filter_LogDispatchFileRollingLogger' =>
'Missing Log::Dispatch',
'LoggerTests::verify_rotate_debug_LogDispatchFileLogger' =>
'Missing Log::Dispatch',
'LoggerTests::verify_rotate_debug_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_rotate_error_LogDispatchFileLogger' =>
'Missing Log::Dispatch',
'LoggerTests::verify_rotate_error_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_rotate_events_LogDispatchFileLogger' =>
'Missing Log::Dispatch',
'LoggerTests::verify_rotate_events_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_simpleWriteAndReplay_LogDispatchFileLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_timing_rotate_events_LogDispatchFileLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_timing_rotate_events_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_eachEventSinceOnEmptyLog_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
'LoggerTests::verify_simpleWriteAndReplay_LogDispatchFileRollingLogger'
=> 'Missing Log::Dispatch',
}
},
);
}

sub CompatibilityLogger {
my $this = shift;
require Foswiki::Logger::Compatibility;
Expand Down Expand Up @@ -88,6 +142,7 @@ sub LogDispatchFileRollingLogger {
$Foswiki::cfg{Log}{LogDispatch}{File}{Enabled} = 0;
$Foswiki::cfg{Log}{LogDispatch}{FileRolling}{Enabled} = 1;
$Foswiki::cfg{Log}{LogDispatch}{Screen}{Enabled} = 1;
$Foswiki::cfg{Log}{LogDispatch}{FileRolling}{Pattern} = '-%d{yyyy-MM}.log';
$this->{logger} = Foswiki::Logger::LogDispatch->new();

return;
Expand Down

0 comments on commit 584b736

Please sign in to comment.