/* Copyright (c) 1998-2005 The Regents of the University of California All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY */ package diva.util.jester; /** * The abstract superclass of test suites. A test suite * runs tests on one or a set of objects. Test suites * generally do not follow the class hierarchy in any way, * but inherit directly from this class. Here is a brief * description -- for more details and tutorial examples, * see the package documentation. * * In order to make it possible for test suites to be run * on objects of different classes -- such as subclasses * or objects that implement interfaces -- all object creation * should be parameterized by providing factory objects. * Factory object can be a unit factory, in which case they * provide (by convention) one version of the method create * for each constructor, or a collaboration factory, in * which case each role played in the collaboration has * one or more version of a createRole method. * * In the case of unit factories, the factory inheritance * hierarchy mimics the class hierarchy. In the case of * collaboration factories, factories that create more specific * classes tend should inherit from the more general factories, * but the inheritance is less structured because there may * be multiple subclasses. * * In general, a test suite contains: * *
* getTestHarness().runTestCase(testCase) **/ public void runTestCase(TestCase testCase) { _testHarness.runTestCase(testCase); } /** * Set the test harness used by this test suite. */ public void setTestHarness(TestHarness h) { _testHarness = h; } /** * Get the test harness used by this test suite. */ public TestHarness getTestHarness() { return _testHarness; } /** * Set the factory used by this test suite. This can be * any object, but the test output will make most sense if * it is an object used to produce the object or objects * being tested, and that has a descriptive toString() * method. */ public void setFactory(Object f) { _factory = f; } /** * Get the factory used by this test suite. */ public Object getFactory() { return _factory; } }