1 classdef AConfRepoMgrVersionedTC < matlab.unittest.TestCase
2 properties (Access=
protected)
4 SDefaultEthalon=struct('firstProp','alpha','secondProp','beta');
7 methods (Access=private)
8 function self=initData(self)
11 self.cm=self.factory.getInstance();
13 SConfA=struct('confName','testConfA','alpha',0,'beta',0);
14 SConfB=struct('confName','testConfB','alpha',11,'beta',11);
16 self.cm.putConf('testConfA',SConfA,0);
17 self.cm.putConf('testConfB',SConfB,0);
22 self = self@matlab.unittest.TestCase(varargin{:});
25 properties (MethodSetupParameter, Abstract)
28 methods (TestMethodSetup)
29 function self = setUp(
self,factoryParam)
35 function aux_checkUpdate(
self,cm)
36 [SConfB,confVersionB]=cm.getConf(
'testConfB');
37 [SConfA,confVersionA]=cm.getConf(
'testConfA');
38 self.verifyEqual(2,SConfA.beta);
39 self.verifyEqual(103,confVersionA);
40 self.verifyEqual(
'testConfA',SConfA.confName);
41 self.verifyEqual(11,SConfB.beta);
42 self.verifyEqual(0,confVersionB);
43 self.verifyEqual(
'testConfB',SConfB.confName);
45 function aux_checkUpdateAll(
self,cm,isOkExp)
49 [SConfA,confVersionA]=cm.getConf(
'testConfA');
50 [SConfB,confVersionB]=cm.getConf(
'testConfB');
51 self.verifyEqual(isOkExp,isequal(2,SConfA.beta));
52 self.verifyEqual(isOkExp,isequal(103,confVersionA));
53 self.verifyEqual(
true,...
54 isequal(
'testConfA',SConfA.confName));
55 self.verifyEqual(isOkExp,...
56 isequal(2,SConfB.beta));
57 self.verifyEqual(isOkExp,...
58 isequal(103,confVersionB));
59 self.verifyEqual(
true,...
60 isequal(
'testConfB',SConfB.confName));
64 function self=test_update(
self)
65 self.cm.updateConf('testConfA');
66 self.aux_checkUpdate(self.cm);
68 function self=test_updateAll(self)
70 self.aux_checkUpdateAll(self.cm);