[ 
https://issues.apache.org/jira/browse/DERBY-3294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Myrna van Lunteren updated DERBY-3294:
--------------------------------------

    Attachment: DERBY-3294_diff_1_14.txt
                DERBY-3294_stat_1_14.txt

I just do not like that duplication of code, I think it defeats the purpose of 
adding that test.

So, I took your patch, then modified java/demo/toursdb/insertMaps.java so that 
the main() method calls a new method - insertRows() - which does all the work, 
but prints nothing, and returns the number of rows inserted.
This insertRows() method is then called from the test.

It then became necessary to allow for a 'null' path as well as the path used by 
the test; I wasn't sure whether - and if so, how - to document the purpose of 
this in insertMaps.java...

In addition, it became necessary to add fileIn.close for the gif files in 
insertMaps.java, or the junit test cleanup wouldn't work.

Finally, I noticed that the LightRail row inserts BART.gif. I thought this 
logically wrong, but inserting LightRail.gif hits an error 22001 because the 
create table statement uses a blob size smaller than LightRail.gif. I didn't 
want to increase the size of toursDB in the  distributions, so instead I added 
a comment to insertMaps.

The alternatives were to enlarge the database and insert LightRail.gif, or to 
not add the third row,  but those two would possibly require changing any 
documentation references, and I didn't want to go there. Or I could try to make 
a smaller LightRail.gif, but again, I felt that to be getting sidetracked too 
much.

demo/toursdb/insertMaps.java itself is not intended as a demo, but to populate 
the database (used in many doc examples) so I think it would be ok to make 
these changes...

If I hear  nothing on this, I'll commit this latest patch tomorrow...


> Convert demo/checkToursDB.java to junit
> ---------------------------------------
>
>                 Key: DERBY-3294
>                 URL: https://issues.apache.org/jira/browse/DERBY-3294
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Manjula Kutty
>            Assignee: Manjula Kutty
>            Priority: Minor
>             Fix For: 10.4.0.0
>
>         Attachments: DERBY-3294_diff_12_28.txt, DERBY-3294_diff_1_14.txt, 
> DERBY-3294_stat_12_28.txt, DERBY-3294_stat_1_14.txt, 
> DERBY_3294_diff_01_02.txt, DERBY_3294_diff_1_4.txt, DERBY_3294_diff_1_7.txt, 
> DERBY_3294_stat_01_02.txt, DERBY_3294_stat_1_4.txt, DERBY_3294_stat_1_7.txt
>
>
> Place holder for the junit conversion of demo/checkToursDB.java

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

Reply via email to