edu.rice.cs.drjava.ui
Class DefinitionsPaneTest

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.MultiThreadedTestCase
                  extended by edu.rice.cs.drjava.ui.DefinitionsPaneTest
All Implemented Interfaces:
Test

public final class DefinitionsPaneTest
extends MultiThreadedTestCase

Tests the Definitions Pane

Version:
$Id: DefinitionsPaneTest.java 4691 2008-12-02 23:33:27Z dlsmith $

Field Summary
static Log _log
           
 
Fields inherited from class edu.rice.cs.drjava.model.MultiThreadedTestCase
_testFailed
 
Fields inherited from class edu.rice.cs.drjava.DrJavaTestCase
TEST_DRJAVA_CONFIG_PROPERTY
 
Constructor Summary
DefinitionsPaneTest()
           
 
Method Summary
protected  void _assertDocumentContents(DJDocument doc, String contents, String message)
           
protected  void _assertDocumentEmpty(DJDocument doc, String message)
           
 void setUp()
          Setup method for each JUnit test case.
 void tearDown()
          If any test failed, print a message saying that some test failed in another thread (not the testing thread).
 void testActiveAndInactive()
           
 void testBackspace()
           
 void testDocumentPaneMemoryLeak()
           
 void testFrenchKeyStrokes()
           
 void testGranularUndo()
           
 void testMatchBraceText()
          Tests the functionality that allows brace matching that displays the line matched in the status bar
 void testMetaKeyPress()
          Tests that a simulated key press with the meta modifier is correct.
 void testMultilineCommentOrUncommentAfterScroll()
          Tests that undoing/redoing a multi-line comment/uncomment will restore the caret position
 void testShiftBackspace()
          Tests that shift backspace works the same as backspace.
 void testTypeBraceNotInCode()
          Tests that typing a brace in a string/comment does not cause an indent.
 void testTypeEnterNotInCode()
          Tests that typing Enter in a string/comment does cause an indent.
 
Methods inherited from class edu.rice.cs.drjava.model.MultiThreadedTestCase
join, listenerFail, wait
 
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
 

Field Detail

_log

public static final Log _log
Constructor Detail

DefinitionsPaneTest

public DefinitionsPaneTest()
Method Detail

setUp

public void setUp()
           throws Exception
Setup method for each JUnit test case.

Overrides:
setUp in class MultiThreadedTestCase
Throws:
Exception - This convention is mandated by the JUnit TestCase class which is an ancestor of this class.

tearDown

public void tearDown()
              throws Exception
Description copied from class: MultiThreadedTestCase
If any test failed, print a message saying that some test failed in another thread (not the testing thread).

Overrides:
tearDown in class MultiThreadedTestCase
Throws:
Exception

testShiftBackspace

public void testShiftBackspace()
                        throws BadLocationException
Tests that shift backspace works the same as backspace. (Ease of use issue 693253). Ideally, this test should be lighter weight, and not require the creation of an entire MainFrame+GlobalModel. Refactor? NOTE: This test doesn't work yet, since we can't currently bind two keys to the same action. This should be implemented as part of feature request 683300.

Throws:
BadLocationException

testTypeBraceNotInCode

public void testTypeBraceNotInCode()
                            throws BadLocationException
Tests that typing a brace in a string/comment does not cause an indent.

Throws:
BadLocationException

testTypeEnterNotInCode

public void testTypeEnterNotInCode()
                            throws BadLocationException,
                                   InterruptedException,
                                   InvocationTargetException
Tests that typing Enter in a string/comment does cause an indent. This behavior works in practice, but I can't get the test to work. If we use definitions.processKeyEvent, the caret position is not updated, so the " * " is not inserted. If we try to dispatchEvent from the EventDispatchingThread, it hangs...?

Throws:
BadLocationException
InterruptedException
InvocationTargetException

testMetaKeyPress

public void testMetaKeyPress()
                      throws BadLocationException
Tests that a simulated key press with the meta modifier is correct. Reveals bug 676586.

Throws:
BadLocationException

testMultilineCommentOrUncommentAfterScroll

public void testMultilineCommentOrUncommentAfterScroll()
                                                throws BadLocationException
Tests that undoing/redoing a multi-line comment/uncomment will restore the caret position

Throws:
BadLocationException

_assertDocumentEmpty

protected void _assertDocumentEmpty(DJDocument doc,
                                    String message)

_assertDocumentContents

protected void _assertDocumentContents(DJDocument doc,
                                       String contents,
                                       String message)

testGranularUndo

public void testGranularUndo()
                      throws BadLocationException
Throws:
BadLocationException

testActiveAndInactive

public void testActiveAndInactive()

testDocumentPaneMemoryLeak

public void testDocumentPaneMemoryLeak()
                                throws InterruptedException,
                                       IOException
Throws:
InterruptedException
IOException

testFrenchKeyStrokes

public void testFrenchKeyStrokes()
                          throws IOException,
                                 InterruptedException
Throws:
IOException
InterruptedException

testBackspace

public void testBackspace()

testMatchBraceText

public void testMatchBraceText()
Tests the functionality that allows brace matching that displays the line matched in the status bar