edu.rice.cs.drjava.model.definitions
Class IndentTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--edu.rice.cs.drjava.model.definitions.IndentTest
All Implemented Interfaces:
Test

public class IndentTest
extends TestCase

Test the tab/enter/squiggly indenting functionality.

Version:
$Id: IndentTest.java,v 1.28 2002/09/02 21:24:11 csreis Exp $

Field Summary
private  Integer configIndent
           
protected  DefinitionsDocument doc
           
private  Integer indentLevel
           
(package private) static String noBrace
           
(package private) static String openBracket
           
(package private) static String openParen
           
(package private) static String openSquiggly
           
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
IndentTest(String name)
          put your documentation comment here
 
Method Summary
private  void _assertContents(String expected, Document document)
           
private  void _assertIndentInfo(IndentInfo ii, String braceType, int distToNewline, int distToBrace, int distToPrevNewline)
           
 void setUp()
          put your documentation comment here
static Test suite()
          put your documentation comment here
protected  void tearDown()
          put your documentation comment here
 void testAfterBlockComment()
          put your documentation comment here
 void testAfterBlockComment2()
          put your documentation comment here
 void testAfterBlockComment3()
          put your documentation comment here
 void testAfterBlockComment4()
          put your documentation comment here
 void testAnonymousInnerClass()
          Regression test for arrays.
 void testBlockIndent()
          put your documentation comment here
 void testBlockIndent2()
          Regression test for bug in drjava-20010802-1020: Indent block on a file containing just " x;\n y;\n" would throw an exception.
 void testEndBrace()
          put your documentation comment here
 void testEndOfBlockComment()
          put your documentation comment here
 void testEnter()
          put your documentation comment here
 void testEnter2()
          put your documentation comment here
 void testFor()
          put your documentation comment here
 void testFor2()
          put your documentation comment here
 void testIgnoreBraceOnSameLine()
          put your documentation comment here
 void testIndentArray()
          Regression test for arrays.
 void testIndentBraces()
          Regression test for braces.
 void testIndentComments()
          Regression test for comment portion of indent tree.
 void testIndentCommonCases()
          Regression test for common cases.
 void testIndentInfoBlockComments()
          put your documentation comment here
 void testIndentInfoBlockComments2()
          put your documentation comment here
 void testIndentInfoBlockComments3()
          put your documentation comment here
 void testIndentInfoBlockComments4()
          put your documentation comment here
 void testIndentInfoBracket()
          put your documentation comment here
 void testIndentInfoParen()
          put your documentation comment here
 void testIndentInfoPrevNewline()
          put your documentation comment here
 void testIndentInfoSquiggly()
          put your documentation comment here
 void testIndentInsideCommentBlock()
          put your documentation comment here
 void testIndentParenPhrases()
          Regression test for paren phrases.
 void testIndentSwitch()
          Regression test for switch statements.
 void testInsideClass()
          put your documentation comment here
 void testInsideClassWithBraceSets()
          put your documentation comment here
 void testLiveUpdateOfIndentLevel()
           
 void testMotion()
          put your documentation comment here
 void testNextCharIsNewline()
          put your documentation comment here
 void testNothingToIndentOn()
          put your documentation comment here
 void testNotRecognizeComments()
          put your documentation comment here
 void testNotRecognizeComments2()
          put your documentation comment here
 void testOpenBracket()
          put your documentation comment here
 void testOpenParen()
          put your documentation comment here
 void testPrintString()
          put your documentation comment here
 void testSecondLineProblem()
          put your documentation comment here
 void testSecondLineProblem2()
          put your documentation comment here
 void testSkippingBraces()
          put your documentation comment here
 void testSkippingComments()
          put your documentation comment here
 void testSkippingCommentsBraceAtBeginning()
          put your documentation comment here
 void testSmallFileProblem()
          put your documentation comment here
 void testSpaceBrace()
          put your documentation comment here
 void testSquigglyAlignment()
          put your documentation comment here
 void testStartBrace()
          put your documentation comment here
 void testStartSimple()
          put your documentation comment here
 void testStartSpaceIndent()
          put your documentation comment here
 void testWeird()
          put your documentation comment here
 void testWierd2()
          put your documentation comment here
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

doc

protected DefinitionsDocument doc

noBrace

static String noBrace

openSquiggly

static String openSquiggly

openParen

static String openParen

openBracket

static String openBracket

indentLevel

private Integer indentLevel

configIndent

private Integer configIndent
Constructor Detail

IndentTest

public IndentTest(String name)
put your documentation comment here
Parameters:
String - name
Method Detail

setUp

public void setUp()
put your documentation comment here
Overrides:
setUp in class TestCase

tearDown

protected void tearDown()
put your documentation comment here
Overrides:
tearDown in class TestCase

suite

public static Test suite()
put your documentation comment here
Returns:
 

testIndentComments

public void testIndentComments()
                        throws BadLocationException
Regression test for comment portion of indent tree.

testIndentParenPhrases

public void testIndentParenPhrases()
                            throws BadLocationException
Regression test for paren phrases.

testIndentBraces

public void testIndentBraces()
                      throws BadLocationException
Regression test for braces.

testIndentArray

public void testIndentArray()
                     throws BadLocationException
Regression test for arrays.

testIndentCommonCases

public void testIndentCommonCases()
                           throws BadLocationException
Regression test for common cases.

testIndentSwitch

public void testIndentSwitch()
                      throws BadLocationException
Regression test for switch statements.

testIndentInfoSquiggly

public void testIndentInfoSquiggly()
                            throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoParen

public void testIndentInfoParen()
                         throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoBracket

public void testIndentInfoBracket()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoPrevNewline

public void testIndentInfoPrevNewline()
                               throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testEndOfBlockComment

public void testEndOfBlockComment()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testAfterBlockComment

public void testAfterBlockComment()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testAfterBlockComment3

public void testAfterBlockComment3()
                            throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testAfterBlockComment4

public void testAfterBlockComment4()
                            throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testAfterBlockComment2

public void testAfterBlockComment2()
                            throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoBlockComments

public void testIndentInfoBlockComments()
                                 throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoBlockComments2

public void testIndentInfoBlockComments2()
                                  throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoBlockComments3

public void testIndentInfoBlockComments3()
                                  throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIndentInfoBlockComments4

public void testIndentInfoBlockComments4()
                                  throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSkippingBraces

public void testSkippingBraces()
                        throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSkippingComments

public void testSkippingComments()
                          throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSkippingCommentsBraceAtBeginning

public void testSkippingCommentsBraceAtBeginning()
                                          throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testNothingToIndentOn

public void testNothingToIndentOn()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testStartSimple

public void testStartSimple()
                     throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testStartSpaceIndent

public void testStartSpaceIndent()
                          throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testStartBrace

public void testStartBrace()
                    throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testEndBrace

public void testEndBrace()
                  throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testInsideClass

public void testInsideClass()
                     throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testInsideClassWithBraceSets

public void testInsideClassWithBraceSets()
                                  throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testIgnoreBraceOnSameLine

public void testIgnoreBraceOnSameLine()
                               throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testWeird

public void testWeird()
               throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testWierd2

public void testWierd2()
                throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testMotion

public void testMotion()
                throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testNextCharIsNewline

public void testNextCharIsNewline()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testFor

public void testFor()
             throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testFor2

public void testFor2()
              throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testOpenParen

public void testOpenParen()
                   throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testPrintString

public void testPrintString()
                     throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testOpenBracket

public void testOpenBracket()
                     throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSquigglyAlignment

public void testSquigglyAlignment()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSpaceBrace

public void testSpaceBrace()
                    throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testEnter

public void testEnter()
               throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testEnter2

public void testEnter2()
                throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testNotRecognizeComments

public void testNotRecognizeComments()
                              throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testNotRecognizeComments2

public void testNotRecognizeComments2()
                               throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testBlockIndent

public void testBlockIndent()
                     throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testBlockIndent2

public void testBlockIndent2()
                      throws BadLocationException
Regression test for bug in drjava-20010802-1020: Indent block on a file containing just " x;\n y;\n" would throw an exception.
Throws:
BadLocationException -  

testIndentInsideCommentBlock

public void testIndentInsideCommentBlock()
                                  throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSecondLineProblem

public void testSecondLineProblem()
                           throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSecondLineProblem2

public void testSecondLineProblem2()
                            throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testSmallFileProblem

public void testSmallFileProblem()
                          throws BadLocationException
put your documentation comment here
Throws:
BadLocationException -  

testAnonymousInnerClass

public void testAnonymousInnerClass()
                             throws BadLocationException
Regression test for arrays.

testLiveUpdateOfIndentLevel

public void testLiveUpdateOfIndentLevel()
                                 throws BadLocationException

_assertContents

private void _assertContents(String expected,
                             Document document)
                      throws BadLocationException

_assertIndentInfo

private void _assertIndentInfo(IndentInfo ii,
                               String braceType,
                               int distToNewline,
                               int distToBrace,
                               int distToPrevNewline)