Changeset 14254


Ignore:
Timestamp:
Dec 2, 2019 5:25:42 PM (4 days ago)
Author:
jwedin
Message:

Changed so ExceptionTestCase inherits from TestCase. Converted the testException method to a void method. Fixed so exceptions thrown from compilations steps other than transform canonical are caught as well. #5720

Location:
branches/dev-cw-ii/Compiler/TestFramework/src/jastadd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-ii/Compiler/TestFramework/src/jastadd/ExceptionTestCase.jrag

    r14251 r14254  
    11
    2 public class ExceptionTestCase extends TransformCanonicalTestCase {
     2public class ExceptionTestCase extends TestCase {
    33    private String expectedException;
    44
    55    /**
    66     * Performs tests on a thrown exception (except for a CompilerException which is not caught).
    7      *
    8      * @return  {@code true} if the test case should stop after this method.
    97     */
    108    @Override
    11     protected boolean testException(Exception e) {
     9    protected void testException(Exception e) {
    1210        if (e == null) {
    1311            fail("Expected an " + expectedException + " to be thrown!");
     
    1614            compareResult("Exception type does not match expected.", expectedException, test);
    1715        }
    18         return true;
    1916    }
    2017
  • branches/dev-cw-ii/Compiler/TestFramework/src/jastadd/TestCase.jrag

    r14251 r14254  
    562562        try {
    563563            performTest(uif);
     564        } catch(Exception e) {
     565            testException(e);
    564566        } finally {
    565567            uif.tearDown();
     
    628630       
    629631       
    630         Exception testMe = null;
    631632        // Transform canonical and check for errors again
    632633        try {
     
    636637        } catch (CompilerException e) {
    637638            problems = e.getProblems();
    638         } catch (Exception e) {
    639             testMe = e;
    640         }
    641 
    642         if (testException(testMe)) {
    643             return;
    644639        }
    645640
     
    704699    /**
    705700     * Performs tests on a thrown exception (except for a CompilerException which is not caught).
    706      *
    707      * @return  {@code true} if the test case should stop after this method.
    708      */
    709     protected boolean testException(Exception e) {
    710         return false;
     701     */
     702    protected void testException(Exception e) {
    711703    }
    712704
Note: See TracChangeset for help on using the changeset viewer.