edu.rice.cs.drjava.model.compiler
Class CompilerErrorModelTest

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

public final class CompilerErrorModelTest
extends DrJavaTestCase

Tests the CompilerErrorModel.

Version:
$Id: CompilerErrorModelTest.java 5175 2010-01-20 08:46:32Z mgricken $

Nested Class Summary
 
Nested classes/interfaces inherited from class junit.framework.TestCase
TestCase.WrappedException
 
Field Summary
private  DJError[] errors
           
private  java.io.File[] files
           
private  TestDocGetter getter
           
private  CompilerErrorModel model
           
private  java.lang.String[] texts
           
 
Constructor Summary
CompilerErrorModelTest()
           
 
Method Summary
private  void fullSetup()
          Extra setup for test cases with several documents.
private  void setupDoc()
          Setup for test cases with one document.
private  void setupDocs()
          Setup for test cases with several documents.
 void testConstructDoclessErrors()
          Tests CompilerErrorModel setup code with only errors without files.
 void testConstructManyDocsWithBoth()
          Tests CompilerErrorModel setup code with several files and errors both with and without line numbers.
 void testConstructManyDocsWithLineNums()
          Tests CompilerErrorModel setup code with several files and only errors with line numbers.
 void testConstructManyDocsWithoutLineNums()
          Tests CompilerErrorModel setup code with several files and only errors without line numbers.
 void testConstructNoErrors()
          Tests CompilerErrorModel setup code with no compiler errors.
 void testConstructOneDocWithBoth()
          Tests CompilerErrorModel setup code with one file and errors both with and without line numbers.
 void testConstructOneDocWithLineNums()
          Tests CompilerErrorModel setup code with one file and only errors with line numbers.
 void testConstructOneDocWithoutLineNums()
          Tests CompilerErrorModel setup code with one file and only errors without line numbers.
 void testConstructOnlyWarnings()
          Tests CompilerErrorModel setup code with only warnings without files.
 void testErrorsInMultipleDocuments()
           
 void testGetErrorAtOffset()
          Tests CompilerErrorModel.getErrorAtOffset(int).
 void testGetPosition()
          Tests CompilerErrorModel.getPosition(DJError).
 void testHasErrorsWithPositions()
          Tests CompilerErrorModel.hasErrorsWithPositions(OpenDefinitionsDocument).
 
Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase
setConfigSetting, setDocText, setUp, 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

files

private java.io.File[] files

texts

private java.lang.String[] texts

getter

private TestDocGetter getter

errors

private DJError[] errors

model

private CompilerErrorModel model
Constructor Detail

CompilerErrorModelTest

public CompilerErrorModelTest()
Method Detail

testConstructNoErrors

public void testConstructNoErrors()
Tests CompilerErrorModel setup code with no compiler errors.


testConstructOnlyWarnings

public void testConstructOnlyWarnings()
Tests CompilerErrorModel setup code with only warnings without files. Also tests hasOnlyWarnings logic.


testConstructDoclessErrors

public void testConstructDoclessErrors()
Tests CompilerErrorModel setup code with only errors without files.


testConstructOneDocWithoutLineNums

public void testConstructOneDocWithoutLineNums()
Tests CompilerErrorModel setup code with one file and only errors without line numbers.


testConstructOneDocWithLineNums

public void testConstructOneDocWithLineNums()
Tests CompilerErrorModel setup code with one file and only errors with line numbers.


testConstructOneDocWithBoth

public void testConstructOneDocWithBoth()
Tests CompilerErrorModel setup code with one file and errors both with and without line numbers.


testConstructManyDocsWithoutLineNums

public void testConstructManyDocsWithoutLineNums()
Tests CompilerErrorModel setup code with several files and only errors without line numbers.


testConstructManyDocsWithLineNums

public void testConstructManyDocsWithLineNums()
Tests CompilerErrorModel setup code with several files and only errors with line numbers.


testConstructManyDocsWithBoth

public void testConstructManyDocsWithBoth()
Tests CompilerErrorModel setup code with several files and errors both with and without line numbers.


testGetPosition

public void testGetPosition()
Tests CompilerErrorModel.getPosition(DJError).


testGetErrorAtOffset

public void testGetErrorAtOffset()
                          throws java.io.IOException,
                                 OperationCanceledException
Tests CompilerErrorModel.getErrorAtOffset(int).

Throws:
java.io.IOException
OperationCanceledException

testHasErrorsWithPositions

public void testHasErrorsWithPositions()
                                throws java.io.IOException,
                                       OperationCanceledException
Tests CompilerErrorModel.hasErrorsWithPositions(OpenDefinitionsDocument).

Throws:
java.io.IOException
OperationCanceledException

testErrorsInMultipleDocuments

public void testErrorsInMultipleDocuments()
                                   throws java.io.IOException,
                                          OperationCanceledException
Throws:
java.io.IOException
OperationCanceledException

setupDoc

private void setupDoc()
Setup for test cases with one document.


setupDocs

private void setupDocs()
Setup for test cases with several documents.


fullSetup

private void fullSetup()
Extra setup for test cases with several documents.