db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2304) Convert derbynet/callable.java to junit
Date Wed, 07 Feb 2007 19:02:07 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471068
] 

Daniel John Debrunner commented on DERBY-2304:
----------------------------------------------

A1) all the fixtures will be run with autocommit false, since you set that in the setup method.
That may be leaving held result sets open though I couldn't see any missing closes, so maybe
it's a bug.
I wasn't clear what you meant on no teardown, your CleanDatabaseTestSetup method has a tearDown
method that will drop all the objects in the database, so if the test is passing the routines
must be being dropped without error.

A2)  The suite method is correct, the concept of being in a framework doesn't really exist
anymore, at least not during the calls to suite(). The class needs to define what primary
configurations the test will run in, this is driven by the suite method itself, not be any
external framework setting. Thus the test is saying I want to run these fixtures in embedded
and these in client/server.

Note also that fixtures do not have to begin with test. One can use 'test' for methods that
run in both configurations and thus use defaultSuite and then add other fixtures explicitly,
e.g. embededdTestOneInOneOutFunc. If only one or two fixtures are "abnormal" then this is
a better approach than adding all fixtures explicitly.

A3)  An alternative would be to use java.util.Arrays.equals(), something like

assertTrue(Arrays.equals(b1, b2))

A4) is because you are passing an imprecise double to BigDecimal() and BigDecimal is correctly
reflecting the double value. You can use a String to create the BigDecimal, e..g new BigDecimal("33.3330");
One could simplify the method by creating an assertDecimalEquals() method, that took the string
and created the BigDecimal within the method. e.g. called as:

  assertDecimalEquals("OUT 2", "33.3330", cs.getBigDecimal(2));




> Convert derbynet/callable.java to junit
> ---------------------------------------
>
>                 Key: DERBY-2304
>                 URL: https://issues.apache.org/jira/browse/DERBY-2304
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>            Reporter: Jean T. Anderson
>         Assigned To: Jean T. Anderson
>            Priority: Minor
>         Attachments: derby-2304-preview.diff
>
>
> Convert the derbynet.callable.java test to the junit framework.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message