Mercurial > hg > ltpda
comparison m-toolbox/test/repo_tests/test_ao.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_ao(varargin) | |
2 % A test function to submit an AO to the repository. The AO is then | |
3 % retrieved and compared to the original one. | |
4 % | |
5 % Usage: test_ao() - connects to Hannover repository | |
6 % test_ao(conn) - connects to the repository specified by | |
7 % the database conn object. | |
8 % | |
9 % M Hewitson 24-02-08 | |
10 % | |
11 % $Id: test_ao.m,v 1.13 2008/11/14 09:51:55 hewitson Exp $ | |
12 % | |
13 | |
14 if nargin == 0 | |
15 % conn = utils.mysql.connect('130.75.117.63', 'test1'); | |
16 conn = utils.mysql.connect('130.75.117.67', 'ltpda_test'); | |
17 else | |
18 conn = varargin{1}; | |
19 end | |
20 | |
21 %% Submit a mfir | |
22 tic | |
23 p = ao(plist('waveform', 'sine wave', 'f', 1, 'phi', 0, 'nsecs', 1000, 'fs', 1)); | |
24 | |
25 sinfo.conn = conn; | |
26 sinfo.experiment_title = 'submit ao'; | |
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 = ''; | |
32 sinfo.additional_comments = 'none'; | |
33 sinfo.additional_authors = 'no one'; | |
34 | |
35 | |
36 tic | |
37 [ids, cid] = submit(p, sinfo); | |
38 toc | |
39 | |
40 %% Retrieve the object | |
41 | |
42 tic | |
43 q = ao(plist('conn', conn, 'binary', 'yes', 'id', ids )); | |
44 % q = ltpda_uo.retrieve(conn, 'binary', ids); | |
45 % q = ltpda_uo.retrieve(conn, ids); | |
46 toc | |
47 | |
48 %% Close connection | |
49 if nargin == 0 | |
50 close(conn); | |
51 end | |
52 | |
53 | |
54 %% Test | |
55 if ne(p,q(1), 'hist') | |
56 error('### ao objects are not the same.') | |
57 end |