MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
Type of Method Test Class Level Falls Within Scope of runTestClass
run method runTest
teardown method teardownTestClass

At this level, the createTestClassInstance method is the only plugin method with an
output argument. It returns the TestCase instances created at the class level. For each
class, the test framework passes the instance into any methods with the
TestClassSetup or TestClassTeardown attribute.


A test class setup is parameterized if it contains properties with the
ClassSetupParameter attribute. In this case, the test framework evaluates the
setupTestClass and teardownTestClass methods as many times as the class setup
parameterization dictates.


The run method at this level, runTest, extends the running of a single TestSuite
element, and incorporates the functionality described for the test level plugin methods.


The test framework evaluates methods at the test class level within the scope of the
runTestClass method. If TestClassSetup completes successfully, it invokes the
runTest method one time for each element in the Test array. Each TestClassSetup
parameterization invokes the creation, setup, and teardown methods a single time.


Extending Test Suite Level Plugin Methods


The TestRunnerPlugin methods at the test suite level extend the creation, setup, run,
and teardown of shared test fixtures. These methods fall within the scope of
runTestSuite.


Type of Method Test Level Falls Within Scope of runTestSuite
creation method createSharedTestFixture
setup method setupSharedTestFixture
run method runTestClass
teardown method teardownSharedTestFixture

At this level, the createSharedTestFixture method is the only plugin method with an
output argument. It returns the Fixture instances for each shared fixture required by a
test class. These fixture instances are available to the test through the
getSharedTestFixtures method of TestCase.


Write Plugins to Extend TestRunner
Free download pdf