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

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.CommentTest
All Implemented Interfaces:
Test

public final class CommentTest
extends DrJavaTestCase

Test the comment lines / uncomment lines functionality.

Version:
$Id: CommentTest.java 5185 2010-02-27 16:21:13Z rcartwright $

Nested Class Summary
 
Nested classes/interfaces inherited from class junit.framework.TestCase
TestCase.WrappedException
 
Field Summary
private  java.lang.Integer _indentLevel
           
private  GlobalEventNotifier _notifier
           
protected  DefinitionsDocument doc
           
 
Constructor Summary
CommentTest()
           
 
Method Summary
private static void _assertContents(java.lang.String msg, java.lang.String expected, DJDocument document)
           
 void setUp()
          Resents configuration settings and sets up the indent level so that we can predict the correct behavior for indenting.
 void testCommentOutMultipleLines()
          Tests the Comment Out Line(s) command with multiple lines.
 void testCommentOutSingleLine()
          Tests the Comment Out Line(s) command with a single line.
 void testUncommentIgnoreMultipleLines()
          Tests the Uncomment Line(s) command with multiple lines.
 void testUncommentIgnoreSingleLine()
          Tests the Uncomment Line(s) command with a single line.
 void testUncommentMultipleLines()
          Tests the Uncomment Line(s) command with multiple lines.
 void testUncommentSingleLine()
          Tests the Uncomment Line(s) command with a single line.
 
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
 

Field Detail

doc

protected DefinitionsDocument doc

_indentLevel

private java.lang.Integer _indentLevel

_notifier

private GlobalEventNotifier _notifier
Constructor Detail

CommentTest

public CommentTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Resents configuration settings and sets up the indent level so that we can predict the correct behavior for indenting.

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

testCommentOutSingleLine

public void testCommentOutSingleLine()
                              throws javax.swing.text.BadLocationException
Tests the Comment Out Line(s) command with a single line.

Throws:
javax.swing.text.BadLocationException

testCommentOutMultipleLines

public void testCommentOutMultipleLines()
                                 throws javax.swing.text.BadLocationException
Tests the Comment Out Line(s) command with multiple lines.

Throws:
javax.swing.text.BadLocationException

testUncommentIgnoreSingleLine

public void testUncommentIgnoreSingleLine()
                                   throws javax.swing.text.BadLocationException
Tests the Uncomment Line(s) command with a single line. These sample lines should be ignored by the algorithm.

Throws:
javax.swing.text.BadLocationException

testUncommentIgnoreMultipleLines

public void testUncommentIgnoreMultipleLines()
                                      throws javax.swing.text.BadLocationException
Tests the Uncomment Line(s) command with multiple lines. These sample lines should be ignored by the algorithm.

Throws:
javax.swing.text.BadLocationException

testUncommentSingleLine

public void testUncommentSingleLine()
                             throws javax.swing.text.BadLocationException
Tests the Uncomment Line(s) command with a single line. One of these sample lines should be uncommented and indented by the algorithm.

Throws:
javax.swing.text.BadLocationException

testUncommentMultipleLines

public void testUncommentMultipleLines()
                                throws javax.swing.text.BadLocationException
Tests the Uncomment Line(s) command with multiple lines. These sample lines should be uncommented and indented by the algorithm.

Throws:
javax.swing.text.BadLocationException

_assertContents

private static void _assertContents(java.lang.String msg,
                                    java.lang.String expected,
                                    DJDocument document)
                             throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException