You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Ramin Moazeni <rm...@gmail.com> on 2007/08/02 21:28:16 UTC
Re: Common Junit test conversion mistakes
Hi Kathey
Some comments I have regarding the test conversions:
1) no need to close the statements created with createStatement() as
they are now cleaned up automatically.
2) to get expected SQLStates:
* use the canon file located at functionTests/master/someTest.out to
capture expected SQLStates.
or
* put System.out.println("Expected message: "+ e.getSQLState() +":" +
e.getMessage()); statements in the new test, to get the SQLStates
Ramin
On 7/5/07, Kathey Marsden <km...@sbcglobal.net> wrote:
> I updated the wiki page:
> http://wiki.apache.org/db-derby/ConvertOldTestToJunitTips
>
> with some common JUnit conversion mistakes, since we all seem to hit the
> same tripwires starting out. I am hoping that folks, especially those
> who recently started converting tests (Ugo, Ramin and Ravinder) as well
> as those who have been reviewing tests (Dan, Myrna, Knut) could take a
> look and see if there is anything that should be added. Also I want to
> give an example of a really good simple test that newcomers could study
> or use as a template to get started. Does anyone have a suggestion for
> which test this should be?
>
>
> Kathey
>
>
>
>
Re: Common Junit test conversion mistakes
Posted by Ramin Moazeni <rm...@gmail.com>.
Sure, will do.
Ramin
On 8/2/07, Kathey Marsden <km...@sbcglobal.net> wrote:
> Ramin Moazeni wrote:
> > Hi Kathey
> >
> > Some comments I have regarding the test conversions:
> > 1) no need to close the statements created with createStatement() as
> > they are now cleaned up automatically.
> > 2) to get expected SQLStates:
> > * use the canon file located at functionTests/master/someTest.out to
> > capture expected SQLStates.
> > or
> > * put System.out.println("Expected message: "+ e.getSQLState() +":" +
> > e.getMessage()); statements in the new test, to get the SQLStates
> >
> > Ramin
> >
> > On 7/5/07, Kathey Marsden <km...@sbcglobal.net> wrote:
> >
> >> I updated the wiki page:
> >> http://wiki.apache.org/db-derby/ConvertOldTestToJunitTips
> >>
> >> with some common JUnit conversion mistakes, since we all seem to hit the
> >> same tripwires starting out. I am hoping that folks, especially those
> >> who recently started converting tests (Ugo, Ramin and Ravinder) as well
> >> as those who have been reviewing tests (Dan, Myrna, Knut) could take a
> >> look and see if there is anything that should be added. Also I want to
> >> give an example of a really good simple test that newcomers could study
> >> or use as a template to get started. Does anyone have a suggestion for
> >> which test this should be?
> >>
> >>
> >>
> Thanks Ramin, these are great tips. Can you add them to the Wiki page?
>
> Kathey
>
>
Re: Common Junit test conversion mistakes
Posted by Kathey Marsden <km...@sbcglobal.net>.
Ramin Moazeni wrote:
> Hi Kathey
>
> Some comments I have regarding the test conversions:
> 1) no need to close the statements created with createStatement() as
> they are now cleaned up automatically.
> 2) to get expected SQLStates:
> * use the canon file located at functionTests/master/someTest.out to
> capture expected SQLStates.
> or
> * put System.out.println("Expected message: "+ e.getSQLState() +":" +
> e.getMessage()); statements in the new test, to get the SQLStates
>
> Ramin
>
> On 7/5/07, Kathey Marsden <km...@sbcglobal.net> wrote:
>
>> I updated the wiki page:
>> http://wiki.apache.org/db-derby/ConvertOldTestToJunitTips
>>
>> with some common JUnit conversion mistakes, since we all seem to hit the
>> same tripwires starting out. I am hoping that folks, especially those
>> who recently started converting tests (Ugo, Ramin and Ravinder) as well
>> as those who have been reviewing tests (Dan, Myrna, Knut) could take a
>> look and see if there is anything that should be added. Also I want to
>> give an example of a really good simple test that newcomers could study
>> or use as a template to get started. Does anyone have a suggestion for
>> which test this should be?
>>
>>
>>
Thanks Ramin, these are great tips. Can you add them to the Wiki page?
Kathey