JML

org.multijava.util.testing
Class TestFilesCompileOnlyTestSuite

java.lang.Object
  extended byjunit.framework.TestSuite
      extended byorg.multijava.util.testing.TestSuite
          extended byorg.multijava.util.testing.TestFilesTestSuite
              extended byorg.multijava.util.testing.TestFilesCompileOnlyTestSuite
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestFilesCompileAndRunTestSuite

public class TestFilesCompileOnlyTestSuite
extends TestFilesTestSuite

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. The TestCase succeeds if If the output is empty; otherwise, it fails.

The test must be run from the directory in which it resides - because it runs external processes that are expected to be in the current directory and creates and opens files in the current directory.

Author:
David R. Cok, Yoonsik Cheon

Nested Class Summary
 class TestFilesCompileOnlyTestSuite.Helper
          This is a helper class that is actually a TestCase; it is run repeatedly with different constructor arguments.
 
Field Summary
 
Fields inherited from class org.multijava.util.testing.TestFilesTestSuite
method, ORACLE_SUFFIX, SAVED_SUFFIX, testName
 
Fields inherited from class org.multijava.util.testing.TestSuite
TEST_DESC
 
Fields inherited from class junit.framework.TestSuite
 
Constructor Summary
TestFilesCompileOnlyTestSuite(String testName, String fileOfTestFilenames, String[] args, Class cls)
          Constructs a new test suite.
 
Method Summary
protected  TestFilesTestSuite.Helper makeHelper(String testname, String[] args)
          Factory method for the helper class object.
 
Methods inherited from class org.multijava.util.testing.TestFilesTestSuite
expectedStatus
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestFilesCompileOnlyTestSuite

public TestFilesCompileOnlyTestSuite(String testName,
                                     String fileOfTestFilenames,
                                     String[] args,
                                     Class cls)
Constructs a new test suite.

Parameters:
testName - The name of the test suite
fileOfTestFilenames - The file to be read for filenames of tests
args - The command-line arguments that the static compile method will be applied to, with the filename added on
cls - The class in which to find the static compile method
Method Detail

makeHelper

protected TestFilesTestSuite.Helper makeHelper(String testname,
                                               String[] args)
Description copied from class: TestFilesTestSuite
Factory method for the helper class object.

Overrides:
makeHelper in class TestFilesTestSuite

JML

JML is Copyright (C) 1998-2002 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. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.