Loading ...
Sorry, an error occurred while loading the content.
 

startTest(...)/endTest(...)... does what?

Expand Messages
  • MiChAeL xEnAkIs
    Hey JUniter s - Still in the preliminary stages of investigating the various functional aspects of the JUnit framework(s) and have come across the following
    Message 1 of 1 , Nov 1, 2001
      Hey JUniter's -
       
      Still in the preliminary stages of investigating the various functional aspects of the JUnit framework(s) and have come across the following question(s).
       
      I'm using the TestResult(s) object to gather results as I go - given the assumption that a failure early in the test may not invalidate code-execution later in the test.  (I know, such an assumption begs for refactoring, but let us ignore that fact for a moment. ;-)
       
      I've added a TestResult(s) instance variable to my TestCase fixture, which I use in each of the Test(s) for gather results.  The TestResult API says the following for these two methods:
      startTest(Test t) - Informs the result that a test will be started.
      endTest(Test t) - Informs the results that a test was completed.
       
      What precisely does this mean, and what effect does this have on the results (failures, errors, etc.) which the result compiles during execution of the test(s)?
       
      I'm trying various test runs, some which call start/endTest(...) multiple times, some only once, and some which don't call these at all.  Ultimately, however, I see no difference in the output of my tests when executed.
       
      Further, the errros/failures reported when the fixture finishes execution seems to ignore the TestResult object which I've created and am using.  I.e., in the case of multi-failures/errors in a single test, I add them all to my TestResult instance, however, the end results - e.g. when a single test has more than one assertEquals(...) failure - will only report the last failure it encounters (which kinda makes sense, as there would, otherwise, possibly be more failures listed than the actual number of tests.)
       
      Am I simply trying to misuse the TestResult(s) object?
       
      thanks for any info on this
      mx.
       
      "When a relationship is not built on mutual respect,
       the only way of maintaining control is through brutal force."
       -- Roger Fouts
    Your message has been successfully submitted and would be delivered to recipients shortly.