From: SourceForge.net <no...@so...> - 2008-05-04 18:34:50
|
Feature Requests item #1447312, was opened at 2006-03-10 07:56 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=365278&aid=1447312&group_id=15278 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Jochen Hiller (jhiller) Assigned to: David Saff (dsaff) Summary: Add @Prerequisite annotation for a test case Initial Comment: Test cases can be dependent on prerequisites, e.g. be online in Internet, have a database available, have database filled with specific test data, etc. In these cases it can be very annoying to @Ignore the test cases, because it may be different for each run or day. For this requirement, the @Prerequisite annotation can be used. Each test case marked with @Prerequisite will be checked, whether the condition is fulfilled. If not, the test case will be marked as ignored. For example: @Prerequisite (requires="isDBAvailable") @Test public void doDBTest() { ... } The method isDBAvailable must be implemented with following signature: - must be callable from TestRunner, so must be public. - must be callable either from tested object, or from a static helper class. - must return a boolean value. For example: public boolean isDBAvailable() { boolean available = ...; return available; } This method can also be provided by a static helper class, when specifiying a callee attribute to annotation. For example: @Prerequisite (requires="isDBAvailable", _callee=DBHelper.class) @Test public void doDBTest() { ... } public class DBHelper { public static boolean isDBAvailable() { boolean available = ...; return available; } } There are two open design questions: 1) @Prerequisite can also be made an extension to @Ignore eg. @Ignore (values="Check for database available", requires="isDBAvailable") 2) Current implementation handles a not fulfilled prerequisite as specified with @Ignore. Means, you cannot later distinguish between @Ignore and @Prerequisite runs. I provide a patch with the complete implementation. This has been inspired by a home-brewed JUnit 3.8.1 extension, where prerequisited will be also handled as AssertFailures, but extendes TestRunners are capable to filter them out. If useful, I could also provide patches for JUnit 3. Bye, Jochen Hiller ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-05-04 11:34 Message: Logged In: NO zK06sr [url=http://groups.google.com/group/LeahOwens-qnr/web/download-ringtone-mp3.html]download ringtone mp3[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/free-ringtone-tones.html]free ringtone tones[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/free-ringtones-lg.html]free ringtones lg[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/free-ringtones-nextel.html]free ringtones nextel[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/mp3-ringtone-phone.html]mp3 ringtone phone[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/phone-ringtone-send.html]phone ringtone send[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtone-bluetooth.html]ringtone bluetooth[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtone-mp3-download.html]ringtone mp3 download[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtone-wav.html]ringtone wav[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-2.html]ringtones 2[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-boost.html]ringtones boost[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-converter.html]ringtones converter[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-file.html]ringtones file[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-for-blackberry.html]ringtones for blackberry[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-mac.html]ringtones mac[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-maker.html]ringtones maker[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-on-iphone.html]ringtones on iphone[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-usb.html]ringtones usb[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/ringtones-wallpapers.html]ringtones wallpapers[/url] [url=http://groups.google.com/group/LeahOwens-qnr/web/send-ringtone-phone.html]send ringtone phone[/url] ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-05-01 12:00 Message: Logged In: NO rAEjiJ <a href="http://pxwypcdmjbro.com/">pxwypcdmjbro</a>, [url=http://ctzmhweywjxg.com/]ctzmhweywjxg[/url], [link=http://wnqpnxjzxklk.com/]wnqpnxjzxklk[/link], http://agcgvmfzfncw.com/ ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-04-12 07:49 Message: Logged In: NO BamlD8 <a href="http://tjjdqsiyawxl.com/">tjjdqsiyawxl</a>, [url=http://fnnnlpqezaix.com/]fnnnlpqezaix[/url], [link=http://uovhacucwoqw.com/]uovhacucwoqw[/link], http://dbgyeczhbrvd.com/ ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-04-05 12:03 Message: Logged In: NO X4T9aa http://googlaaaa.com/ ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-04-05 04:52 Message: Logged In: NO zU4dYF hi nice site thanks http://peace.com ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-12-24 13:41 Message: Logged In: NO DzxEb6 <a href="http://zryksyohocfo.com/">zryksyohocfo</a>, [url=http://bswncveiavmn.com/]bswncveiavmn[/url], [link=http://nkrczhaqadyy.com/]nkrczhaqadyy[/link], http://wvjjopknhfsm.com/ ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-12-13 06:32 Message: Logged In: NO mDUrp6 <a href="http://tpmushdxwbud.com/">tpmushdxwbud</a>, [url=http://hgpymhakzsam.com/]hgpymhakzsam[/url], [link=http://mfcgzbgwucfp.com/]mfcgzbgwucfp[/link], http://buqkwpccrgow.com/ ---------------------------------------------------------------------- Comment By: Jochen Hiller (jhiller) Date: 2006-10-16 04:57 Message: Logged In: YES user_id=89401 Closed now again. ---------------------------------------------------------------------- Comment By: Jochen Hiller (jhiller) Date: 2006-10-16 04:56 Message: Logged In: YES user_id=89401 As agreed by David, created two new feature requests: - Description does not allow access to metadata via reflection http://sourceforge.net/tracker/?func=detail&aid=1569263&group_id=15278&atid=365278 - Filter / Sorter do NOT have access to current test object http://sourceforge.net/tracker/?func=detail&aid=1569265&group_id=15278&atid=365278 Open a thread on JUnit developers mailing list. ---------------------------------------------------------------------- Comment By: SourceForge Robot (sf-robot) Date: 2006-10-14 19:20 Message: Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: David Saff (dsaff) Date: 2006-09-30 11:25 Message: Logged In: YES user_id=325156 Moving the discussion makes sense to me. Would you like to open a thread? Also, could you log the two issues from your latest comment as new feature requests, so we can work on them separately? Thanks. ---------------------------------------------------------------------- Comment By: Jochen Hiller (jhiller) Date: 2006-09-30 03:15 Message: Logged In: YES user_id=89401 I realized now a different approach, using Filter and Sorter interfaces (hint from Kent Beck). It was possible to implement this @Prerequisite requirement based on own Annotations and a custom runner. For details see http://www.junitext.org, download latest version. I had some design issues during implementation: - Description does not allow access to metadata, e.g. check, whether an own annotation is attached to a test method. Hack: parse string based representation, but very ugly - when calling a filter or sorter, there is no access to the current test object. So, I would not be able to call an instance based method on a test object. To solve this issue, I implemented a custom runner, which has to be attached via @RunWith(AnnotationRunner.class), which checks for own annotations. Could be a template for a general AnnotationSupportingRunner, where own annotations could be registered for examples (the current version is hardcoded). I would be happy to share my thoughts. Should we move discussion to junit-dev mailing list ? ---------------------------------------------------------------------- Comment By: David Saff (dsaff) Date: 2006-09-29 06:40 Message: Logged In: YES user_id=325156 I'd like to check out the patch to see if the custom runner support could be enhanced to support this kind of extension--that way, we could play with several different implementations that evolve independently of JUnit. Then, if a standard implementation emerges, we could think about including it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=365278&aid=1447312&group_id=15278 |