edu.rice.cs.drjava.config
Class KeyStrokeOptionTest

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

public final class KeyStrokeOptionTest
extends DrJavaTestCase

Class according to the JUnit protocol. Tests the proper functionality of the class KeyStrokeOption.

Version:
$Id: KeyStrokeOptionTest.java 4504 2008-06-03 06:19:20Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.DrJavaTestCase
TEST_DRJAVA_CONFIG_PROPERTY
 
Constructor Summary
KeyStrokeOptionTest(String name)
           
 
Method Summary
static void main(String[] args)
          Main method called by testLocalSpecificFormat.
 void testFormat()
          Test the format method by comparing a KeyStroke object to itself after it has been formatted to a string and parsed back into a KeyStroke object.
 void testGetName()
           
 void testLocaleSpecificFormat()
          Tests that key strokes are output in a parseable format even in foreign locales.
 void testParse()
           
 
Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase
setConfigSetting, setDocText, setUp, 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

KeyStrokeOptionTest

public KeyStrokeOptionTest(String name)
Parameters:
name - The name of this test case.
Method Detail

testGetName

public void testGetName()

testParse

public void testParse()

testFormat

public void testFormat()
Test the format method by comparing a KeyStroke object to itself after it has been formatted to a string and parsed back into a KeyStroke object. We cannot compare strings because format always puts the modifiers in the same order which could be a different order than the user specifies.


testLocaleSpecificFormat

public void testLocaleSpecificFormat()
                              throws IOException,
                                     InterruptedException
Tests that key strokes are output in a parseable format even in foreign locales. The test must be run in a separate JVM, because once the locale is changed, it cannot be restored. (If someone can figure out how to effectively set it back, feel free to remove this hack!)

Throws:
IOException
InterruptedException

main

public static void main(String[] args)
Main method called by testLocalSpecificFormat. Runs in new JVM to avoid corrupting the locale of other tests.