edu.rice.cs.drjava.model
Class GlobalModelJUnitTest

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.GlobalModelJUnitTest
All Implemented Interfaces:
Test

public final class GlobalModelJUnitTest
extends GlobalModelTestCase

A test of Junit testing support in the GlobalModel.

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

Nested Class Summary
 class GlobalModelJUnitTest.JUnitCompileBeforeTestListener
          Tests that testing an uncompiled but correct group of files will first compile and then run test.
 
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.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
 
Fields inherited from class edu.rice.cs.drjava.DrJavaTestCase
TEST_DRJAVA_CONFIG_PROPERTY
 
Constructor Summary
GlobalModelJUnitTest()
           
 
Method Summary
 void safeJUnitAllWithErrors()
          Tests that junit all works with test cases that do not pass.
 void safeJUnitAllWithNoErrors()
          Tests that junit all works with one or two test cases that should pass.
 void safeJUnitAllWithNoValidTests()
          Verifies that we get a nonTestCase event and that opening a single test file enables testing.
 void safeJUnitStaticInnerClass()
          Tests that junit all works with one or two test cases that should pass.
static Test suite()
          Creates a test suite for JUnit to run.
 void testCorrectFilesAfterIncorrectChanges()
          Tests that when a JUnit file with no errors is compiled and then modified to contain an error does not pass unit testing (by running correct class files).
 void testElspethOneJUnitError()
          Tests that a JUnit file with an error is reported to have an error.
 void testInfiniteLoop()
          Tests that an infinite loop in a test case can be aborted by clicking the Reset button.
 void testNoClassFile()
          Tests a document that has no corresponding class file.
 void testNoJUnitErrors()
          Tests that a JUnit file with no errors is reported to have no errors.
 void testNonTestCaseError()
          Tests that the ui is notified to put up an error dialog if JUnit is run on a non-TestCase.
 void testOneJUnitError()
          Tests that a JUnit file with an error is reported to have an error.
 void testRealError()
          Tests that a test class which throws a *real* Error (not an Exception) is handled correctly.
 void testResultOfNonPublicTestCase()
          Tests that the ui is notified to put up an error dialog if JUnit is run on a non-public TestCase.
 void testUnsavedAndUnCompiledChanges()
          Tests that when a JUnit file with no errors, after being saved and compiled, has it's contents replaced by a test that should fail, will pass all tests.
 
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

GlobalModelJUnitTest

public GlobalModelJUnitTest()
Method Detail

suite

public static Test suite()
Creates a test suite for JUnit to run.

Returns:
a test suite based on the methods in this class

testNoJUnitErrors

public void testNoJUnitErrors()
                       throws Exception
Tests that a JUnit file with no errors is reported to have no errors.

Throws:
Exception

testOneJUnitError

public void testOneJUnitError()
                       throws Exception
Tests that a JUnit file with an error is reported to have an error.

Throws:
Exception

testElspethOneJUnitError

public void testElspethOneJUnitError()
                              throws Exception
Tests that a JUnit file with an error is reported to have an error.

Throws:
Exception

testRealError

public void testRealError()
                   throws Exception
Tests that a test class which throws a *real* Error (not an Exception) is handled correctly.

Throws:
Exception

testNonTestCaseError

public void testNonTestCaseError()
                          throws Exception
Tests that the ui is notified to put up an error dialog if JUnit is run on a non-TestCase.

Throws:
Exception

testResultOfNonPublicTestCase

public void testResultOfNonPublicTestCase()
                                   throws Exception
Tests that the ui is notified to put up an error dialog if JUnit is run on a non-public TestCase.

Throws:
Exception

testNoClassFile

public void testNoClassFile()
                     throws Exception
Tests a document that has no corresponding class file.

Throws:
Exception

testInfiniteLoop

public void testInfiniteLoop()
                      throws Exception
Tests that an infinite loop in a test case can be aborted by clicking the Reset button.

Throws:
Exception

testUnsavedAndUnCompiledChanges

public void testUnsavedAndUnCompiledChanges()
                                     throws Exception
Tests that when a JUnit file with no errors, after being saved and compiled, has it's contents replaced by a test that should fail, will pass all tests.

Throws:
Exception

safeJUnitAllWithNoValidTests

public void safeJUnitAllWithNoValidTests()
                                  throws Exception
Verifies that we get a nonTestCase event and that opening a single test file enables testing.

Throws:
Exception

safeJUnitAllWithNoErrors

public void safeJUnitAllWithNoErrors()
                              throws Exception
Tests that junit all works with one or two test cases that should pass.

Throws:
Exception

safeJUnitAllWithErrors

public void safeJUnitAllWithErrors()
                            throws Exception
Tests that junit all works with test cases that do not pass.

Throws:
Exception

safeJUnitStaticInnerClass

public void safeJUnitStaticInnerClass()
                               throws Exception
Tests that junit all works with one or two test cases that should pass.

Throws:
Exception

testCorrectFilesAfterIncorrectChanges

public void testCorrectFilesAfterIncorrectChanges()
                                           throws Exception
Tests that when a JUnit file with no errors is compiled and then modified to contain an error does not pass unit testing (by running correct class files).

Throws:
Exception