diff m-toolbox/classes/tests/@ltpda_utp/ltpda_utp.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/tests/@ltpda_utp/ltpda_utp.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,138 @@
+% LTPDA_UTP is the base class for ltpda unit test plan classes.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION:   LTPDA_UTP is the base class for ltpda unit
+%                test plan classes.
+%
+% SUPER CLASSES: handle
+%
+%
+% VERSION:     $Id: ltpda_utp.m,v 1.4 2011/04/27 19:44:10 ingo Exp $
+%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+classdef ltpda_utp < handle
+  
+  
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  %                            Property definition                            %
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  
+  %---------- Public (read/write) Properties  ----------
+  properties
+    testData    = []; % a place-holder for test data
+    configPlist = []; % a place-holder for a config plist
+    methodName  = ''; % method name we want to test
+    className   = ''; % class name of the method we want to test
+    testRunner  = [];
+  end
+  
+  %---------- Protected read-only Properties ----------
+  properties (SetAccess = protected)
+  end
+  
+  %---------- Private Properties ----------
+  properties (GetAccess = protected, SetAccess = protected)
+  end
+  
+  % constant properties
+  properties (Dependent = true)
+    ntests; % the number of tests in this plan
+  end
+  
+  % constant properties access methods
+  methods
+    function value = get.ntests(obj)
+      tests = obj.list_tests();
+      value = numel(tests);
+    end
+    
+  end
+  
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  %                          Check property setting                           %
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  
+  methods
+  end
+  
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  %                                Constructor                                %
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  
+  methods
+    function obj = ltpda_utp(varargin)
+      obj.startup();
+    end
+  end
+  
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  %                              Methods (public)                             %
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  
+  methods
+    
+    function startup(obj)
+      % do nothing
+    end
+    
+    function tests = list_tests(varargin)
+      utp = varargin{1};
+      tests = {};
+      mths = methods(utp);
+      for kk=1:numel(mths)
+        mth = mths{kk};
+        if strncmp(mth, 'test_', 5) && ~strcmp(mth, class(utp))
+          tests = [tests {mth}];
+        end
+      end
+    end
+    
+  end
+  
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  %                              Methods (static)                             %
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  
+  methods (Static)
+    
+    function ii = getInfo(varargin)
+      ii = utils.helper.generic_getInfo(varargin{:}, 'ltpda_utp');
+    end
+    
+    function out = VEROUT()
+      out = '$Id: ltpda_utp.m,v 1.4 2011/04/27 19:44:10 ingo Exp $';
+    end
+    
+    function out = SETS()
+      out = {};
+    end
+    
+    function out = getDefaultPlist()
+      out = [];
+    end
+    
+  end
+  
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  %                              Methods (hidden)                             %
+  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  
+  methods (Hidden = true)
+    varargout = addlistener(varargin);
+    varargout = copy(varargin);
+    varargout = delete(varargin);
+    varargout = findobj(varargin);
+    varargout = findprop(varargin);
+    varargout = ne(varargin);
+    varargout = eq(varargin);
+    varargout = ge(varargin);
+    varargout = gt(varargin);
+    varargout = le(varargin);
+    varargout = lt(varargin);
+    varargout = notify(varargin);
+  end
+  
+end
+