edu.rice.cs.drjava.model
Class GlobalModelCompileSuccessOptionsTest

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.GlobalModelCompileSuccessTestCase
                          extended by edu.rice.cs.drjava.model.GlobalModelCompileSuccessOptionsTest
All Implemented Interfaces:
Test

public final class GlobalModelCompileSuccessOptionsTest
extends GlobalModelCompileSuccessTestCase

Tests to ensure that compilation succeeds when expected. Every test in this class is run for *each* of the compilers that is available.

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

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.TestGlobalModel, GlobalModelTestCase.TestListener, GlobalModelTestCase.WarningFileSelector
 
Field Summary
 
Fields inherited from class edu.rice.cs.drjava.model.GlobalModelCompileSuccessTestCase
FOO_NON_PUBLIC_CLASS_TEXT, FOO_PACKAGE_AS_PART_OF_FIELD, FOO_WITH_ASSERT, FOO_WITH_GENERICS, FOO2_EXTENDS_FOO_TEXT, FOO2_REFERENCES_NON_PUBLIC_CLASS_TEXT
 
Fields inherited from class edu.rice.cs.drjava.model.GlobalModelTestCase
_doc, _interactionsController, _log, _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_INSIDE_CLASS, FOO_TEXT
 
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
GlobalModelCompileSuccessOptionsTest()
           
 
Method Summary
 void testCompileReferenceToNonPublicClass()
          Tests a compile on a file that references a non-public class defined in another class with a name different than the non-public class.
 void testCompileWithGenerics()
          Tests compiling a file with generics works with generic compilers.
 void testCompileWithJavaAssert()
          Test support for assert keyword if enabled.
 
Methods inherited from class edu.rice.cs.drjava.model.GlobalModelCompileSuccessTestCase
_isGenericCompiler, _name
 
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, setUp, setupDocument, tearDown, tempDirectory, tempFile, tempFile, testStartCompile, writeToNewTempFile
 
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
 

Constructor Detail

GlobalModelCompileSuccessOptionsTest

public GlobalModelCompileSuccessOptionsTest()
Method Detail

testCompileReferenceToNonPublicClass

public void testCompileReferenceToNonPublicClass()
                                          throws BadLocationException,
                                                 IOException,
                                                 InterruptedException
Tests a compile on a file that references a non-public class defined in another class with a name different than the non-public class. Doesn't reset interactions because no interpretations are performed.

Throws:
BadLocationException
IOException
InterruptedException

testCompileWithJavaAssert

public void testCompileWithJavaAssert()
                               throws BadLocationException,
                                      IOException,
                                      InterruptedException
Test support for assert keyword if enabled. Note that this test only runs in Java 1.4 or higher. Doesn't reset interactions because no interpretations are performed.

Throws:
BadLocationException
IOException
InterruptedException

testCompileWithGenerics

public void testCompileWithGenerics()
                             throws BadLocationException,
                                    IOException,
                                    InterruptedException
Tests compiling a file with generics works with generic compilers. (NOTE: this currently tests the GJ compiler, but not JSR-14... JSR-14 is only available if the config option is set, and we clear the config before running the tests. We have a guess where the jar is -- the lib directory -- but how can we get a URL for that?)

Throws:
BadLocationException
IOException
InterruptedException