[Pharo-project] [COTDC] 51 - TestCaseAnnouncement

Alexandre Bergel alexandre.bergel at me.com
Tue Apr 19 22:38:45 CEST 2011


I should be able to easily answer this one :)

-=-=-=-=-=-=-=-=-=-=-=-=
I am the root of the announcement class hierarchy to monitor test execution. One can subscribe to it by simply registering on the announcer of the unit test. As an example on how to use me, open a transcript and doit the following:
  BehaviorTest announcer on: TestCaseAnnouncement do: [ :ann | Transcript show: ann testCase printString; cr].
  BehaviorTest buildSuite run.
  BehaviorTest resetAnnouncer.
-=-=-=-=-=-=-=-=-=-=-=-=

For TestCaseEnded:
-=-=-=-=-=-=-=-=-=-=-=-=
I am emitted after the execution of each unit test. As an example on how to use me, open a transcript and doit the following:
  BehaviorTest announcer on: TestCaseEnded do: [ :ann | Transcript show: ann testCase printString; cr].
  BehaviorTest buildSuite run.
  BehaviorTest resetAnnouncer.
-=-=-=-=-=-=-=-=-=-=-=-=

For TestCaseStarted: 
-=-=-=-=-=-=-=-=-=-=-=-=
I am emitted before the execution of each unit test. As an example on how to use me, open a transcript and doit the following:
  BehaviorTest announcer on: TestCaseEnded do: [ :ann | Transcript show: ann testCase printString; cr].
  BehaviorTest buildSuite run.
  BehaviorTest resetAnnouncer.
-=-=-=-=-=-=-=-=-=-=-=-=

Cheers,
Alexandre


On 19 Apr 2011, at 15:22, laurent laffont wrote:

> Today:  TestCaseAnnouncement
> 
> 
> Comment Of The Day Contest - One Day One Comment
> Rules: 
> #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
> #2: If you cannot comment it, deprecate it.
> Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
> 
> Laurent

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.








More information about the Pharo-project mailing list