|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.multijava.util.testing.TestCase
org.multijava.mjc.FunctionalTestSuite.TestCase
| Nested Class Summary | |
protected static class |
FunctionalTestSuite.TestCase.CodeGenResults
Represents the results of disassembling, including a success flag and any error messages. |
protected static class |
FunctionalTestSuite.TestCase.CompilationResults
A string representation of the working directory, used in matching expected error messages. |
protected static class |
FunctionalTestSuite.TestCase.Processor
|
protected static class |
FunctionalTestSuite.TestCase.RuntimeResults
Represents the results of a runtime test, including a success flag, any exception thrown and the values written to standard error and standard out. |
| Field Summary | |
private static FilenameFilter |
CLASS_FILE_FILTER
Used by cleanWorkingDir(). |
private static String |
CLASS_PATH_PROP
|
private static Object[] |
EMPTY_ARRAY
|
private ArrayList |
splitCache
Used by split() to split strings into words. |
private static Class[] |
STRING_ARRAY
|
private static FileFilter |
SUBDIR_FILTER
Used by cleanWorkingDir(). |
private ClassLoader |
tempLoader
|
private static String |
WORKING_DIR_PROP
|
protected File |
workingDir
The temporary working directory. |
| Fields inherited from class org.multijava.util.testing.TestCase |
NEWLINE |
| Fields inherited from class junit.framework.TestCase |
|
| Constructor Summary | |
FunctionalTestSuite.TestCase(String name)
|
|
| Method Summary | |
private OutputStream[] |
captureStreams()
Establishes new output streams to capture text written to standard out and standard error. |
protected void |
cleanWorkingDir()
Deletes all *.class files in workingDir and its subdirectories. |
protected FunctionalTestSuite.TestCase.CompilationResults |
compile(String cmdLine)
Invokes the compiler, passing it the given command line. |
protected FunctionalTestSuite.TestCase.CodeGenResults |
disasm(String className,
boolean details)
Disassembles the class with the given name. |
protected void |
expectFailure(FunctionalTestSuite.TestCase.CompilationResults results,
String expectedError)
Called with the result of compilation when failure (i.e., compilation error) is expected, this generates the appropriate assertion and message. |
protected void |
expectSuccess(FunctionalTestSuite.TestCase.CompilationResults results)
Called with the result of compilation or runtime when success is expected, this generates the appropriate assertion and message. |
protected boolean |
invokeCompiler(String[] args)
|
private void |
releaseStreams(OutputStream[] streams)
Reverses the action for captureStreams(). |
protected void |
remove(String fileNames)
Deletes files of the given names from the current directory. |
private void |
resetWorkingDir(String[] old)
Resets the working directory and class path based on the argument array returned by setWorkingDir(). |
protected FunctionalTestSuite.TestCase.RuntimeResults |
run(String className)
Tests the class with the given name. |
protected String |
saveAs(String fileName,
String contents)
Creates a file in the temporary directory with the given name and contents. |
void |
setUp()
This is a hack to blast all the *.class files out of the temp directory. |
private String[] |
setWorkingDir()
Establishes a new working directory and class path and returns an array containing the old values. |
protected String[] |
split(String text)
Splits the given text into an array of words separated by whitespace. |
void |
tearDown()
This is a hack to blast all the *.class files out of the temp directory. |
| Methods inherited from class org.multijava.util.testing.TestCase |
assertDiff, assertEquals |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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 |
private static final FilenameFilter CLASS_FILE_FILTER
cleanWorkingDir().
private static final FileFilter SUBDIR_FILTER
cleanWorkingDir().
private static final String WORKING_DIR_PROP
private static final String CLASS_PATH_PROP
private ArrayList splitCache
split( String )protected final File workingDir
private static Object[] EMPTY_ARRAY
private static Class[] STRING_ARRAY
private ClassLoader tempLoader
| Constructor Detail |
public FunctionalTestSuite.TestCase(String name)
| Method Detail |
public void setUp()
setUp in class junit.framework.TestCasepublic void tearDown()
tearDown in class junit.framework.TestCaseprotected final void cleanWorkingDir()
protected String saveAs(String fileName,
String contents)
protected void remove(String fileNames)
fileNames - a space delimited list of file namesprotected FunctionalTestSuite.TestCase.CompilationResults compile(String cmdLine)
protected boolean invokeCompiler(String[] args)
private String[] setWorkingDir()
resetWorkingDir( String[] ) to
reset to the original values.
resetWorkingDir(String[])private void resetWorkingDir(String[] old)
setWorkingDir().
setWorkingDir()private OutputStream[] captureStreams()
releaseStreams(OutputStream[])private void releaseStreams(OutputStream[] streams)
captureStreams().
streams - the array returned by
captureStreams()captureStreams()protected FunctionalTestSuite.TestCase.RuntimeResults run(String className)
public static
void main( String[] ), passing an empty array.
Captures the values written to standard out by the method
and returns these in the result. The result also contains
a record of the exception thrown if the execution
failed.
protected FunctionalTestSuite.TestCase.CodeGenResults disasm(String className,
boolean details)
protected String[] split(String text)
splitCacheprotected void expectSuccess(FunctionalTestSuite.TestCase.CompilationResults results)
protected void expectFailure(FunctionalTestSuite.TestCase.CompilationResults results,
String expectedError)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||