# -*- coding: utf-8 -*-
# $Id$
"""
Test Manager - Database object cache.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL) only, as it comes in the "COPYING.CDDL" file of the
VirtualBox OSE distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.
You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.
"""
# Validation Kit imports.
"""
Database object cache.
This is mainly for reports and test results where we wish to get further
information on a data series or similar. The cache should reduce database
lookups as well as pyhon memory footprint.
Note! Dependecies are imported when needed to avoid potential cylic dependency issues.
"""
## @name Cache object types.
## @{
## @}
if sPeriodBack is None and cHoursBack is not None:
dict(),
);
""" Deals with database exceptions. """
raise;
#self._oDb.rollback();
#return False;
""" Gets a string from the TestResultStrTab. """
if sRet is None:
# Load cache entry.
return sRet;
""" Gets the corresponding BuildCategoryData object. """
if oRet is None:
# Load cache entry.
oRet = BuildCategoryData();
except: self._handleDbException();
return oRet;
""" Gets the corresponding TestBoxData object. """
if oRet is None:
# Load cache entry.
oRet = TestBoxData();
except: self._handleDbException();
return oRet;
""" Gets the corresponding TestCaseData object. """
if oRet is None:
# Load cache entry.
oRet = TestCaseData();
except: self._handleDbException();
return oRet;
""" Gets the corresponding TestCaseArgsData object. """
if oRet is None:
# Load cache entry.
oRet = TestCaseArgsData();
except: self._handleDbException();
return oRet;
"""
Preloads VCS revision information.
ASSUMES aiRevisions does not contain duplicate keys.
"""
if dRepo is None:
else:
aiFiltered = [];
for iRevision in aiRevisions:
'FROM VcsRevisions\n'
'WHERE sRepository = %s\n'
, ( sRepository, ));
return True;
"""
Gets the corresponding VcsRevisionData object.
May return a default (all NULLs) VcsRevisionData object if the revision
information isn't available in the database yet.
"""
if dRepo is not None:
else:
oRet = None;
if oRet is None:
if oRet is None:
oRet = VcsRevisionData();
return oRet;