edu.rice.cs.drjava.model.definitions.reducedmodel
Class ReducedModelTest

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.reducedmodel.BraceReductionTestCase
                  extended by edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelTest
All Implemented Interfaces:
ReducedModelStates, Test

public final class ReducedModelTest
extends BraceReductionTestCase
implements ReducedModelStates

Tests insertion and move and other non-delete functionality of the reduced model.

Version:
$Id: ReducedModelTest.java 4653 2008-08-26 14:46:35Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
model0, model1, model2
 
Fields inherited from class edu.rice.cs.drjava.DrJavaTestCase
TEST_DRJAVA_CONFIG_PROPERTY
 
Fields inherited from interface edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelStates
FREE, INSIDE_BLOCK_COMMENT, INSIDE_DOUBLE_QUOTE, INSIDE_LINE_COMMENT, INSIDE_SINGLE_QUOTE, STUTTER
 
Constructor Summary
ReducedModelTest()
           
 
Method Summary
protected  ReducedModelControl setUpExample()
          sets up example reduction for the following tests
 void testBalanceBackward()
          tests backwards balancer, e.g., ')' balances with '('
 void testBalanceForward()
          tests forward balancer, e.g., '(' balances with ')'
 void testBasicBlockComment()
          put your documentation comment here
 void testBreakBlockCommentWithStar()
          put your documentation comment here
 void testBreakCloseBlockCommentWithStar()
          put your documentation comment here
 void testComplexBraceInsertion()
          Test to ensure that a complex sequence of multi-lined Brace entries does not fail.
 void testCrazyCase1()
          put your documentation comment here
 void testCrazyCase2()
          Test sequences of inserts
 void testGetStateAtCurrent()
          put your documentation comment here
 void testInsertBlockCommentEnd()
          put your documentation comment here
 void testInsertBlockInsideBlockComment()
          put your documentation comment here
 void testInsertBrace()
          Tests that inserting other forms of braces creates the proper tokens.
 void testInsertBraceAndBreakBlockCommentStart()
          Tests inserting block comment opening "brace" followed by inserting characters between '/' and '*'.
 void testInsertBraceAndBreakLineComment()
          Tests inserting line comment chars and then inserting a brace between them.
 void testInsertBraceAtStartAndEnd()
          Tests that inserting a curly brace at the beginning/end of the document creates the proper tokens.
 void testInsertBraceInsideGap()
          Tests that inserting a curly brace inside a gap creates the proper tokens.
 void testInsertBraces()
          tests inserting braces
 void testInsertGap()
          Put your documentation comment here.
 void testInsertGap2()
          tests inserting gaps
 void testInsertGapAfterGap()
          Tests that a gap inserted after a gap, unites with that gap.
 void testInsertGapBeforeGap()
          Tests that a gap inserted before a gap, unites with that gap.
 void testInsertGapInsideGap()
          Tests that a gap inserted inside another gap unites with the enclosing gap.
 void testInsertMultipleBraces()
           
 void testInsertNewlineChainReaction()
          put your documentation comment here
 void testInsertNewlineEndLineComment()
          put your documentation comment here
 void testInsertNewlineEndQuote()
          put your documentation comment here
 void testInsertQuoteToQuoteBlock()
          put your documentation comment here
 void testInsideComment()
          tests the function to test if something is inside comments
 void testInsideString()
          tests the function to test if something is inside quotes
 void testLineCommentBreakCrazy()
          put your documentation comment here
 void testMove()
          tests the cursor movement function
 void testMove0StaysPut()
          put your documentation comment here
 void testMoveOnEmpty()
          put your documentation comment here
 void testMoveWithinToken()
          put your documentation comment here
 void testQuoteBreakComment2()
          put your documentation comment here
 void testQuoteBreaksComment()
          put your documentation comment here
 void testQuotesSimple()
          put your documentation comment here
 void testQuotesWithGap()
          put your documentation comment here
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
insertGap, setUp
 
Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase
setConfigSetting, setDocText, tearDown
 
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

ReducedModelTest

public ReducedModelTest()
Method Detail

testBalanceBackward

public void testBalanceBackward()
tests backwards balancer, e.g., ')' balances with '('


testInsertGap

public void testInsertGap()
Put your documentation comment here.


testInsertGapBeforeGap

public void testInsertGapBeforeGap()
Tests that a gap inserted before a gap, unites with that gap.


testInsertGapAfterGap

public void testInsertGapAfterGap()
Tests that a gap inserted after a gap, unites with that gap. *


testInsertGapInsideGap

public void testInsertGapInsideGap()
Tests that a gap inserted inside another gap unites with the enclosing gap.


testInsertBraceAtStartAndEnd

public void testInsertBraceAtStartAndEnd()
Tests that inserting a curly brace at the beginning/end of the document creates the proper tokens.


testInsertBraceInsideGap

public void testInsertBraceInsideGap()
Tests that inserting a curly brace inside a gap creates the proper tokens.


testInsertBrace

public void testInsertBrace()
Tests that inserting other forms of braces creates the proper tokens.


testInsertBraceAndBreakLineComment

public void testInsertBraceAndBreakLineComment()
Tests inserting line comment chars and then inserting a brace between them.


testInsertBraceAndBreakBlockCommentStart

public void testInsertBraceAndBreakBlockCommentStart()
Tests inserting block comment opening "brace" followed by inserting characters between '/' and '*'.


testInsertMultipleBraces

public void testInsertMultipleBraces()

testComplexBraceInsertion

public void testComplexBraceInsertion()
Test to ensure that a complex sequence of multi-lined Brace entries does not fail. Originally, the insertBraceInGap() had the chance of inserting at the beginning of a gap, in which case the gap to be split was actually never shrunk and a new gap of size 0 is added after the newly inserted Brace. This caused problems for brace-matching when new nested braces/parentheses piled up on top of each other.


testCrazyCase1

public void testCrazyCase1()
put your documentation comment here


testCrazyCase2

public void testCrazyCase2()
Test sequences of inserts


testLineCommentBreakCrazy

public void testLineCommentBreakCrazy()
put your documentation comment here


testBreakBlockCommentWithStar

public void testBreakBlockCommentWithStar()
put your documentation comment here


testBreakCloseBlockCommentWithStar

public void testBreakCloseBlockCommentWithStar()
put your documentation comment here


testBasicBlockComment

public void testBasicBlockComment()
put your documentation comment here


testInsertBlockInsideBlockComment

public void testInsertBlockInsideBlockComment()
put your documentation comment here


testInsertBlockCommentEnd

public void testInsertBlockCommentEnd()
put your documentation comment here


testGetStateAtCurrent

public void testGetStateAtCurrent()
put your documentation comment here


testQuotesSimple

public void testQuotesSimple()
put your documentation comment here


testQuotesWithGap

public void testQuotesWithGap()
put your documentation comment here


testInsertQuoteToQuoteBlock

public void testInsertQuoteToQuoteBlock()
put your documentation comment here


testQuoteBreaksComment

public void testQuoteBreaksComment()
put your documentation comment here


testQuoteBreakComment2

public void testQuoteBreakComment2()
put your documentation comment here


testInsertNewlineEndLineComment

public void testInsertNewlineEndLineComment()
put your documentation comment here


testInsertNewlineEndQuote

public void testInsertNewlineEndQuote()
put your documentation comment here


testInsertNewlineChainReaction

public void testInsertNewlineChainReaction()
put your documentation comment here


testMoveWithinToken

public void testMoveWithinToken()
put your documentation comment here


testMoveOnEmpty

public void testMoveOnEmpty()
put your documentation comment here


testMove0StaysPut

public void testMove0StaysPut()
put your documentation comment here


testInsideComment

public void testInsideComment()
tests the function to test if something is inside comments


testInsideString

public void testInsideString()
tests the function to test if something is inside quotes


testInsertBraces

public void testInsertBraces()
tests inserting braces


testInsertGap2

public void testInsertGap2()
tests inserting gaps


testMove

public void testMove()
tests the cursor movement function


setUpExample

protected ReducedModelControl setUpExample()
sets up example reduction for the following tests


testBalanceForward

public void testBalanceForward()
tests forward balancer, e.g., '(' balances with ')'