@@ -5,13 +5,11 @@ function TestPopulate_testPopulate(testCase)
55 disp([' ---------------' st(1 ).name ' ---------------' ]);
66 package = ' Lab' ;
77
8- c1 = dj .conn(...
9- testCase .CONN_INFO .host ,...
10- testCase .CONN_INFO .user ,...
11- testCase .CONN_INFO .password ,' ' ,true );
12-
138 dj .createSchema(package ,[testCase .test_root ' /test_schemas' ], ...
149 [testCase .PREFIX ' _lab' ]);
10+
11+ lab_schema = Lab .getSchema ; % we need schema's connection id
12+ sid = lab_schema .conn .serverId ;
1513
1614 insert(Lab .Subject , {
1715 100 , ' 2010-04-02' ;
@@ -23,33 +21,35 @@ function TestPopulate_testPopulate(testCase)
2321 ' rig_note' , ' FooLab Frobnicator v1.0' ...
2422 ));
2523
26- % regular populate of 1 record
24+ % parallel populate of 1 record
2725 % .. (SessionAnalysis logs session ID as session_analysis data)
26+ % NOTE: need to call parpopulate 1st to ensure Jobs table
27+ % exists
2828
2929 insert(Lab .Session , struct( ...
3030 ' session_id' , 0 , ...
31- ' subject_id' , 0 , ...
31+ ' subject_id' , 100 , ...
3232 ' rig_manufacturer' , ' FooLab' , ...
3333 ' rig_model' , ' 1.0' ...
3434 ));
3535
36- populate (Lab .SessionAnalysis );
36+ parpopulate (Lab .SessionAnalysis );
3737 a_result = fetch(Lab .SessionAnalysis & ' session_id = 0' , ' *' );
38- testCase .verifyEqual(a_result .session_analysis , 0 );
38+ testCase .verifyEqual(a_result .session_analysis . connection_id , sid );
3939
40- % parallel populate of 1 record
40+ % regular populate of 1 record
4141 % .. (SessionAnalysis logs jobs record as session_analysis data)
4242
4343 insert(Lab .Session , struct( ...
4444 ' session_id' , 1 , ...
45- ' subject_id' , 0 , ...
45+ ' subject_id' , 100 , ...
4646 ' rig_manufacturer' , ' FooLab' , ...
4747 ' rig_model' , ' 1.0' ...
4848 ));
4949
50- parpopulate (Lab .SessionAnalysis );
50+ populate (Lab .SessionAnalysis );
5151 a_result = fetch(Lab .SessionAnalysis & ' session_id = 1' , ' *' );
52- testCase .verifyEqual(a_result .session_analysis . connection_id , c1 . serverId );
52+ testCase .verifyEqual(a_result .session_analysis , 1 );
5353
5454 end
5555 end
0 commit comments