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

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.junit.JUnitErrorModel

public class JUnitErrorModel
extends Object

Contains the JUnitErrors for a particular file after a test has ended.

Version:
$Id: JUnitErrorModel.java,v 1.6 2002/08/15 23:03:57 jhsia Exp $

Field Summary
private  DefinitionsDocument _document
           
private  JUnitError[] _errors
           
private  JUnitError[] _errorsWithoutPositions
           
private  int _errorsWithPos
           
private  File _file
           
private  int _numErrors
           
private  Position[] _positions
           
private  boolean _testsHaveRun
           
 
Constructor Summary
JUnitErrorModel()
          Constructs a new JUnitErrorModel to be maintained by a particular OpenDefinitionsDocument.
JUnitErrorModel(DefinitionsDocument doc, JUnitError[] errors)
          Constructs a new JUnitErrorModel to be maintained by a particular OpenDefinitionsDocument.
 
Method Summary
private  void _createPositionsArray()
          Create array of positions where each error occurred.
private  void _groupErrors(JUnitError[] errors)
          Groups errors into those with and without positions, and creates the corresponding array of positions.
private  String _quickParse(String sw, String classname)
           
(package private)  String _substring(String s, int start, int end)
          Returns a substring, if it exists.
 DefinitionsDocument getDocument()
          Returns the document associated with this error model.
 JUnitError[] getErrorsWithoutPositions()
          Returns the array of errors without positions.
 JUnitError[] getErrorsWithPositions()
          Returns the array of errors with positions.
 int getNumErrors()
          Returns the number of JUnitErrors
 Position[] getPositions()
          Returns the array of positions.
 boolean haveTestsRun()
          Accessor
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_errors

private JUnitError[] _errors

_errorsWithoutPositions

private JUnitError[] _errorsWithoutPositions

_positions

private Position[] _positions

_document

private DefinitionsDocument _document

_file

private File _file

_testsHaveRun

private boolean _testsHaveRun

_errorsWithPos

private int _errorsWithPos

_numErrors

private int _numErrors
Constructor Detail

JUnitErrorModel

public JUnitErrorModel(DefinitionsDocument doc,
                       JUnitError[] errors)
Constructs a new JUnitErrorModel to be maintained by a particular OpenDefinitionsDocument.
Parameters:
doc - Document containing the errors
file - File containing the errors, or null

JUnitErrorModel

public JUnitErrorModel()
Constructs a new JUnitErrorModel to be maintained by a particular OpenDefinitionsDocument.
Parameters:
doc - Document containing the errors
file - File containing the errors, or null
Method Detail

_quickParse

private String _quickParse(String sw,
                           String classname)

haveTestsRun

public boolean haveTestsRun()
Accessor
Returns:
whether tests have been run before.

getNumErrors

public int getNumErrors()
Returns the number of JUnitErrors

getErrorsWithPositions

public JUnitError[] getErrorsWithPositions()
Returns the array of errors with positions.

getErrorsWithoutPositions

public JUnitError[] getErrorsWithoutPositions()
Returns the array of errors without positions.

getPositions

public Position[] getPositions()
Returns the array of positions.

getDocument

public DefinitionsDocument getDocument()
Returns the document associated with this error model.

_substring

String _substring(String s,
                  int start,
                  int end)
Returns a substring, if it exists. Otherwise, it returns "(not applicable)".

_groupErrors

private void _groupErrors(JUnitError[] errors)
Groups errors into those with and without positions, and creates the corresponding array of positions.

_createPositionsArray

private void _createPositionsArray()
Create array of positions where each error occurred.