org.multijava.util.testing
Class TestFilesTestSuite
java.lang.Object
junit.framework.TestSuite
org.multijava.util.testing.TestSuite
org.multijava.util.testing.TestFilesTestSuite
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- TestFilesCompileOnlyTestSuite
- public class TestFilesTestSuite
- extends TestSuite
This is a JUnit TestSuite that is created from a number of tests as follows.
Each TestCase is an instance of the inner class Helper, instantiated with
a name of a file. The file names are read from the file named by the
parameter 'fileOfTestFilenames'. The argument to the constructor named
'args' provides a set of command-line arguments; the filename for the TestCase
is added on to the end of the list of command-line arguments. Then the static
compile method of the given class is called on those command-line arguments.
The standard output and error output is captured from the execution of the
compile method. This is compared to the output in filename + "-expected".
The TestCase succeeds if these match; if they do not match, the test fails and
the actual output is saved in filename + "-ckd".
The test must be run from the directory in which it resides - because
it creates and opens files in the current directory.
- Author:
- David R. Cok
|
Nested Class Summary |
class |
TestFilesTestSuite.Helper
This is a helper class that is actually a TestCase; it is run repeatedly
with different constructor arguments. |
| Fields inherited from class junit.framework.TestSuite |
|
| Methods inherited from class org.multijava.util.testing.TestSuite |
suite |
| Methods inherited from class junit.framework.TestSuite |
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, run, runTest, setName, testAt, testCount, tests, toString |
testName
protected String testName
- The name of this test suite.
method
protected Method method
- The method that is to be executed on the command-line arguments.
SAVED_SUFFIX
static final String SAVED_SUFFIX
ORACLE_SUFFIX
static final String ORACLE_SUFFIX
TestFilesTestSuite
public TestFilesTestSuite(String testName,
String fileOfTestFilenames,
String[] args,
Class cls)
- A constructor for this test suite.
- Parameters:
testName - The name of the test suitefileOfTestFilenames - The file to be read for filenames of testsargs - The command-line arguments that the static compile
method will be applied to, with the filename added oncls - The class in which to find the static compile method
makeHelper
protected TestFilesTestSuite.Helper makeHelper(String filename,
String[] args)
- Factory method for the helper class object.
expectedStatus
public boolean expectedStatus(String filename,
String ss)
mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.