diff --git a/products/+elltool/+core/+test/+mlunit/EllipsoidBasicSecondTC.m b/products/+elltool/+core/+test/+mlunit/EllipsoidBasicSecondTC.m index fc3336c3..17d203d3 100644 --- a/products/+elltool/+core/+test/+mlunit/EllipsoidBasicSecondTC.m +++ b/products/+elltool/+core/+test/+mlunit/EllipsoidBasicSecondTC.m @@ -535,21 +535,19 @@ function checkScalGRBBF() 'wrongInput:wrongSizes'); end function self = testDisplay(self) - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); ellEmptArr = self.ellipsoid.empty([0,0,2,0]); %#ok - logger.info(evalc('display(ellEmptArr)')); + evalc('display(ellEmptArr)'); % centVec = [1;1]; shapeMat = eye(2); ellObj = self.ellipsoid(centVec,shapeMat); - logger.info(evalc('display(ellObj)')); + evalc('display(ellObj)'); % ellMat = ellObj.repMat([2,2]); %#ok - logger.info(evalc('display(ellMat)')); + evalc('display(ellMat)'); % ellArr = ellObj.repMat([2,2,3,4,5]); %#ok - logger.info(evalc('display(ellArr)')); + evalc('display(ellArr)'); end function self = testProjection(self) projMat = [1 0 0;0 1 0]'; diff --git a/products/+elltool/+core/+test/+mlunit/GenEllipsoidTestCase.m b/products/+elltool/+core/+test/+mlunit/GenEllipsoidTestCase.m index 4a3c5323..79b5bd8e 100644 --- a/products/+elltool/+core/+test/+mlunit/GenEllipsoidTestCase.m +++ b/products/+elltool/+core/+test/+mlunit/GenEllipsoidTestCase.m @@ -28,13 +28,11 @@ function set_up_param(self) end % function testDisplaySimple(~) - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); ell1=elltool.core.GenEllipsoid([1;1],eye(2)); ell2=elltool.core.GenEllipsoid([1;0],eye(2)); ell3=elltool.core.GenEllipsoid([0;1],eye(2)); ellMat=[ell1,ell2,ell3;ell1,ell2,ell3]; %#ok - logger.info(evalc('display(ellMat)')); + evalc('display(ellMat)'); end % function self = testConstructor(self) diff --git a/products/+elltool/+core/+test/+mlunit/HyperplaneTestCase.m b/products/+elltool/+core/+test/+mlunit/HyperplaneTestCase.m index 5e36a787..83a9bf84 100644 --- a/products/+elltool/+core/+test/+mlunit/HyperplaneTestCase.m +++ b/products/+elltool/+core/+test/+mlunit/HyperplaneTestCase.m @@ -275,13 +275,11 @@ function tear_down(~) end % function self = testDisplay(self) - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); SInpData = self.auxReadFile(self); testHyperplane = SInpData.testHyperplane; %#ok - logger.info(evalc('display(testHyperplane);')); + evalc('display(testHyperplane);'); testHyperplaneVec = SInpData.testHyperplaneVec; %#ok - logger.info(evalc('display(testHyperplaneVec);')); + evalc('display(testHyperplaneVec);'); end % % function self = testPlot(self) diff --git a/products/+elltool/+demo/+test/+mlunit/ETManualTC.m b/products/+elltool/+demo/+test/+mlunit/ETManualTC.m index 46f24db6..abb4167a 100644 --- a/products/+elltool/+demo/+test/+mlunit/ETManualTC.m +++ b/products/+elltool/+demo/+test/+mlunit/ETManualTC.m @@ -24,6 +24,8 @@ function tear_down(self) end % function self = testBasic(self) + import elltool.logging.Log4jConfigurator; + logger=Log4jConfigurator.getLogger(); currentDir = fileparts(which(mfilename('class'))); rootDir = modgen.path.rmlastnpathparts(currentDir, 5); snippetsDir = [rootDir, filesep, 'products', filesep,... @@ -42,8 +44,6 @@ function tear_down(self) end end if ~isBad - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); [~, fileName] = fileparts(nameStr); logger.info(evalc(['elltool.doc.snip.' fileName])); end diff --git a/products/+elltool/+linsys/+test/+mlunit/LinSysTestCase.m b/products/+elltool/+linsys/+test/+mlunit/LinSysTestCase.m index 69a782bc..3591e5c1 100644 --- a/products/+elltool/+linsys/+test/+mlunit/LinSysTestCase.m +++ b/products/+elltool/+linsys/+test/+mlunit/LinSysTestCase.m @@ -197,7 +197,6 @@ function set_up_param(self) {'t', '1', 'cos(t)'; '1' '0' 't'; 'sin(t)', 't', '2'}, ... {'t', 'cos(t)'; 'sin(t)', 't'; 'cos(t)', 'sin(t)'}, ... UEll, eye(3,5),ell_unitball(5),eye(2,3),ell_unitball(2)); - %evalc('system.display();'); resStr = evalc('display(system)'); isOk = ~isempty(strfind(resStr,'A')); isOk = ~isempty(strfind(resStr,'B')) && isOk; diff --git a/products/+elltool/+reach/+test/+mlunit/ContinuousReachRegTestCase.m b/products/+elltool/+reach/+test/+mlunit/ContinuousReachRegTestCase.m index d429d80d..0e6e8da4 100644 --- a/products/+elltool/+reach/+test/+mlunit/ContinuousReachRegTestCase.m +++ b/products/+elltool/+reach/+test/+mlunit/ContinuousReachRegTestCase.m @@ -160,9 +160,7 @@ function check(isRegEnabled,isJustCheck,regTol,expErrTag,isNeg) if isNeg self.runAndCheckError(evalStr,expErrTag); else - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); - logger.info(evalc(evalStr)); + evalc(evalStr); end end end diff --git a/products/+elltool/+reach/+test/+mlunit/DiscreteReachFirstTestCase.m b/products/+elltool/+reach/+test/+mlunit/DiscreteReachFirstTestCase.m index 36374d75..4b0f9e00 100644 --- a/products/+elltool/+reach/+test/+mlunit/DiscreteReachFirstTestCase.m +++ b/products/+elltool/+reach/+test/+mlunit/DiscreteReachFirstTestCase.m @@ -29,8 +29,6 @@ function set_up_param(self, varargin) end % function self = testFirstBasicTest(self) - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); loadFileStr = strcat(self.testDataRootDir,... '/demo3DiscreteTest.mat'); load(loadFileStr, 'aMat', 'bMat', 'ControlBounds',... @@ -40,7 +38,7 @@ function set_up_param(self, varargin) %timeVec = [0, 3]; reachSetObj = self.reachDiscrete(linSysObj,... x0Ell, l0Mat, timeVec); - logger.info(evalc('reachSetObj.display();')); + evalc('reachSetObj.display();'); firstCutReachObj =... reachSetObj.cut([timeVec(1)+1 timeVec(end)-1]); [~] = reachSetObj.cut(timeVec(1)+2); @@ -66,8 +64,6 @@ function set_up_param(self, varargin) end % function self = testSecondBasicTest(self) - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); loadFileStr = strcat(self.testDataRootDir,... '/distorbDiscreteTest.mat'); load(loadFileStr, 'aMat', 'bMat', 'ControlBounds',... @@ -76,7 +72,7 @@ function set_up_param(self, varargin) ControlBounds, gMat, DistorbBounds,'d'); reachSetObj = self.reachDiscrete(linSysObj,... x0Ell, l0Mat, timeVec); - logger.info(evalc('reachSetObj.display();')); + evalc('reachSetObj.display();'); firstCutReachObj =... reachSetObj.cut([timeVec(1)+1 timeVec(end)-1]); [~] = reachSetObj.cut(timeVec(1)+2); diff --git a/products/+gras/+ellapx/+smartdb/+test/+mlunit/ExamplesTC.m b/products/+gras/+ellapx/+smartdb/+test/+mlunit/ExamplesTC.m index 1b3deb45..3d2f53f7 100644 --- a/products/+gras/+ellapx/+smartdb/+test/+mlunit/ExamplesTC.m +++ b/products/+gras/+ellapx/+smartdb/+test/+mlunit/ExamplesTC.m @@ -22,11 +22,9 @@ function test_examples(~) nExamples=numel(exampleNameList); for iExample=1:nExamples try - import elltool.logging.Log4jConfigurator; - logger=Log4jConfigurator.getLogger(); exampleName=[examplePkgName,'.',... - exampleNameList{iExample}(1:end-2)]; - logger.info(evalc(exampleName)); + exampleNameList{iExample}(1:end-2)]; + evalc(exampleName); catch meObj newMeObj=throwerror('testRunProblem','failed to run %s',... exampleName'); diff --git a/products/+gras/+ellapx/+smartdb/+test/+mlunit/SuiteEllTube.m b/products/+gras/+ellapx/+smartdb/+test/+mlunit/SuiteEllTube.m index 1f3d68a2..b122c79c 100644 --- a/products/+gras/+ellapx/+smartdb/+test/+mlunit/SuiteEllTube.m +++ b/products/+gras/+ellapx/+smartdb/+test/+mlunit/SuiteEllTube.m @@ -319,12 +319,14 @@ function checkMaster(fGetScaleAndReg) end %% function check(errorTag,cmdStr) + import elltool.logging.Log4jConfigurator; + logger=Log4jConfigurator.getLogger(); CMD_STR='rel1.getCopy().unionWith(rel2)'; if nargin<2 cmdStr=CMD_STR; end - if nargin==0 - eval(cmdStr); + if nargin==0 + logger.info(evalc(cmdStr)); else self.runAndCheckError(cmdStr,errorTag); end @@ -483,13 +485,15 @@ function testSimpleNegRegCreate(self) approxSchemaDescr,ABS_TOL, REL_TOL); end function check(errorTag,cmdStr) + import elltool.logging.Log4jConfigurator; + logger=Log4jConfigurator.getLogger(); CMD_STR='rel1.getCopy().unionWith(rel2)'; if nargin<2 cmdStr=CMD_STR; end if nargin==0 if ischar(cmdStr) - eval(cmdStr); + logger.info(evalc(cmdStr)); else feval(cmdStr); end @@ -747,6 +751,8 @@ function badAction() end end function aux_testSimpleCreate(self,isApproxSchemaUniform) + import elltool.logging.Log4jConfigurator; + logger=Log4jConfigurator.getLogger(); nPoints=3; ABS_TOL = 10^(-3); REL_TOL = 10^(-3); @@ -781,7 +787,7 @@ function aux_testSimpleCreate(self,isApproxSchemaUniform) function check(errorTag) CMD_STR='rel1.getCopy().unionWith(rel2)'; if nargin==0 - eval(CMD_STR); + logger.info(evalc(CMD_STR)); else self.runAndCheckError(CMD_STR,... errorTag); diff --git a/products/+gras/+ellapx/+smartdb/+util/updateondiskrels.m b/products/+gras/+ellapx/+smartdb/+util/updateondiskrels.m index e376466f..204c5c75 100644 --- a/products/+gras/+ellapx/+smartdb/+util/updateondiskrels.m +++ b/products/+gras/+ellapx/+smartdb/+util/updateondiskrels.m @@ -14,6 +14,8 @@ function updateondiskrels(dirName) % Faculty of Computational Mathematics and Computer Science, % System Analysis Department 2015 $ % +import elltool.logging.Log4jConfigurator; +logger=Log4jConfigurator.getLogger(); if ~strcmp(dirName(end),filesep) dirName=[dirName,filesep]; end @@ -27,7 +29,7 @@ function updateondiskrels(dirName) nVars=numel(varNameList); for iVar=1:nVars varName=varNameList{iVar}; - eval([varName,'=SRes.',varName,';']); + logger.info(evalc([varName,'=SRes.',varName,';'])); end save(fullFileName,varNameList{:}); end \ No newline at end of file