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

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
                    |
                    +--edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelTest
All Implemented Interfaces:
ReducedModelStates, Test

public class ReducedModelTest
extends BraceReductionTestCase
implements ReducedModelStates

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

Version:
$Id: ReducedModelTest.java,v 1.20 2002/08/10 23:52:51 cmcgraw Exp $

Field Summary
protected  ReducedModelControl model0
           
protected  ReducedModelControl model1
           
protected  ReducedModelControl model2
           
 
Fields inherited from class junit.framework.TestCase
fName
 
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(String name)
          put your documentation comment here
 
Method Summary
protected  void insertGap(BraceReduction model, int size)
          put your documentation comment here
protected  void setUp()
          put your documentation comment here
protected  ReducedModelControl setUpExample()
          sets up example reduction for the following tests
static Test suite()
          put your documentation comment here
 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()
          put your documentation comment here
 void testInsertBraceAndBreakBlockCommentStart()
          Tests the reduced model's ability to insert braces correctly
 void testInsertBraceAndBreakLineComment()
          put your documentation comment here
 void testInsertBraceAtStartAndEnd()
          put your documentation comment here
 void testInsertBraceInsideGap()
           
 void testInsertBraces()
          tests inserting braces
 void testInsertGap()
          put your documentation comment here
 void testInsertGap2()
          tests inserting gaps
 void testInsertGapAfterGap()
          put your documentation comment here
 void testInsertGapBeforeGap()
          Test that a gap inserted previous to a gap, unites with that gap.
 void testInsertGapInsideGap()
          Inserts one gap inside of the other
 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
stateOfCurrentToken
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, tearDown, 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

model0

protected ReducedModelControl model0

model1

protected ReducedModelControl model1

model2

protected ReducedModelControl model2
Constructor Detail

ReducedModelTest

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

setUp

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

insertGap

protected void insertGap(BraceReduction model,
                         int size)
put your documentation comment here
Parameters:
model -  
size -  

suite

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

testInsertGap

public void testInsertGap()
put your documentation comment here

testInsertGapBeforeGap

public void testInsertGapBeforeGap()
Test that a gap inserted previous to a gap, unites with that gap.

testInsertGapAfterGap

public void testInsertGapAfterGap()
put your documentation comment here

testInsertGapInsideGap

public void testInsertGapInsideGap()
Inserts one gap inside of the other

testInsertBraceAtStartAndEnd

public void testInsertBraceAtStartAndEnd()
put your documentation comment here

testInsertBraceInsideGap

public void testInsertBraceInsideGap()

testInsertBrace

public void testInsertBrace()
put your documentation comment here

testInsertBraceAndBreakLineComment

public void testInsertBraceAndBreakLineComment()
put your documentation comment here

testInsertBraceAndBreakBlockCommentStart

public void testInsertBraceAndBreakBlockCommentStart()
Tests the reduced model's ability to insert braces correctly

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 ')'

testBalanceBackward

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