Mercurial > hg > ltpda
comparison m-toolbox/test/repo_tests/test_plist.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_plist(varargin) | |
2 % A test function to submit a plist to the repository. The plist is then | |
3 % retrieved and compared to the original one. | |
4 % | |
5 % Usage: test_plist() - connects to Hannover repository | |
6 % test_plist(conn) - connects to the repository specified by | |
7 % the database conn object. | |
8 % | |
9 % M Hewitson 24-02-08 | |
10 % | |
11 % $Id: test_plist.m,v 1.7 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 parameter | |
21 p1 = param('a', 'val'); | |
22 p2 = param('b', 3); | |
23 p = plist([p1 p2]); | |
24 | |
25 sinfo.conn = conn; | |
26 sinfo.experiment_title = 'submit plist'; | |
27 sinfo.experiment_description = 'this is just a test of the whole thing'; | |
28 sinfo.analysis_description = 'just submitting'; | |
29 sinfo.quantity = 'none'; | |
30 sinfo.keywords = 'none'; | |
31 sinfo.reference_ids = [1 2 3]; | |
32 sinfo.additional_comments = 'none'; | |
33 sinfo.additional_authors = 'no one'; | |
34 | |
35 [ids, cid] = submit(p, sinfo); | |
36 | |
37 %% Retrieve the object | |
38 | |
39 q = plist(plist('conn', conn, 'cid', cid)) | |
40 | |
41 %% Close connection | |
42 if nargin == 0 | |
43 close(conn); | |
44 end | |
45 | |
46 | |
47 %% Test | |
48 | |
49 if ne(p,q,'hist') | |
50 error('### plist objects are not the same.') | |
51 end |