Mercurial > hg > ltpda
comparison m-toolbox/test/repo_tests/test_pzmodel.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_pzmodel(varargin) | |
2 % A test function to submit a pzmodel to the repository. The pzmodel is then | |
3 % retrieved and compared to the original one. | |
4 % | |
5 % Usage: test_pzmodel() - connects to Hannover repository | |
6 % test_pzmodel(conn) - connects to the repository specified by | |
7 % the database conn object. | |
8 % | |
9 % M Hewitson 24-02-08 | |
10 % | |
11 % $Id: test_pzmodel.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.63', 'newdb1'); | |
16 else | |
17 conn = varargin{1}; | |
18 end | |
19 | |
20 %% Submit a timeformat | |
21 p = pzmodel(1, [pz(1) pz(2,10)], [pz(4.3)]); | |
22 | |
23 sinfo.conn = conn; | |
24 sinfo.experiment_title = 'submit pzmodel'; | |
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 2 32]; | |
30 sinfo.additional_comments = 'none'; | |
31 sinfo.additional_authors = 'no one'; | |
32 | |
33 | |
34 [ids, cid] = submit(p, sinfo); | |
35 | |
36 %% Retrieve the object | |
37 | |
38 | |
39 q = pzmodel(plist('conn', conn, 'cid', cid)) | |
40 | |
41 | |
42 %% Close connection | |
43 if nargin == 0 | |
44 close(conn); | |
45 end | |
46 | |
47 %% Test | |
48 | |
49 if ne(p,q,'hist') | |
50 error('### pzmodel objects are not the same.') | |
51 end |