edu.rice.cs.drjava.model.junit
Class JUnitError

java.lang.Object
  extended by edu.rice.cs.drjava.model.DJError
      extended by edu.rice.cs.drjava.model.junit.JUnitError
All Implemented Interfaces:
Serializable, Comparable<DJError>

public class JUnitError
extends DJError
implements Serializable

A class to represent JUnit errors. This class enables DrJava to highlight the exact error text.

Version:
$Id: JUnitError.java 4691 2008-12-02 23:33:27Z dlsmith $
See Also:
Serialized Form

Constructor Summary
JUnitError(File file, int lineNumber, int startColumn, String message, boolean isWarning, String test, String className, String stackTrace)
          Constructor.
JUnitError(String message, boolean isWarning, String test)
          Constructor for an error with no associated location.
 
Method Summary
 String className()
          Gets the class name
 String stackTrace()
          All JUnit errors are Throwables that have been thrown, so all have a stack trace
 String testName()
          Gets the test name
 
Methods inherited from class edu.rice.cs.drjava.model.DJError
compareTo, file, fileName, getFileMessage, getLineMessage, hasNoLocation, isWarning, lineNumber, message, startColumn, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JUnitError

public JUnitError(File file,
                  int lineNumber,
                  int startColumn,
                  String message,
                  boolean isWarning,
                  String test,
                  String className,
                  String stackTrace)
Constructor.

Parameters:
file - the file where the error occurred
lineNumber - the line number of the error
startColumn - the starting column of the error
message - the error message
isWarning - true if the error is a warning
test - the name of the test that failed

JUnitError

public JUnitError(String message,
                  boolean isWarning,
                  String test)
Constructor for an error with no associated location. This constructor also provides a default stackTrace.

Parameters:
message - the error message
isWarning - true if the error is a warning
test - the name of the test that failed
Method Detail

testName

public String testName()
Gets the test name

Returns:
the test name

className

public String className()
Gets the class name

Returns:
the class name

stackTrace

public String stackTrace()
All JUnit errors are Throwables that have been thrown, so all have a stack trace

Returns:
the stack trace associated with the error