You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Darren McGrath <da...@mail.com> on 2002/12/20 12:55:54 UTC

[jelly] [PATCH] Added fixture (setUp and tearDown) attributes to SuiteTag

I've been using jelly and snooping on the mail list for a few weeks now. here's my first patch.

I've implemented junit fixtures by adding setUp and tearDown Script type attributes to the SuiteTag. attached is the patch file for the code and test cases. Please consider for inclusion in Jelly.

Here's a snippet to show how it works ...

<define:script var="setUpScript">
  <!-- fixture setUp script goes here -->
</define:script>

<define:script var="tearDownScript">
  <!-- fixture tear-down script goes here -->
</define:script>

<!--
  || @setUp is called before each test:case.
  || @tearDown is called after each test:case.
  || @setUp and @tearDown run in the same context as the test:case.
-->
<test:suite setUp="${setUpScript}" tearDown="${tearDownScript}">
  <test:case name="testcase">
    <!-- test case script  ..... -->
  </test:case>
</test:suite>

I looked at a number of ways of getting fixtures in to the junit jelly tags. I settled on the above as it's pretty neat and doesn't involve any new tags.

If there's a better approach that i've missed i'd be happy to discuss/code it/try it out.

cheers

Darren McGrath
-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Meet Singles
http://corp.mail.com/lavalife