Add method to clean up test sessions. This has to be done

after ALL other types of objects have been cleaned up.
More test clean-up for users, groups and sessions.
This commit is contained in:
Colin Kuskie 2009-05-01 02:02:12 +00:00
parent d7f2aca1e4
commit 004b8095a1
5 changed files with 47 additions and 33 deletions

View file

@ -54,6 +54,7 @@ my $originalSetting;
my @groupsToDelete;
my @usersToDelete;
my @sessionsToDelete;
my @storagesToDelete;
BEGIN {
@ -157,6 +158,10 @@ END {
$stor->delete;
}
}
SESSION: foreach my $session (@sessionsToDelete) {
$session->var->end;
$session->close;
}
if ($ENV{WEBGUI_TEST_DEBUG}) {
$Test->diag('Sessions: '.$SESSION->db->quickScalar('select count(*) from userSession'));
$Test->diag('Scratch : '.$SESSION->db->quickScalar('select count(*) from userSessionScratch'));
@ -437,6 +442,23 @@ sub storagesToDelete {
#----------------------------------------------------------------------------
=head2 sessionsToDelete ( $session, [$session, ...] )
Push a list of session objects onto the stack of groups to be automatically deleted
at the end of the test. Note, this will be the last group of objects to be
cleaned up.
This is a class method.
=cut
sub sessionsToDelete {
my $class = shift;
push @sessionsToDelete, @_;
}
#----------------------------------------------------------------------------
=head2 usersToDelete ( $user, [$user, ...] )
Push a list of user objects onto the stack of groups to be automatically deleted