Mercurial > hg > ltpda
diff m-toolbox/classes/tests/database/@ltpda_database/ltpda_database.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children | 79dc7091dbbc |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/tests/database/@ltpda_database/ltpda_database.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,65 @@ +classdef ltpda_database < ltpda_utp + + properties + objIds = []; + sinfoPlist = []; + conn = []; + end + + methods + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Constructor % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + function utp = ltpda_database(varargin) + utp = utp@ltpda_utp(); + + t = time(); + tStr = t.format('dd-mmm-yyyy HH:MM (z)'); + + experiment_title = 'Unit test - My experiment title'; + experiment_description = 'Unit test - My experiment description'; + analysis_description = 'Unit test - My analysis description'; + quantity = 'Unit test - My quantity'; + keywords = 'Unit test - My keywords'; + reference_ids = 'Unit test - My reference IDs'; + additional_comments = 'Unit test - My additional comments'; + additional_authors = 'Unit test - My additional authors'; + + plSinfo = plist(... + 'experiment_title', sprintf('%s with a PLIST - %s', experiment_title, tStr), ... + 'experiment_description', sprintf('%s with a PLIST - %s', experiment_description, tStr), ... + 'analysis_description', sprintf('%s with a PLIST - %s', analysis_description, tStr), ... + 'quantity', sprintf('%s with a PLIST - %s', quantity, tStr), ... + 'keywords', sprintf('%s with a PLIST - %s', keywords, tStr), ... + 'reference_ids', sprintf('%s with a PLIST - %s', reference_ids, tStr), ... + 'additional_comments', sprintf('%s with a PLIST - %s', additional_comments, tStr), ... + 'additional_authors', sprintf('%s with a PLIST - %s', additional_authors, tStr)); + + utp.sinfoPlist = plSinfo; + end + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Destructor % + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + function delete(varargin) + utp = varargin{1}; + % Make sure that we remove the connection from the object and that it + % is not locked. + if isa(utp.conn, 'mpipeline.repository.RepositoryConnection') + utp.conn.setLocked(false); + end + utp.conn = []; + end + end + + methods + function varargout = submitTestData(varargin) + utp = varargin{1}; + if ~utp.testRunner.skipRepoTests() + utp.objIds = utp.testData.submit(utp.testRunner.repositoryPlist, utp.sinfoPlist); + end + end + end + +end