MatrixBerryCore
mlunit_test_hashmapxmlmetadata.m
Go to the documentation of this file.
1 classdef mlunit_test_hashmapxmlmetadata<mxberry.core.cont.test.ADiskBasedHashMapTC
2  methods
3  function self = mlunit_test_hashmapxmlmetadata(varargin)
4  self = self@ mxberry.core.cont.test.ADiskBasedHashMapTC(varargin{:});
5  end
6  end
7  properties (MethodSetupParameter)
8  argList=mxberry.core.cont.test.createparamlist(...
10  {'verxml'},[true,false]);
11  end
12  methods (Test)
13  function self=test_putGetWithMetaData(self)
14  rel1=self.rel1;
15  rel2=self.rel2;
16  metaData1=struct('version','1.0','author','test1');
17  metaData2=struct('version','2.0','author','test2',...
18  'application','testApplication');
19  self.map=self.mapFactory.getInstance('storageBranchKey',...
20  'aaa',self.testParamList{:});
21  inpObjList={rel1,rel2};
22  keyList={'rel1','rel2'};
23  metaDataList={metaData1,metaData2};
24  self.map.put(keyList,inpObjList,metaDataList);
25  [valueObjList,metaDataGetList]=self.map.get(...
26  fliplr(keyList),'UniformOutput',false);
27  valueObjList=fliplr(valueObjList);
28  metaDataGetList=fliplr(metaDataGetList);
29  %compare values
30  isEqual=all(cellfun(@isequal,inpObjList,valueObjList));
31  self.verifyEqual(isEqual,true);
32  %compare meta data
33  isEqual=all(cellfun(@isequal,metaDataList,metaDataGetList));
34  self.verifyEqual(isEqual,true);
35  %
36  self.map.removeAll();
37  end
38  end
39 end