edu.rice.cs.drjava.model.repl
Class InteractionsModelErrorTest

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.model.GlobalModelTestCase
                      extended by edu.rice.cs.drjava.model.repl.InteractionsModelErrorTest
All Implemented Interfaces:
junit.framework.Test

public final class InteractionsModelErrorTest
extends GlobalModelTestCase

Tests errors in an InteractionsModel.

Version:
$Id: InteractionsModelErrorTest.java 5236 2010-04-27 01:43:36Z mgricken $

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase
GlobalModelTestCase.CancelingSelector, GlobalModelTestCase.CompileShouldFailListener, GlobalModelTestCase.CompileShouldSucceedListener, GlobalModelTestCase.FileMovedWarningException, GlobalModelTestCase.FileSelector, GlobalModelTestCase.InteractionListener, GlobalModelTestCase.JUnitNonTestListener, GlobalModelTestCase.JUnitTestListener, GlobalModelTestCase.OpenWarningException, GlobalModelTestCase.OverwriteException, GlobalModelTestCase.SaveCopyFileSelector, GlobalModelTestCase.TestGlobalModel, GlobalModelTestCase.TestListener, GlobalModelTestCase.WarningFileSelector
 
Nested classes/interfaces inherited from class junit.framework.TestCase
junit.framework.TestCase.WrappedException
 
Field Summary
private  ClassPathManager _classPathManager
           
private  Interpreter _interpreter
           
private  ClassLoader _interpreterLoader
           
private  InteractionsPaneOptions _interpreterOptions
           
private static Log _log
           
protected static String CLASS_IN_PACKAGE_CLASS_TEXT
           
protected static String UNARY_FUN_NON_PUBLIC_CLASS_TEXT
           
protected static String UNARY_FUN_NON_PUBLIC_INTERFACE_TEXT
           
protected static String UNARY_FUN_PUBLIC_CLASS_TEXT
           
protected static String UNARY_FUN_PUBLIC_INTERFACE_TEXT
           
 
Fields inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase
_doc, _interactionsController, _model, _tempDir, BAR_TEXT, BAZ_TEXT, FOO_MISSING_CLOSE_TEXT, FOO_PACKAGE_AFTER_IMPORT, FOO_PACKAGE_AS_FIELD, FOO_PACKAGE_AS_FIELD_2, FOO_PACKAGE_AS_PART_OF_FIELD, FOO_PACKAGE_INSIDE_CLASS, FOO_TEXT
 
Fields inherited from class edu.rice.cs.drjava.model.MultiThreadedTestCase
_testFailed
 
Constructor Summary
InteractionsModelErrorTest()
           
 
Method Summary
protected  String _name()
           
private  Object interpretDirectly(String s)
           
private  void tester(Pair<String,Object>[] cases)
          Asserts that the results of interpreting the first of each Pair is equal to the second.
 void testInterpretExtendNonPublic()
          Tests that we get the correct 'cannot access its superinterface' error for non-public classes.
 void testInterpretExtendNonPublicClass()
          Tests that we get the correct 'cannot access its superinterface' error for non-public classes.
 void testInterpretExtendPublic()
          Tests that we don't get an error for public classes.
 void testInterpretExtendPublicClass()
          Tests that we don't get an error for public classes.
 void testInterpretGetPackageAnonymous()
          Test that we get the right package using getPackage() with anonymous inner classes defined in the Interactions Pane.
 void testInterpretGetPackageClass()
          Test that we get the right package using getPackage().
 
Methods inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase
assertCompileErrorsPresent, assertCompileErrorsPresent, assertContents, assertInteractionsContains, assertInteractionsDoesNotContain, assertInteractionsDoesNotMatch, assertInteractionsMatches, assertLength, assertModified, assertNumOpenDocs, changeDocumentText, classForJava, createFile, doCompile, doCompile, getCompilerErrorString, getInteractionsText, interpret, interpretIgnoreResult, safeLoadHistory, safeSaveHistory, saveAllFiles, saveFile, saveFileAs, saveFileCopy, setUp, setupDocument, tearDown, tempDirectory, tempFile, tempFile, testStartCompile, writeToNewTempFile
 
Methods inherited from class edu.rice.cs.drjava.model.MultiThreadedTestCase
join, listenerFail, 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

UNARY_FUN_NON_PUBLIC_INTERFACE_TEXT

protected static final String UNARY_FUN_NON_PUBLIC_INTERFACE_TEXT
See Also:
Constant Field Values

UNARY_FUN_PUBLIC_INTERFACE_TEXT

protected static final String UNARY_FUN_PUBLIC_INTERFACE_TEXT
See Also:
Constant Field Values

UNARY_FUN_NON_PUBLIC_CLASS_TEXT

protected static final String UNARY_FUN_NON_PUBLIC_CLASS_TEXT
See Also:
Constant Field Values

UNARY_FUN_PUBLIC_CLASS_TEXT

protected static final String UNARY_FUN_PUBLIC_CLASS_TEXT
See Also:
Constant Field Values

CLASS_IN_PACKAGE_CLASS_TEXT

protected static final String CLASS_IN_PACKAGE_CLASS_TEXT
See Also:
Constant Field Values

_interpreterOptions

private volatile InteractionsPaneOptions _interpreterOptions

_interpreter

private volatile Interpreter _interpreter

_classPathManager

private volatile ClassPathManager _classPathManager

_interpreterLoader

private volatile ClassLoader _interpreterLoader

_log

private static Log _log
Constructor Detail

InteractionsModelErrorTest

public InteractionsModelErrorTest()
Method Detail

tester

private void tester(Pair<String,Object>[] cases)
             throws InterpreterException
Asserts that the results of interpreting the first of each Pair is equal to the second.

Parameters:
cases - an array of Pairs
Throws:
InterpreterException

interpretDirectly

private Object interpretDirectly(String s)
                          throws InterpreterException
Throws:
InterpreterException

_name

protected String _name()

testInterpretExtendNonPublic

public void testInterpretExtendNonPublic()
                                  throws BadLocationException,
                                         IOException,
                                         InterruptedException,
                                         InterpreterException
Tests that we get the correct 'cannot access its superinterface' error for non-public classes.

Throws:
BadLocationException
IOException
InterruptedException
InterpreterException

testInterpretExtendPublic

public void testInterpretExtendPublic()
                               throws BadLocationException,
                                      IOException,
                                      InterruptedException,
                                      InterpreterException
Tests that we don't get an error for public classes.

Throws:
BadLocationException
IOException
InterruptedException
InterpreterException

testInterpretExtendNonPublicClass

public void testInterpretExtendNonPublicClass()
                                       throws BadLocationException,
                                              IOException,
                                              InterruptedException,
                                              InterpreterException
Tests that we get the correct 'cannot access its superinterface' error for non-public classes.

Throws:
BadLocationException
IOException
InterruptedException
InterpreterException

testInterpretExtendPublicClass

public void testInterpretExtendPublicClass()
                                    throws BadLocationException,
                                           IOException,
                                           InterruptedException,
                                           InterpreterException
Tests that we don't get an error for public classes.

Throws:
BadLocationException
IOException
InterruptedException
InterpreterException

testInterpretGetPackageClass

public void testInterpretGetPackageClass()
                                  throws BadLocationException,
                                         IOException,
                                         InterruptedException,
                                         InterpreterException
Test that we get the right package using getPackage().

Throws:
BadLocationException
IOException
InterruptedException
InterpreterException

testInterpretGetPackageAnonymous

public void testInterpretGetPackageAnonymous()
                                      throws BadLocationException,
                                             IOException,
                                             InterruptedException,
                                             InterpreterException
Test that we get the right package using getPackage() with anonymous inner classes defined in the Interactions Pane.

Throws:
BadLocationException
IOException
InterruptedException
InterpreterException