List Info

Thread: Re: Re: 4.5 release candidate




Re: Re: 4.5 release candidate
country flaguser name
United States
2008-06-30 15:29:04

Thanks--it looks about as good as I'd hoped!

David Saff

On Mon, Jun 30, 2008 at 10:55 AM, Nat Pryce < nat.pryce%40gmail.com">nat.prycegmail.com> wrote:
&gt; It's in the jmock2-junit4.5 branch in the jMock subversion repository.
>
> Branch URL: http://svn.codehaus.org/jmock/branches/jmock2-junit4.5
>;
> The test runner itself, in FishEye:
> http://svn.jmock.codehaus.org/browse/jmock/branches/jmock2-junit4.5/src/org/jmock/integration/junit4/JMock.java
>
&gt; --Nat
&gt;
> 2008/6/30 David Saff < david%40saff.net">davidsaff.net&gt;:
>
>> Nat,
>;>
>;> Would you mind sharing the source? Is it checked in? I'm curious to
>&gt; see it. Thanks,
>>
>> David Saff
>;>
>;> On Wed, Jun 25, 2008 at 8:09 AM, Nat Pryce < nat.pryce%40gmail.com">nat.prycegmail.com> wrote:
&gt;>> It works fine. The new JMock test runner now passes all its tests.
&gt;>>
>>> Thanks,
>>>; --Nat.
&gt;>>
>>> 2008/6/24 David Saff < david%40saff.net">davidsaff.net&gt;:
>>>
>>>;> Nat,
>;>>&gt;
>&gt;>> Good suggestion. It's implemented in the new JUnit 4.5 beta 2, now
>>>>; available for download. Let me know if it makes things better.
>>>;>
>;>>&gt; David Saff
>;>>&gt;
>&gt;>> On Sat, Jun 21, 2008 at 2:47 PM, Nat Pryce < nat.pryce%40gmail.com">nat.prycegmail.com> wrote:
&gt;>>>> I've found a serious limitation with the new API: there's no easy way
>>>>;> to insert a statement into the chain of decorators so that it gets
>;>>&gt;> access to the test object.
>>>;>>
>>&gt;>> I originally inserted jMock's verification step after the test method
&gt;>>>> was invoked, by overriding invoke(...) and wrapping my own Statement
>>&gt;>> around that returned by super.invoke(...). That was easy because
>>>;>> invoke is passed the test object.
>>>;>>
>>&gt;>> However, it doesn't work: if the test throws an expected exception,
>>>>>; the verification is not performed.
>>>>>;
>>;>>&gt; Therefore, I need to insert jMock's verification after the check for
>>>>;> an expected exception. But the possiblyExpectingExceptions method is
>&gt;>>> not passed the test object. It is therefore impossible to implement
>>&gt;>> what I want without duplicating the implementation of
>&gt;>>> BlockJUnit4ClassRunner.childBlock, which is quite a big method and
>>>>;> doesn't seem to be a clean extension point.
&gt;>>>>
>>>;>> One possible fix is, I think, for every factory method that creates a
>&gt;>>&gt; Statement to have the same parameters: the test object, the test
>;>>&gt;> method and, if applicable, the next link in the chain of Statements.
>>;>>&gt;
>&gt;>>&gt; --Nat
&gt;>>&gt;>
&gt;>>>> 2008/6/19 nat_pryce < nat.pryce%40gmail.com">nat.prycegmail.com>:
&gt;>>&gt;>> One other uncertainty I had with the new API. BlockJUnit4TestRunner
>>;>>&gt;> has two constructors, one which takes a TestClass and one which takes
&gt;>>&gt;>> a Class delegates to the former.
>>>;>>&gt;
>&gt;>>&gt;> Why two?
>;>>&gt;>>
>>&gt;>>> Which should I override for my subclass? That is, which does the
>>>>;>> framework use to create a test-runner?
>&gt;>>&gt;>
&gt;>>>>>; --Nat
&gt;>>&gt;>>
>>>>>;> --- In junit%40yahoogroups.com">junityahoogroups.com, "Kent Beck" <kentb...> wrote:
&gt;>>>>>;>
>;>>&gt;>>&gt; Nat,
>;>>&gt;>>&gt;
>&gt;>>>>>; I'm glad the new format worked better for you. BlockJUnit4TestRunner
>>;>>&gt;> and its
>>>>;>>&gt; supporting cast are intended to be published in the next release.
>>&gt;>>&gt; However,
>>&gt;>>&gt;> they are new enough that we wanted to verify their efficacy and give
>;>>&gt;>>&gt; ourselves a chance to refine them before many people used them.
&gt;>>&gt;>>>
>>>>;>>&gt; Point well taken on the redundancy of deprecation and moving the
>>>>;>> classes.
>>&gt;>>&gt;> We'll move them back before releasing. We will compile the final
&gt;>>&gt;>>> release
>>>;>>&gt;> with Java 5 as well.
&gt;>>&gt;>>>
>>>>;>>&gt; Thank you very much for the feedback.
>>&gt;>>>>
>>>;>>&gt;> Regards,
>>&gt;>>&gt;>
&gt;>>>>>;> Kent Beck
>;>>&gt;>>&gt; Three Rivers Institute
>>&gt;>>>>
>>>;>>&gt;> _____
&gt;>>&gt;>>>
>>>>;>>&gt; From: junit%40yahoogroups.com">junityahoogroups.com [mailto: junit%40yahoogroups.com">junityahoogroups.com] On Behalf
&gt;>>>>>;> Of
>&gt;>>>>>; nat_pryce
>>&gt;>>>> Sent: Thursday, June 19, 2008 3:16 AM
>&gt;>>>>>; To: junit%40yahoogroups.com">junityahoogroups.com
&gt;>>>>>;> Subject: [junit] Re: 4.5 release candidate
>>&gt;>>>>
>>>;>>&gt;>
&gt;>>&gt;>>>
>>>>;>>&gt; I've ported the jMock runner over to the new structure. Here are some
>;>>&gt;>>&gt; comments on the experience.
>>;>>&gt;>>
>>&gt;>>>> I extended BlockJUnit4ClassRunner and override the invoke(...) method
&gt;>>>>>;> to verify the mock objects after the test has run, but before
&gt;>>>>>;> tear-down.
>>>>>;>>
>>&gt;>>&gt;> This way reduces the amount of code in the custom runner. I also
>;>>&gt;>>&gt; didn't have to duplicate existing functionality because the invoke
&gt;>>>>>;> method let me hook in at the right point.
&gt;>>>>>;>
>;>>&gt;>>&gt; However, I still had to use classes in the org.junit.internal
>>>;>>&gt;> package,
>>&gt;>>&gt;> which feels wrong. Have I missed the right way of doing this?
&gt;>>&gt;>>>
>>>>;>>&gt; Other niggles...
>>>>>;>>
>>&gt;>>&gt;> - The classes are compiled for Java 6 only, but only seem to need
>;>>&gt;>>&gt; language features from 5 and above. Can the release be compiled for
>>>>;>>&gt; Java 5?
>&gt;>>>>>;
>>;>>&gt;>> - The JUnit 4.4 classes have been deprecated *and* moved to another
>>>;>>&gt;> package, which breaks any code that used them. There's no point in
>&gt;>>>>>; doing both. Either break backward compatability or keep backward
>>&gt;>>&gt;> compatability and deprecate the classes. I'd prefer the latter, since
&gt;>>&gt;>>> it will allow me to do a jMock with new features supporting both
>;>>&gt;>>&gt; JUnit
&gt;>>&gt;>>> 4.4 and 4.5 and then release a version that brings support forward to
>&gt;>>>>>; 4.5 onwards.
>>&gt;>>&gt;>
&gt;>>>>>;> Cheers,
>>>;>>&gt;> --Nat.
&gt;>>>>>;>
>;>>&gt;>>&gt; --- In junityahoogroups. <mailto:junit%40yahoogroups.com> com, "Nat
>>&gt;>>> Pryce";
>>;>>&gt;>> <nat.pryce> wrote:
&gt;>>>>>;> >
>;>>&gt;>>&gt; > JUnit 4.5 breaks jMock 2 because the TestMethod class has been
>;>>&gt;>>&gt; > moved
&gt;>>&gt;>>> > to a different package.
>>&gt;>>&gt;> >
>;>>&gt;>>&gt; > It's our fault for subclassing JUnit4ClassRunner, but it would be
>&gt;>>>>>; > nice
>;>>&gt;>>&gt; > if JUnit4ClassRunner did not change at all in this release.
>>&gt;>>&gt;> >
>;>>&gt;>>&gt; > --Nat
&gt;>>&gt;>>> >
>;>>&gt;>>&gt; > 2008/6/16 Kent Beck <kentb>:
&gt;>>&gt;>>> > > All,
>;>>&gt;>>&gt; > >
>;>>&gt;>>&gt; > > Following our discussions last week, we have incorporated the old
>>>>;>>&gt; > > JUnit4ClassRunner into 4.5. (The new runner is called
&gt;>>>>>;> BlockJUnit4ClassRunner
>&gt;>>&gt;>> > > because it is organized as a "block" of "statements"; instead of
>&gt;>>>> nested
&gt;>>>>>;> > > procedures). Those of you who have written custom runners, we'd
>;>>&gt;>>&gt; appreciate
>>>>>;>> > > it if you could try out the release candidate to make sure it
>&gt;>>>>>; supports your
>;>>&gt;>>&gt; > > existing runners.
>>&gt;>>&gt;> > >
>;>>&gt;>>&gt; > > Next up, release notes and then out the door!
&gt;>>&gt;>>> > >
>;>>&gt;>>&gt; > > Whew!
&gt;>>&gt;>>> > >
>;>>&gt;>>&gt; > > Kent Beck
>;>>&gt;>>&gt; > > Three Rivers Institute
>>&gt;>>>> > >
>;>>&gt;>>&gt; > >
>;>>&gt;>>&gt; >
>;>>&gt;>>&gt;
>&gt;>>>>>;
>>;>>&gt;>>
>>&gt;>>>>
>>>;>>&gt;>
&gt;>>&gt;>>>
>>>>;>>&gt; [Non-text portions of this message have been removed]
>>&gt;>>&gt;>
&gt;>>>>>;
>>;>>&gt;>
&gt;>>&gt;>
&gt;>>>> ------------------------------------
&gt;>>>>
>>>;>> Yahoo! Groups Links
&gt;>>&gt;>
&gt;>>>>
>>>;>>
>>&gt;>>
>>&gt;>
&gt;>>
>>
>

__._,_.___
.

__,_._,___
Re: Re: 4.5 release candidate
country flaguser name
United States
2008-07-01 09:01:23

Are you planning to leave the block test runner in an internal
package? Or will you move to a public package before release? Or in
a future release?

If you intend to move it at some time, it would be easiest for me if
you move it before the 4.5 release, so I don't have to change jMock to
track JUnit releases.

--Nat

2008/6/30 David Saff < david%40saff.net">davidsaff.net&gt;:
> Thanks--it looks about as good as I'd hoped!
&gt;
> David Saff
>;
> On Mon, Jun 30, 2008 at 10:55 AM, Nat Pryce < nat.pryce%40gmail.com">nat.prycegmail.com> wrote:
&gt;> It's in the jmock2-junit4.5 branch in the jMock subversion repository.
>>;
>>; Branch URL: http://svn.codehaus.org/jmock/branches/jmock2-junit4.5
>;>
>;> The test runner itself, in FishEye:
>>
>> http://svn.jmock.codehaus.org/browse/jmock/branches/jmock2-junit4.5/src/org/jmock/integration/junit4/JMock.java
>>
>> --Nat
&gt;>
&gt;> 2008/6/30 David Saff < david%40saff.net">davidsaff.net&gt;:
>>
>>> Nat,
>;>>
>>&gt; Would you mind sharing the source? Is it checked in? I'm curious to
>&gt;> see it. Thanks,
>>>;
>>;> David Saff
>;>>
>>&gt; On Wed, Jun 25, 2008 at 8:09 AM, Nat Pryce < nat.pryce%40gmail.com">nat.prycegmail.com> wrote:
&gt;>>> It works fine. The new JMock test runner now passes all its tests.
&gt;>>>
>>>>; Thanks,
>>>;> --Nat.
&gt;>>>
>>>>; 2008/6/24 David Saff < david%40saff.net">davidsaff.net&gt;:
>>>>;
>>;>>&gt; Nat,
>;>>&gt;>
&gt;>>&gt;> Good suggestion. It's implemented in the new JUnit 4.5 beta 2, now
>>>>;> available for download. Let me know if it makes things better.
>>>;>>
>>&gt;>> David Saff
>;>>&gt;>
&gt;>>&gt;> On Sat, Jun 21, 2008 at 2:47 PM, Nat Pryce < nat.pryce%40gmail.com">nat.prycegmail.com> wrote:
&gt;>>>>>; I've found a serious limitation with the new API: there's no easy way
>>>>;>> to insert a statement into the chain of decorators so that it gets
>;>>&gt;>> access to the test object.
>>>;>>&gt;
>&gt;>>&gt;> I originally inserted jMock's verification step after the test method
&gt;>>>>>; was invoked, by overriding invoke(...) and wrapping my own Statement
>>&gt;>>> around that returned by super.invoke(...). That was easy because
>>>;>>&gt; invoke is passed the test object.
>>>;>>&gt;
>&gt;>>&gt;> However, it doesn't work: if the test throws an expected exception,
>>>>>;> the verification is not performed.
>>>>>;>
>;>>&gt;>> Therefore, I need to insert jMock's verification after the check for
>>>>;>> an expected exception. But the possiblyExpectingExceptions method is
>&gt;>>>> not passed the test object. It is therefore impossible to implement
>>&gt;>>> what I want without duplicating the implementation of
>&gt;>>>> BlockJUnit4ClassRunner.childBlock, which is quite a big method and
>>>>;>> doesn't seem to be a clean extension point.
&gt;>>>>>;
>>;>>&gt;> One possible fix is, I think, for every factory method that creates a
>&gt;>>&gt;> Statement to have the same parameters: the test object, the test
>;>>&gt;>> method and, if applicable, the next link in the chain of Statements.
>>;>>&gt;>
&gt;>>&gt;>> --Nat
&gt;>>&gt;>>
>>>>>;> 2008/6/19 nat_pryce < nat.pryce%40gmail.com">nat.prycegmail.com>:
&gt;>>&gt;>>> One other uncertainty I had with the new API. BlockJUnit4TestRunner
>>;>>&gt;>> has two constructors, one which takes a TestClass and one which takes
&gt;>>&gt;>>> a Class delegates to the former.
>>>;>>&gt;>
&gt;>>&gt;>>> Why two?
>;>>&gt;>>&gt;
>&gt;>>>>>; Which should I override for my subclass? That is, which does the
>>>>;>>&gt; framework use to create a test-runner?
>&gt;>>&gt;>>
>>>>>;>> --Nat
&gt;>>&gt;>>>
>>>>;>>&gt; --- In junit%40yahoogroups.com">junityahoogroups.com, "Kent Beck" <kentb...> wrote:
&gt;>>>>>;>>
>>&gt;>>&gt;>> Nat,
>;>>&gt;>>&gt;>
&gt;>>>>>;>> I'm glad the new format worked better for you. BlockJUnit4TestRunner
>>;>>&gt;>> and its
>>>>;>>&gt;> supporting cast are intended to be published in the next release.
>>&gt;>>&gt;> However,
>>&gt;>>&gt;>> they are new enough that we wanted to verify their efficacy and give
>;>>&gt;>>&gt;> ourselves a chance to refine them before many people used them.
&gt;>>&gt;>>>>
>>>;>>&gt;>> Point well taken on the redundancy of deprecation and moving the
>>>>;>>&gt; classes.
>>&gt;>>&gt;>> We'll move them back before releasing. We will compile the final
&gt;>>&gt;>>>> release
>>>;>>&gt;>> with Java 5 as well.
&gt;>>&gt;>>>>
>>>;>>&gt;>> Thank you very much for the feedback.
>>&gt;>>>>>;
>>;>>&gt;>>&gt; Regards,
>>&gt;>>&gt;>>
>>>>>;>>&gt; Kent Beck
>;>>&gt;>>&gt;> Three Rivers Institute
>>&gt;>>>>>;
>>;>>&gt;>>&gt; _____
&gt;>>&gt;>>>>
>>>;>>&gt;>> From: junit%40yahoogroups.com">junityahoogroups.com [mailto: junit%40yahoogroups.com">junityahoogroups.com] On Behalf
&gt;>>>>>;>> Of
>&gt;>>>>>;> nat_pryce
>>&gt;>>>>>; Sent: Thursday, June 19, 2008 3:16 AM
>&gt;>>>>>;> To: junit%40yahoogroups.com">junityahoogroups.com
&gt;>>>>>;>> Subject: [junit] Re: 4.5 release candidate
>>&gt;>>>>>;
>>;>>&gt;>>&gt;
>&gt;>>>>>;>
>;>>&gt;>>&gt;> I've ported the jMock runner over to the new structure. Here are
>>>>;>>&gt;> some
>;>>&gt;>>&gt;> comments on the experience.
>>;>>&gt;>>&gt;
>&gt;>>>>>;> I extended BlockJUnit4ClassRunner and override the invoke(...)
>>;>>&gt;>>&gt; method
&gt;>>>>>;>> to verify the mock objects after the test has run, but before
&gt;>>>>>;>> tear-down.
>>>>>;>>&gt;
>&gt;>>&gt;>>> This way reduces the amount of code in the custom runner. I also
>;>>&gt;>>&gt;> didn't have to duplicate existing functionality because the invoke
&gt;>>>>>;>> method let me hook in at the right point.
&gt;>>>>>;>>
>>&gt;>>&gt;>> However, I still had to use classes in the org.junit.internal
>>>;>>&gt;>> package,
>>&gt;>>&gt;>> which feels wrong. Have I missed the right way of doing this?
&gt;>>&gt;>>>>
>>>;>>&gt;>> Other niggles...
>>>>>;>>&gt;
>&gt;>>&gt;>>> - The classes are compiled for Java 6 only, but only seem to need
>;>>&gt;>>&gt;> language features from 5 and above. Can the release be compiled for
>>>>;>>&gt;> Java 5?
>&gt;>>>>>;>
>;>>&gt;>>&gt;> - The JUnit 4.4 classes have been deprecated *and* moved to another
>>>;>>&gt;>> package, which breaks any code that used them. There's no point in
>&gt;>>>>>;> doing both. Either break backward compatability or keep backward
>>&gt;>>&gt;>> compatability and deprecate the classes. I'd prefer the latter,
>>>;>>&gt;>> since
&gt;>>&gt;>>>> it will allow me to do a jMock with new features supporting both
>;>>&gt;>>&gt;> JUnit
&gt;>>&gt;>>>> 4.4 and 4.5 and then release a version that brings support forward
>>>;>>&gt;>> to
>&gt;>>>>>;> 4.5 onwards.
>>&gt;>>&gt;>>
>>>>>;>>&gt; Cheers,
>>>;>>&gt;>> --Nat.
&gt;>>>>>;>>
>>&gt;>>&gt;>> --- In junityahoogroups. <mailto:junit%40yahoogroups.com> com, "Nat
>>&gt;>>>> Pryce";
>>;>>&gt;>>&gt; <nat.pryce> wrote:
&gt;>>>>>;>> >
>;>>&gt;>>&gt;> > JUnit 4.5 breaks jMock 2 because the TestMethod class has been
>;>>&gt;>>&gt;> > moved
&gt;>>&gt;>>>> > to a different package.
>>&gt;>>&gt;>> >
>;>>&gt;>>&gt;> > It's our fault for subclassing JUnit4ClassRunner, but it would be
>&gt;>>>>>;> > nice
>;>>&gt;>>&gt;> > if JUnit4ClassRunner did not change at all in this release.
>>&gt;>>&gt;>> >
>;>>&gt;>>&gt;> > --Nat
&gt;>>&gt;>>>> >
>;>>&gt;>>&gt;> > 2008/6/16 Kent Beck <kentb>:
&gt;>>&gt;>>>> > > All,
>;>>&gt;>>&gt;> > >
>;>>&gt;>>&gt;> > > Following our discussions last week, we have incorporated the
>>>>;>>&gt;> > > old
>>>>;>>&gt;> > > JUnit4ClassRunner into 4.5. (The new runner is called
&gt;>>>>>;>> BlockJUnit4ClassRunner
>&gt;>>&gt;>>> > > because it is organized as a "block" of "statements"; instead of
>&gt;>>>>>; nested
&gt;>>>>>;>> > > procedures). Those of you who have written custom runners, we'd
>;>>&gt;>>&gt;> appreciate
>>>>>;>>&gt; > > it if you could try out the release candidate to make sure it
>&gt;>>>>>;> supports your
>;>>&gt;>>&gt;> > > existing runners.
>>&gt;>>&gt;>> > >
>;>>&gt;>>&gt;> > > Next up, release notes and then out the door!
&gt;>>&gt;>>>> > >
>;>>&gt;>>&gt;> > > Whew!
&gt;>>&gt;>>>> > >
>;>>&gt;>>&gt;> > > Kent Beck
>;>>&gt;>>&gt;> > > Three Rivers Institute
>>&gt;>>>>>; > >
>;>>&gt;>>&gt;> > >
>;>>&gt;>>&gt;> >
>;>>&gt;>>&gt;>
&gt;>>>>>;>>
>>&gt;>>&gt;>>
>>>>>;>>&gt;
>&gt;>>&gt;>>>
>>>>;>>&gt;>
&gt;>>&gt;>>>> [Non-text portions of this message have been removed]
>>&gt;>>&gt;>>
>>>>>;>>
>>&gt;>>&gt;>
&gt;>>>>>;
>>;>>&gt;> ------------------------------------
&gt;>>>>>;
>>;>>&gt;> Yahoo! Groups Links
&gt;>>&gt;>>
>>>>>;>
>;>>&gt;>>
>>&gt;>>>
>>>>;>
>;>>&gt;
>&gt;>
&gt;>
&gt;

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )