edu.rice.cs.drjava.config
Class KeyStrokeOptionTest
java.lang.Object
|
+--junit.framework.Assert
|
+--junit.framework.TestCase
|
+--edu.rice.cs.drjava.config.KeyStrokeOptionTest
- All Implemented Interfaces:
- Test
- public class KeyStrokeOptionTest
- extends TestCase
Class according to the JUnit protocol. Tests
the proper functionality of the class KeyStrokeOption.
Method Summary |
static void |
main(String[] args)
Main method to be called by testLocalSpecificFormat. |
void |
setUp()
|
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 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 |
KeyStrokeOptionTest
public KeyStrokeOptionTest(String name)
- Parameters:
name
- The name of this test case.
setUp
public void setUp()
- Overrides:
setUp
in class TestCase
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 set, it cannot be set back. (If someone can figure out how
to effectively set it back, feel free to remove this hack!)
main
public static void main(String[] args)
- Main method to be called by testLocalSpecificFormat. Runs in
a new JVM so as not to affect the locale of other tests.