|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
edu.rice.cs.drjava.DrJavaTestCase
edu.rice.cs.drjava.model.repl.JavaInterpreterTest
public class JavaInterpreterTest
Tests the functionality of the repl interpreter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class junit.framework.TestCase |
|---|
TestCase.WrappedException |
| Field Summary | |
|---|---|
private ClassPathManager |
_classPathManager
|
private Interpreter |
_interpreter
|
private ClassLoader |
_interpreterLoader
|
private InteractionsPaneOptions |
_interpreterOptions
|
static boolean |
testValue
|
| Constructor Summary | |
|---|---|
JavaInterpreterTest()
|
|
| Method Summary | |
|---|---|
private Object |
interpret(String s)
|
protected void |
setUp()
The setup method run before each test. |
void |
testArrayCloning()
Test that array cloning works. |
void |
testBooleanOps()
Test simple operations with Booleans |
void |
testCharacterOps()
Test character operations. |
void |
testConstants()
Make sure interpreting simple constants works. |
void |
testDeclareVoidMethod()
Tests that declaring a void method in the Interactions Pane won't cause a bad type exception. |
void |
testDoubleOps()
Test double operations. |
private void |
tester(Pair<String,Object>[] cases)
Asserts that the results of interpreting the first of each Pair is equal to the second. |
void |
testEvaluationVisitorExtensionNO_RESULT()
Test the operation of the EvaluationVisitorExtension by performing a computation with no results (interpreter should return NO_RESULT and not null) |
void |
testIncompatibleAssignment()
Ensure that the interpreter rejects assignments where the right type is not a subclass of the left type. |
void |
testInitializeArrays()
Test that arrays initializers are accepted. |
void |
testIntegerOps()
Tests integer operations. |
void |
testNullInstanceOf()
Tests that null can be used in instanceof expressions. |
void |
testSemicolon()
Tests that String and character declarations do not return a result, while the variables themselves return a quoted result. |
void |
testShortCircuit()
Tests short circuiting |
void |
testStringOps()
Test string operations |
void |
testThrowNull()
Test throwing null, for bug 3008828. |
void |
testTypeCheckerExtension()
Test the operation of the TypeCheckerExtension by performing the operations ((false) ? 2/0 : 1) and ((false) ? 2%0 : 1), which should not throw Exceptions in the Java interpreter. |
void |
testUserDefinedVoidMethod()
Tests that a call to user-defined void method returns NO_RESULT, instead of null. |
void |
testVariableDefaultValues()
Tests that variables are assigned default values. |
void |
testVariableDefinition()
Tests simple variable definitions which broke the initial implementation of variable redefinition (tested by testVariableRedefinition). |
void |
testVariableRedefinition()
Tests that variable declarations with errors will not allow the interpreter to not define the variable. |
| 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 |
|---|
private volatile InteractionsPaneOptions _interpreterOptions
private volatile Interpreter _interpreter
private volatile ClassPathManager _classPathManager
private volatile ClassLoader _interpreterLoader
public static boolean testValue
| Constructor Detail |
|---|
public JavaInterpreterTest()
| Method Detail |
|---|
protected void setUp()
throws Exception
setUp in class DrJavaTestCaseException - This convention is mandated by JUnit.TestCase, the superclass of this class.
private void tester(Pair<String,Object>[] cases)
throws InterpreterException
cases - an array of Pairs
InterpreterException
private Object interpret(String s)
throws InterpreterException
InterpreterException
public void testConstants()
throws InterpreterException
InterpreterException
public void testBooleanOps()
throws InterpreterException
InterpreterException
public void testShortCircuit()
throws InterpreterException
InterpreterException
public void testIntegerOps()
throws InterpreterException
InterpreterException
public void testDoubleOps()
throws InterpreterException
InterpreterException
public void testStringOps()
throws InterpreterException
InterpreterException
public void testCharacterOps()
throws InterpreterException
InterpreterException
public void testSemicolon()
throws InterpreterException
InterpreterException
public void testNullInstanceOf()
throws InterpreterException
InterpreterException
public void testVariableDefinition()
throws InterpreterException
InterpreterException
public void testVariableDefaultValues()
throws InterpreterException
InterpreterException
public void testVariableRedefinition()
throws InterpreterException
InterpreterException
public void testIncompatibleAssignment()
throws InterpreterException
InterpreterExceptionpublic void testTypeCheckerExtension()
public void testEvaluationVisitorExtensionNO_RESULT()
public void testInitializeArrays()
throws InterpreterException
InterpreterException
public void testArrayCloning()
throws InterpreterException
InterpreterExceptionpublic void testDeclareVoidMethod()
public void testUserDefinedVoidMethod()
throws InterpreterException
InterpreterException
public void testThrowNull()
throws InterpreterException
InterpreterException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||