git clone of logicmail with some fixes/features added
at master 51 lines 2.2 kB view raw
1//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2// This file is part of J2MEUnit, a Java 2 Micro Edition unit testing framework. 3// 4// J2MEUnit is free software distributed under the Common Public License (CPL). 5// It may be redistributed and/or modified under the terms of the CPL. You 6// should have received a copy of the license along with J2MEUnit. It is also 7// available from the website of the Open Source Initiative at 8// http://www.opensource.org. 9// 10// J2MEUnit is distributed in the hope that it will be useful, but WITHOUT ANY 11// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12// FOR A PARTICULAR PURPOSE. 13//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 14package j2meunit.framework; 15 16/***************************************************************************** 17 * A <em>Test</em> can be run and collect its results. 18 * 19 * @see TestResult 20 */ 21public interface Test 22{ 23 //~ Methods ---------------------------------------------------------------- 24 25 /*************************************** 26 * Counts the number of test cases that will be run by this test. 27 * 28 * @return The number of test cases 29 */ 30 public abstract int countTestCases(); 31 32 /*************************************** 33 * Counts the number of test steps that will be run by this test. Test steps 34 * are distinct parts of a test that shall be monitored separately. This can 35 * be used to show the progress of large tests that take a large amount of 36 * time (e.g. storage access or encryption). Each test step then needs to 37 * invoke TestCase.testStepFinished() after it ran successfully. 38 * 39 * For short tests this method should return the same value as 40 * countTestCases(). For long tests the return value should include the 41 * result of countTestCases() because completed tests are counted too. 42 * 43 * @return The number of test steps 44 */ 45 public abstract int countTestSteps(); 46 47 /*************************************** 48 * Runs a test and collects its result in a TestResult instance. 49 */ 50 public abstract void run(TestResult result); 51}