view testing/utp_1.1/utp_test_files/loadAllFiles.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents 409a22968d5e
children
line wrap: on
line source


clc;

matfiles = utils.prog.filescan('.', '.mat');
xmlfiles = utils.prog.filescan('.', '.xml');

currentVer = '';
currentCl  = '';

for j=1:numel(matfiles)
  fn = matfiles{j};
  [path, name, ext, ver] = fileparts(fn);
  [cl, rest] = strtok(name, '_');
  [v, rest] = strtok(rest, '_');
  if ~strcmp(v, currentVer) || ~strcmp(cl, currentCl)
    currentCl  = cl;
    currentVer = v;
    fprintf('%%%% Loading MAT files of class: %s and version: %s\n', cl, currentVer);
  end
  try
    warning('off', 'MATLAB:unknownElementsNowStruc');
    obj = feval(cl, fn);
    warning('on', 'MATLAB:unknownElementsNowStruc');
  catch err
    fprintf(2, '----- Loading %s failed. ', fn);
    fprintf(2, '%s\n', err.message);
  end
end

currentVer = '';
currentCl  = '';

for j=1:numel(xmlfiles)
  fn = xmlfiles{j};
  [path, name, ext, ver] = fileparts(fn);
  [cl, rest] = strtok(name, '_');
  [v, rest] = strtok(rest, '_');
  if ~strcmp(v, currentVer) || ~strcmp(cl, currentCl)
    currentCl  = cl;
    currentVer = v;
    fprintf('%%%% Loading XML files of class: %s and version: %s\n', cl, currentVer);
  end
  try
    obj = feval(cl, fn);
  catch err
    fprintf(2, '----- Loading %s failed. ', fn);
    fprintf(2, '%s\n', err.message)
  end
end

disp('%%%% Done.');