JML

org.multijava.util.testing
Class TestFilesTestSuite.Helper

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.multijava.util.testing.TestCase
              extended byorg.multijava.util.testing.TestFilesTestSuite.Helper
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestFilesCompileOnlyTestSuite.Helper
Enclosing class:
TestFilesTestSuite

public class TestFilesTestSuite.Helper
extends TestCase

This is a helper class that is actually a TestCase; it is run repeatedly with different constructor arguments.


Field Summary
protected  String[] args
          Command-line arguments (including filename) for this test.
protected  String fileToTest
          The name of the file to be tested.
 
Fields inherited from class org.multijava.util.testing.TestCase
NEWLINE
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestFilesTestSuite.Helper(String filename, String[] args)
          The first argument is used as the name of the test as well as the name of the file to be tested.
 
Method Summary
protected  void dotest(ByteArrayOutputStream ba)
          This is the actual test; it compiles the given file and compares its output to the expected result (in fileToTest+ORACLE_SUFFIX); the output is expected to match and the result of the compile to be true or false, depending on whether errors or warnings were reported.
 void expectedStatusReport(boolean b, String ss)
           
 void runTest()
          This is the framework around the test.
 
Methods inherited from class org.multijava.util.testing.TestCase
assertDiff, assertEquals
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileToTest

protected String fileToTest
The name of the file to be tested.


args

protected String[] args
Command-line arguments (including filename) for this test.

Constructor Detail

TestFilesTestSuite.Helper

public TestFilesTestSuite.Helper(String filename,
                                 String[] args)
The first argument is used as the name of the test as well as the name of the file to be tested.

Method Detail

runTest

public void runTest()
             throws IOException
This is the framework around the test. It sets up the streams to capture output, and catches all relevant exceptions.

Overrides:
runTest in class junit.framework.TestCase
Throws:
IOException

dotest

protected void dotest(ByteArrayOutputStream ba)
               throws IllegalAccessException,
                      IllegalArgumentException,
                      IOException,
                      InvocationTargetException
This is the actual test; it compiles the given file and compares its output to the expected result (in fileToTest+ORACLE_SUFFIX); the output is expected to match and the result of the compile to be true or false, depending on whether errors or warnings were reported. Override this method in derived tests.

Parameters:
ba - contains stuff written to the output stream in this test
Throws:
IllegalAccessException
IllegalArgumentException
IOException
InvocationTargetException

expectedStatusReport

public void expectedStatusReport(boolean b,
                                 String ss)

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.