My favorites | Sign in
Project Home Downloads Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Annotations  

Phase-Requirements, 2.0
Updated Feb 4, 2010 by virtix

List of annotations to consider for MXUnit 2.0

Syntax will be as follows:

 mxunit:AnnotationName="annotation parameters" 

Annotations maybe should be broken up into 2 (or more) categories:

  1. Configuration annotations - these would control how tests are structured with respect to each other. In other words, this would determine the order in which tests are to be run. Note that some of these may also be event type annotations. (to do). If not sorting suites with test methods ... maybe could call eventhandler ???
  2. Behavioral annotations - these would not affect the test order, but, rather, would affect how a test is run and, possibly, how it behaves.

Configuration Annotations

  • mxunit:BeforeSuite="executes this methods before the testsuite has run"
  • mxunit:AfterSuite="executes this methods after the testsuite has run"
  • mxunit:BeforeTest="executes this methods after the test has executed; ie. setup()"
  • mxunit:AfterTest="executes this methods after the test has executed; ie. teardown()"
  • mxunit:BeforeComponent="executes this methods before the CFC has executed"
  • mxunit:AfterComponent="executes this methods after the CFC has executed"
  • mxunit:Depends="ordered,list"
  • mxunit:Group="list of group names to which this test belongs"

note: it's unclear how to address potential conflicts ... (to do)

Behavioral Annotations

  • mxunit:DataProvider="datastructure or method that returns one"
  • mxunit:Test="enabled|disabled" (enabled == DEFAULT)
  • mxunit:ExpectFailure="list of exeptions - test must fail with any one of the exceptions"
  • mxunit:Parameters="name=value,name2=value2,..." - allows a test method to accept parameters. (to do)
Comment by project member virtix, Jan 26, 2009

Thinking about the language for the Groups annotation ... would it be better received, or understood, if we used the term "tags" instead? The concept of tagging seems to be widely adopted and may be more intuitive. We could also have both. Personally, I like "tags" better, as this fits in with modern blogging, wikis, mail, other content, etc..

Example:

<cffunction name="myTest" mxunit:tags="foo,bar">

...
</cffunction>

Powered by Google Project Hosting