From: SourceForge.net <no...@so...> - 2009-12-01 02:20:35
|
Feature Requests item #1267495, was opened at 2005-08-23 22:01 Message generated for change (Comment added) made by sf-robot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=365278&aid=1267495&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: Neil Swingler (neil_swingler) Assigned to: David Saff (dsaff) Summary: Generic way to decorate a test case Initial Comment: This is in part inspired by Robert Watkins post on the junit yahoo group about junit 4: http://groups.yahoo.com/group/junit/message/13909 Many junit extensions come with their own subclass of TestCase (e.g. JMock) unfortunately this means they cannot be combined due to the single inheritence of classes. The solution to this is to use decorators but that means manually constructing test suites. I came up with a base class for decoratable test cases based on the 3.81 code base: http://cvs.sourceforge.net/viewcvs.py/jisolate/jisolate/src/net/sourceforge/jisolate/junit/DecorateableTestCase.java?view=markup The current architecture for junit4 would defeat this. The main reason for dropping the Test interface and decorator pattern is supposed to be to enable IDE runners to rerun a single test without worrying about decorators which may have been installed at the suite level. However, having a hook to install decorators at the individual test level would not complicate the runner. Examples of the sorts of decorators I would like to install include - Installing a custom classloader to allow sophisticated mocking or isolation of static variables - Waiting for all spawned threads to terminate before completing the test - Timing out a test (although this is already covered in JUnit 4) ---------------------------------------------------------------------- >Comment By: SourceForge Robot (sf-robot) Date: 2009-12-01 02:20 Message: 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: 2009-11-16 17:52 Message: This tracker is being shut down. Please move this item to http://github.com/KentBeck/junit/issues ---------------------------------------------------------------------- Comment By: Chris Long (aclong) Date: 2006-05-18 15:25 Message: Logged In: YES user_id=649710 Another decorator I'd like to use is for tests that are allowed to fail a certain percentage of the time (for example, network messaging that has to have latency < x for at least y% of messages). It would be most flexible to be able to annotate individual test methods, but would probably be adequate for us to be able to set this at the class level. ---------------------------------------------------------------------- Comment By: Jogi (jgottschling) Date: 2005-10-07 10:43 Message: Logged In: YES user_id=1275777 It would also be nice to have a @Decorate Attribut wich can be use to decorate the complete class (the resulting TestSuite) or a single Test with one or more Decorators. But I think this would need a TestDecorator Interface or something like this. Perhaps a Convention like "must probide a public constructor which takes a Test as single argument" would do the Job. Or TestDecoratorFactory could be used. But something very simple. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=365278&aid=1267495&group_id=15278 |