comparison m-toolbox/test/repo_tests/test_mfir.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function test_mfir(varargin)
2 % A test function to submit an mfir to the repository. The mfir is then
3 % retrieved and compared to the original one.
4 %
5 % Usage: test_mfir() - connects to Hannover repository
6 % test_mfir(conn) - connects to the repository specified by
7 % the database conn object.
8 %
9 % M Hewitson 24-02-08
10 %
11 % $Id: test_mfir.m,v 1.8 2008/11/14 09:51:55 hewitson Exp $
12 %
13
14 if nargin == 0
15 conn = utils.mysql.connect('130.75.117.67', 'ltpda_test');
16 else
17 conn = varargin{1};
18 end
19
20 %% Submit a mfir
21 p = mfir(plist);
22
23 sinfo.conn = conn;
24 sinfo.experiment_title = 'submit mfir';
25 sinfo.experiment_description = 'this is just a test of the whole thing';
26 sinfo.analysis_description = 'just submitting';
27 sinfo.quantity = 'none';
28 sinfo.keywords = 'none';
29 sinfo.reference_ids = '1, 3';
30 sinfo.additional_comments = 'none';
31 sinfo.additional_authors = 'no one';
32
33 [ids, cid] = submit(p, sinfo);
34
35 %% Close connection
36 if nargin == 0
37 close(conn);
38 end
39
40 %% Retrieve the object
41
42 q = mfir(plist('conn', conn, 'cid', cid))
43
44
45 %% Test
46
47 if ne(p,q, 'hist')
48 error('### mfir objects are not the same.')
49 end