From f6a50da353fcfd1cc9bc736df8df5dad1c1c9fd6 Mon Sep 17 00:00:00 2001 From: George Clark Date: Wed, 17 Dec 2014 22:40:20 -0500 Subject: [PATCH] Item12925: Restore the CacheTests for 1.2 They pass, but not sure how complete they are for the new cache code. --- UnitTestContrib/test/unit/CacheTests.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/UnitTestContrib/test/unit/CacheTests.pm b/UnitTestContrib/test/unit/CacheTests.pm index 69d03260fc..a9e71b4bfd 100644 --- a/UnitTestContrib/test/unit/CacheTests.pm +++ b/UnitTestContrib/test/unit/CacheTests.pm @@ -19,7 +19,11 @@ sub fixture_groups { my @page; foreach my $dir (@INC) { - if ( opendir( my $D, File::Spec->catdir( $dir, 'Foswiki', 'Cache' ) ) ) + if ( + opendir( + my $D, File::Spec->catdir( $dir, 'Foswiki', 'PageCache' ) + ) + ) { foreach my $alg ( readdir $D ) { next unless $alg =~ s/^(.*)\.pm$/$1/; @@ -28,18 +32,19 @@ sub fixture_groups { local $ENV{PATH} = $1; ($alg) = $alg =~ /^(.*)$/ms; - if ( eval "require Foswiki::Cache::$alg; 1;" ) { + if ( eval "require Foswiki::PageCache::$alg; 1;" ) { no strict 'refs'; *{$alg} = sub { my $this = shift; - $Foswiki::cfg{CacheManager} = 'Foswiki::Cache::' . $alg; + $Foswiki::cfg{CacheManager} = + 'Foswiki::PageCache::' . $alg; }; use strict 'refs'; push( @page, $alg ); } else { print STDERR -"Cannot test Foswiki::Cache::$alg\nCompilation error when trying to 'require' it\n"; +"Cannot test Foswiki::PageCache::$alg\nCompilation error when trying to 'require' it\n $@"; } } closedir($D); @@ -51,13 +56,13 @@ sub fixture_groups { } sub DBFileMeta { - $Foswiki::cfg{MetaCacheManager} = 'Foswiki::Cache::DB_File'; + $Foswiki::cfg{MetaCacheManager} = 'Foswiki::PageCache::DB_File'; return; } sub BDBMeta { - $Foswiki::cfg{MetaCacheManager} = 'Foswiki::Cache::BDB'; + $Foswiki::cfg{MetaCacheManager} = 'Foswiki::PageCache::BDB'; return; }