2 properties (Access=
protected)
5 methods (Access=private)
6 function self=initData(self)
8 self.cm=self.factory.getInstance();
10 clearStorageContent(self.cm);
12 self.tcm=self.cm.getTemplateRepo();
14 clearStorageContent(self.tcm);
16 self.cm=self.factory.getInstance();
17 self.tcm=self.cm.getTemplateRepo();
19 SConfA=struct('confName','testConfA','alpha',0,'beta',0);
20 SConfB=struct('confName','testConfB','alpha',11,'beta',11);
22 self.tcm.putConf('testConfA',SConfA,0);
23 self.tcm.putConf('testConfB',SConfB,0);
24 function clearStorageContent(cm)
26 storageRoot=cm.getStorageLocationRoot();
29 cm.getStorageLocationRoot(),'s');
32 'deletion of directory %s has failed :%s',...
45 properties (MethodSetupParameter)
46 factoryParam=
struct(
'adaptivever',...
49 methods (TestMethodSetup)
50 function self = setUp(
self,factoryParam)
56 function self=test_updateAll(self)
58 self.aux_checkUpdateAll(self.cm);
59 self.aux_checkUpdateAll(self.tcm);
62 function testUpdateAllBranches(self)
63 curBranchKey=self.cm.getStorageBranchKey();
64 isOk=isequal({curBranchKey},
self.cm.getBranchKeyList());
65 self.verifyTrue(isOk);
66 otherBranchKey=[curBranchKey,
'_2'];
67 templateBranchKey=
self.cm.getTemplateBranchKey();
68 storageRootDir=
self.cm.getStorageLocationRoot();
70 templateBranchKey],...
71 [storageRootDir,
filesep,otherBranchKey]);
73 templateBranchKey],...
74 [storageRootDir,
filesep,curBranchKey]);
76 check({curBranchKey,otherBranchKey});
77 check({curBranchKey,otherBranchKey},
false);
79 check({templateBranchKey,curBranchKey,otherBranchKey},
true);
81 branchKeyList={templateBranchKey,curBranchKey,otherBranchKey};
82 nBranches=numel(branchKeyList);
85 checkMaster([
true,
true,
false]);
86 self.cm.updateAll(
true);
87 checkMaster([
true,
true,
true]);
89 function checkMaster(isOkExpVec)
90 for iBranch=1:nBranches
91 curBranchKey=branchKeyList{iBranch};
92 cm=
self.factory.getInstance(
'currentBranchKey',...
94 self.aux_checkUpdateAll(cm,isOkExpVec(iBranch));
99 function check(branchList,varargin)
100 self.verifyEqual(isSuccess,
true,msgStr);
101 isOk=isequal(sort(branchList),...
102 sort(
self.cm.getBranchKeyList(varargin{:})));
103 self.verifyTrue(isOk);
106 function self=test_update(
self)
107 self.cm.deployConfTemplate('testConfA');
108 self.cm.updateConfTemplate('testConfA');
109 [SConf,confVersion,metaData]=self.tcm.getConf('testConfB');
110 self.cm.putConf('testConfB',SConf,confVersion,metaData);
112 self.aux_checkUpdate(self.cm);
113 self.aux_checkUpdate(self.tcm);
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function mkdir(in dirName)
MKDIR creates a directory recursively.
function rmdir(in dirName, in sFlag)
RMDIR removes a directory (optionally recursively)
function isdir(in dirName, in isJavaBased)
ISDIR returns true if a specified name corresponds to an existing directory.
function copyfile(in srcName, in dstName)
COPYFILE is a simplified version of the built-in function that supports long file paths on Windows (>...