Ignore:
Timestamp:
01/31/12 01:33:30 (13 years ago)
Author:
masberg
Message:

Update testErrorReporting to comply with current MDT/OMC behaviour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestCompilerProxy.java

    r1071 r1267  
    167167
    168168    /**
    169      * Test that both compile errors and contents are found in a problematic file.
     169     * Test for compile errors in a problematic file.
    170170     */
    171171    public void testErrorReporting()
     
    174174        String[] classes = parseResults.getClasses();
    175175
    176         for(String cls : classes) {
    177             boolean wasRemoved = expectedClasses.remove(cls);
    178 
    179             if (wasRemoved) {
    180                 System.out.println("Removed \"" + cls + "\" from expectedClasses.");
    181             }
    182             else {
    183                 System.out.println("\"" + cls + "\" was not present in expectedClasses.");
    184             }
    185         }
    186 
    187         boolean expectedClassesIsEmpty = expectedClasses.isEmpty();
    188 
    189         String errorMsg = "Could not find following expected classes:";
    190         for (String cls : expectedClasses) {
    191             errorMsg += " " + cls;
    192         }
    193 
    194         assertTrue(errorMsg, expectedClassesIsEmpty);
    195 
    196         ICompileError[] errs = parseResults.getCompileErrors();
    197         assertEquals(7, errs[0].getStartLine());
    198         assertEquals(9, errs[1].getStartLine());
    199         assertEquals(11, errs[2].getStartLine());
    200         assertEquals(14, errs[3].getStartLine());
    201         assertEquals(16, errs[4].getStartLine());
     176        assertTrue(classes.length == 0);
     177
     178        ICompileError[] compileErrors = parseResults.getCompileErrors();
     179        assertTrue(compileErrors.length == 1);
     180        assertTrue(compileErrors[0].getStartLine() == 7);
     181        assertTrue(compileErrors[0].getStartColumn() == 12);
     182        assertTrue(compileErrors[0].getEndLine() == 8);
     183        assertTrue(compileErrors[0].getEndColumn() == 8);
     184        assertTrue(compileErrors[0].getErrorDescription().equals(";"));
    202185    }
    203186
Note: See TracChangeset for help on using the changeset viewer.