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

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
                  extended by edu.rice.cs.drjava.model.definitions.indent.QuestionStartingNewStmtTest
All Implemented Interfaces:
junit.framework.Test

public final class QuestionStartingNewStmtTest
extends IndentRulesTestCase

Tests the question rule which determines if the current line is starting a new statement.

Version:
$Id: QuestionStartingNewStmtTest.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
 
Fields inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRulesTestCase
_doc, TEST_INDENT_LEVEL
 
Constructor Summary
QuestionStartingNewStmtTest()
           
 
Method Summary
 void testNotStartOfStmtDueToEndCharactersInCommentsOrQuotes()
          Ensures that the current line is the first line of a statement.
 void testStartOfStmtCheckForEndCharacters()
          Ensures that the current line is the first line of a statement.
 void testStartOfStmtIgnoreWhiteSpaceAndCommentsInBetween()
          Ensures that the current line is the first line of a statement.
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRulesTestCase
_assertContents, _setDocText, setUp, tearDown
 
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
 

Constructor Detail

QuestionStartingNewStmtTest

public QuestionStartingNewStmtTest()
Method Detail

testStartOfStmtCheckForEndCharacters

public void testStartOfStmtCheckForEndCharacters()
                                          throws BadLocationException
Ensures that the current line is the first line of a statement. This is done by testing if the previous character is one of the following: docstart, ';', '{', '}' These characters are here-on refered to as 'end-characters'.

Throws:
BadLocationException

testStartOfStmtIgnoreWhiteSpaceAndCommentsInBetween

public void testStartOfStmtIgnoreWhiteSpaceAndCommentsInBetween()
                                                         throws BadLocationException
Ensures that the current line is the first line of a statement. Tests that whitespace, single-line and multi-line comments are ignored when searching for the end-characters.

Throws:
BadLocationException

testNotStartOfStmtDueToEndCharactersInCommentsOrQuotes

public void testNotStartOfStmtDueToEndCharactersInCommentsOrQuotes()
                                                            throws BadLocationException
Ensures that the current line is the first line of a statement. Tests that end characters in single-line comments, multi-line comments or quotes are ignored.

Throws:
BadLocationException