edu.rice.cs.drjava.model.definitions.indent
Class IndentRulesTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.rice.cs.drjava.DrJavaTestCase
              extended by edu.rice.cs.drjava.model.definitions.indent.IndentRulesTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ActionBracePlusTest, ActionDoNothingTest, ActionStartPrevLinePlusMultilinePreserveTest, ActionStartPrevLinePlusTest, ActionStartPrevStmtPlusTest, ActionStartStmtOfBracePlusTest, IndentHelperTest, IndentRuleWithTraceTest, QuestionBraceIsCurlyTest, QuestionBraceIsParenOrBracketTest, QuestionCurrLineEmptyOrEnterPressTest, QuestionCurrLineIsWingCommentTest, QuestionCurrLineStartsWithSkipCommentsTest, QuestionCurrLineStartsWithTest, QuestionExistsCharInStmtTest, QuestionHasCharPrecedingOpenBraceTest, QuestionInsideCommentTest, QuestionLineContainsTest, QuestionNewParenPhraseTest, QuestionPrevLineStartsCommentTest, QuestionPrevLineStartsWithTest, QuestionStartAfterOpenBraceTest, QuestionStartingNewStmtTest

public abstract class IndentRulesTestCase
extends DrJavaTestCase

Superclass for all test classes for the indentation decision tree.

Version:
$Id: IndentRulesTestCase.java 5175 2010-01-20 08:46:32Z mgricken $

Nested Class Summary
 
Nested classes/interfaces inherited from class junit.framework.TestCase
junit.framework.TestCase.WrappedException
 
Field Summary
protected  AbstractDJDocument _doc
           
static int TEST_INDENT_LEVEL
           
 
Constructor Summary
IndentRulesTestCase()
           
 
Method Summary
protected  void _assertContents(String expected)
          Asserts that the document contains the expected text.
protected  void _setDocText(String text)
          Clears the text of the _doc field and sets it to the given string.
 void setUp()
          Sets up the test environment.
 void tearDown()
          Clean up for every test case.
 
Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase
setConfigSetting, setDocText
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEST_INDENT_LEVEL

public static final int TEST_INDENT_LEVEL
See Also:
Constant Field Values

_doc

protected volatile AbstractDJDocument _doc
Constructor Detail

IndentRulesTestCase

public IndentRulesTestCase()
Method Detail

setUp

public void setUp()
           throws Exception
Sets up the test environment.

Overrides:
setUp in class DrJavaTestCase
Throws:
Exception - This convention is mandated by JUnit.TestCase, the superclass of this class.

tearDown

public void tearDown()
              throws Exception
Description copied from class: DrJavaTestCase
Clean up for every test case. Only used in unit tests. Added because Windows would intermittently throw a java.util.concurrent.RejectedExecutionException during cleanup.

Overrides:
tearDown in class DrJavaTestCase
Throws:
Exception

_setDocText

protected final void _setDocText(String text)
                          throws BadLocationException
Clears the text of the _doc field and sets it to the given string.

Throws:
BadLocationException

_assertContents

protected void _assertContents(String expected)
                        throws BadLocationException
Asserts that the document contains the expected text.

Parameters:
expected - what text of document should be
Throws:
BadLocationException