view m-toolbox/classes/tests/database/@ltpda_ao_table/test_ao_mfilename.m @ 22:b11e88004fca database-connection-manager

Update collection.fromRepository
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

%
% DESCRIPTION: Tests the 'ao' table of the database.
%
% CHECKS:      - Check that the 'mfilename' isempty.
%
% VERSION:     $Id: test_ao_mfilename.m,v 1.2 2011/05/25 16:25:31 ingo Exp $
%
function varargout = test_ao_mfilename(varargin)
  
  utp = varargin{1};
  
  if ~utp.testRunner.skipRepoTests()
    
    dbTable    = 'ao';
    tableField = 'mfilename';
    
    % Check that the metadata was set with a submit PLIST
    try
      for nn = 1:numel(utp.objIds)
        
        % get 'mfilename' from the ao table
        val = utp.getTableEntry(dbTable, tableField, utp.objIds(nn));
        
        % Check that we get only one result for the query
        assert(numel(val)==1)
        
        % Check that the entry in the table is the same as the desrciption
        % of the test data
        assert(isempty(val{1}))
        
      end
    catch Me
      throw(Me);
    end
    
    varargout{1} = sprintf('Test the field ''%s'' of the database table ''%s'' with the database %s ', tableField, dbTable, utp.testRunner.repositoryPlist.find('database'));
  else
    varargout{1} = 'Skip database test';
  end
end