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 Kathey Marsden <km...@sbcglobal.net> on 2007/02/22 20:21:45 UTC

Is it ok to use BigDecimalHandler in JUnit tests

I am  converting parameterMapping to JUnit.  I am wondering if it is ok 
to use BigDecimalHandler in JUnit tests?  If not is there a replacement 
of some sort for BigDecimalHandler?

 
Here is a snippet of the old test where it is used:

System.out.print("getBigDecimal="
                    + BigDecimalHandler.getBigDecimalString(rs, 1)
                    + " was null " + rs.wasNull());

Thanks

Kathey


Re: Is it ok to use BigDecimalHandler in JUnit tests

Posted by Daniel John Debrunner <dj...@apache.org>.
Kathey Marsden wrote:
> Bryan Pendleton wrote:
>>> I am  converting parameterMapping to JUnit.  I am wondering if it is 
>>> ok to use BigDecimalHandler in JUnit tests?
>>
>> Completely naive question: why wouldn't it be? Does this touch on
>> JDK portability somehow?
> My understanding was that at least some classes in 
> java/testing/org/apache/derbyTesting/functionTests/util
> were being deprecated and replaced by something under 
> java/testing/org/apache/derbyTesting/junit for use with junit tests.
> 
> but I don't see anything under junit  that would replace BigDecimalHandler.

because it's been done as people come across the need. Thus it would be 
good if you could move the code to junit package in the JDBC class.

Another issue is that at some point the base for trunk will change to 
J2ME/CDC/Foundation 1.1 (see DERBY-2210) which does have BigDecimal but 
does not have set/getBigDecimal.

This will change so that
   set/getObject() will return a BigDecimal for a DECIMAL column
   DECIMAL values can be passed into routines

So it might be worth converting the test assuming the above and just 
don't run it on J2ME for now. Add a comment to DERBY-2210 that such a 
test should be enabled once it is addressed.

Dan.


Re: Is it ok to use BigDecimalHandler in JUnit tests

Posted by Mamta Satoor <ms...@gmail.com>.
Actually, I looked through comments of DERBY-2304 and I think Jean was
trying to implement assertDecimalEquals to compare 2 decimals. So, probably
not what you needed. I should have checked DERBY-2304 first before
responding.

Mamta


On 2/22/07, Mamta Satoor <ms...@gmail.com> wrote:
>
> Kathey, I don't know the answer to your question but Jean was working with
> Decimals in https://issues.apache.org/jira/browse/DERBY-2304 Don't know if
> she needed to add anything for decimal handling.
>
> Mamta
>
>
>
> On 2/22/07, Kathey Marsden <km...@sbcglobal.net> wrote:
> >
> > Bryan Pendleton wrote:
> > >> I am  converting parameterMapping to JUnit.  I am wondering if it is
> > >> ok to use BigDecimalHandler in JUnit tests?
> > >
> > > Completely naive question: why wouldn't it be? Does this touch on
> > > JDK portability somehow?
> > My understanding was that at least some classes in
> > java/testing/org/apache/derbyTesting/functionTests/util
> > were being deprecated and replaced by something under
> > java/testing/org/apache/derbyTesting/junit for use with junit tests.
> >
> > but I don't see anything under junit  that would replace
> > BigDecimalHandler.
> >
> > Kathey
> >
> >
> >
>

Re: Is it ok to use BigDecimalHandler in JUnit tests

Posted by Mamta Satoor <ms...@gmail.com>.
Kathey, I don't know the answer to your question but Jean was working with
Decimals in https://issues.apache.org/jira/browse/DERBY-2304 Don't know if
she needed to add anything for decimal handling.

Mamta



On 2/22/07, Kathey Marsden <km...@sbcglobal.net> wrote:
>
> Bryan Pendleton wrote:
> >> I am  converting parameterMapping to JUnit.  I am wondering if it is
> >> ok to use BigDecimalHandler in JUnit tests?
> >
> > Completely naive question: why wouldn't it be? Does this touch on
> > JDK portability somehow?
> My understanding was that at least some classes in
> java/testing/org/apache/derbyTesting/functionTests/util
> were being deprecated and replaced by something under
> java/testing/org/apache/derbyTesting/junit for use with junit tests.
>
> but I don't see anything under junit  that would replace
> BigDecimalHandler.
>
> Kathey
>
>
>

Re: Is it ok to use BigDecimalHandler in JUnit tests

Posted by Kathey Marsden <km...@sbcglobal.net>.
Bryan Pendleton wrote:
>> I am  converting parameterMapping to JUnit.  I am wondering if it is 
>> ok to use BigDecimalHandler in JUnit tests?
>
> Completely naive question: why wouldn't it be? Does this touch on
> JDK portability somehow?
My understanding was that at least some classes in 
java/testing/org/apache/derbyTesting/functionTests/util
were being deprecated and replaced by something under 
java/testing/org/apache/derbyTesting/junit for use with junit tests.

but I don't see anything under junit  that would replace BigDecimalHandler.

Kathey



Re: Is it ok to use BigDecimalHandler in JUnit tests

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> I am  converting parameterMapping to JUnit.  I am wondering if it is ok 
> to use BigDecimalHandler in JUnit tests?

Completely naive question: why wouldn't it be? Does this touch on
JDK portability somehow?

thanks,

bryan