comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % LTPDA_UTP is the base class for ltpda unit test plan classes.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: LTPDA_UTP is the base class for ltpda unit
5 % test plan classes.
6 %
7 % SUPER CLASSES: handle
8 %
9 %
10 % VERSION: $Id: ltpda_utp.m,v 1.4 2011/04/27 19:44:10 ingo Exp $
11 %
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 classdef ltpda_utp < handle
16
17
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 % Property definition %
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21
22 %---------- Public (read/write) Properties ----------
23 properties
24 testData = []; % a place-holder for test data
25 configPlist = []; % a place-holder for a config plist
26 methodName = ''; % method name we want to test
27 className = ''; % class name of the method we want to test
28 testRunner = [];
29 end
30
31 %---------- Protected read-only Properties ----------
32 properties (SetAccess = protected)
33 end
34
35 %---------- Private Properties ----------
36 properties (GetAccess = protected, SetAccess = protected)
37 end
38
39 % constant properties
40 properties (Dependent = true)
41 ntests; % the number of tests in this plan
42 end
43
44 % constant properties access methods
45 methods
46 function value = get.ntests(obj)
47 tests = obj.list_tests();
48 value = numel(tests);
49 end
50
51 end
52
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 % Check property setting %
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56
57 methods
58 end
59
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 % Constructor %
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63
64 methods
65 function obj = ltpda_utp(varargin)
66 obj.startup();
67 end
68 end
69
70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 % Methods (public) %
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73
74 methods
75
76 function startup(obj)
77 % do nothing
78 end
79
80 function tests = list_tests(varargin)
81 utp = varargin{1};
82 tests = {};
83 mths = methods(utp);
84 for kk=1:numel(mths)
85 mth = mths{kk};
86 if strncmp(mth, 'test_', 5) && ~strcmp(mth, class(utp))
87 tests = [tests {mth}];
88 end
89 end
90 end
91
92 end
93
94 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95 % Methods (static) %
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
97
98 methods (Static)
99
100 function ii = getInfo(varargin)
101 ii = utils.helper.generic_getInfo(varargin{:}, 'ltpda_utp');
102 end
103
104 function out = VEROUT()
105 out = '$Id: ltpda_utp.m,v 1.4 2011/04/27 19:44:10 ingo Exp $';
106 end
107
108 function out = SETS()
109 out = {};
110 end
111
112 function out = getDefaultPlist()
113 out = [];
114 end
115
116 end
117
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119 % Methods (hidden) %
120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121
122 methods (Hidden = true)
123 varargout = addlistener(varargin);
124 varargout = copy(varargin);
125 varargout = delete(varargin);
126 varargout = findobj(varargin);
127 varargout = findprop(varargin);
128 varargout = ne(varargin);
129 varargout = eq(varargin);
130 varargout = ge(varargin);
131 varargout = gt(varargin);
132 varargout = le(varargin);
133 varargout = lt(varargin);
134 varargout = notify(varargin);
135 end
136
137 end
138