edu.rice.cs.drjava.model
Class GlobalModelCompileErrorsTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
edu.rice.cs.drjava.DrJavaTestCase
edu.rice.cs.drjava.model.MultiThreadedTestCase
edu.rice.cs.drjava.model.GlobalModelTestCase
edu.rice.cs.drjava.model.GlobalModelCompileErrorsTest
- All Implemented Interfaces:
- Test
public final class GlobalModelCompileErrorsTest
- extends GlobalModelTestCase
Tests to ensure that compilation fails when expected, and that the errors
are reported correctly.
Every test in this class is run for *each* of the compilers that is available.
- Version:
- $Id: GlobalModelCompileErrorsTest.java 4691 2008-12-02 23:33:27Z dlsmith $
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 |
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 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 |
GlobalModelCompileErrorsTest
public GlobalModelCompileErrorsTest()
testCompileAllFailsDifferentSourceRoots
public void testCompileAllFailsDifferentSourceRoots()
throws BadLocationException,
IOException,
InterruptedException
- Tests calling compileAll with different source roots works if the files have errors in them. (Each file
has 1 error.)
Note that this testcase will fail if several compilers can be found through the .drjava file.
As the test is then run one time per compiler it can find.
- Throws:
BadLocationException
IOException
InterruptedException
testCompilePackageAsField
public void testCompilePackageAsField()
throws BadLocationException,
IOException,
InterruptedException
- Creates a source file with "package" as a field name and ensures that compile starts but fails due to
the invalid field name.
- Throws:
BadLocationException
IOException
InterruptedException
testCompilePackageAsField2
public void testCompilePackageAsField2()
throws BadLocationException,
IOException,
InterruptedException
- Creates a source file with "package" as a field name and ensures that compile starts but fails due to the
invalid field name. This is different from
testCompilePackageAsField()
as it initializes the field.
- Throws:
BadLocationException
IOException
InterruptedException
testCompileMissingCloseCurly
public void testCompileMissingCloseCurly()
throws BadLocationException,
IOException,
InterruptedException
- Tests compiling an invalid file and checks to make sure the class file was not created.
- Throws:
BadLocationException
IOException
InterruptedException
testCompileWithPackageStatementInsideClass
public void testCompileWithPackageStatementInsideClass()
throws BadLocationException,
IOException,
InterruptedException
- Puts an otherwise valid package statement inside a class declaration. This better not work!
- Throws:
BadLocationException
IOException
InterruptedException
testCompileFailsCorrectLineNumbers
public void testCompileFailsCorrectLineNumbers()
throws BadLocationException,
IOException,
InterruptedException
- Tests the compiler errors have the correct line numbers.
TODO: rewrite this test for the new error model interface
- Throws:
BadLocationException
IOException
InterruptedException