db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2151) "Fixer-upper" utility to help convert ij canon-based tests to JUnit.
Date Mon, 03 Sep 2007 02:17:19 GMT

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

Bryan Pendleton updated DERBY-2151:
-----------------------------------

    Attachment: skipBlankLines.diff

Attached is skipBlankLines.diff.

I was investigating using SQLToJUnit for conversion of groupBy.sql, but the master file groupBy.out
contains some entirely blank lines, which was causing the command parser in SQLToJUnit to
throw a NullPointerException.

With this patch SQLToJUnit successfully processed all of groupBy.sql.


> "Fixer-upper" utility to help convert ij canon-based tests to JUnit.
> --------------------------------------------------------------------
>
>                 Key: DERBY-2151
>                 URL: https://issues.apache.org/jira/browse/DERBY-2151
>             Project: Derby
>          Issue Type: Test
>          Components: Test, Tools
>    Affects Versions: 10.3.1.4
>            Reporter: A B
>            Priority: Minor
>             Fix For: 10.3.1.4
>
>         Attachments: derby-2151-andrew-v1.diff, derby-2151-andrew-v2.diff, ijToJUnit.java,
skipBlankLines.diff
>
>
> As part of my work to get the XML tests running in JUnit (DERBY-1758) I had to convert
the old ij test lang/xml_general.sql into a JUnit equivalent.  After hand-converting about
twenty or so lines of ij "master" output to the corresponding JUnit commands, I became bored
with the melancholy of such a task.  So I hastily threw together a small utility to help automate
as much of the process as possible.
> To be perfectly frank, the utility is a shameful piece of code.  It's poorly-written,
non-intuitive, overly complex and not at all well thought-out.  It's also completely UN-commented.
I wish I could follow-up with a half-hearted claim that "at least it works", but I'm not even
sure *that*'s always true...
> My first (and still lingering) inclination is to just bury the utility and never look
at it again.  However, I have to admit that, while the code is a nightmare to understand,
it did a) prompt me to add some general-purpose JUnit utility methods that can be useful (DERBY-1976),
and b) save me a lot of time by providing a rough translation of the ij test to JUnit.  Then
instead of piddling away at line-by-conversions of the test I was able to spend my time re-organizing
the JUnit version to make it adhere to the JUnit suggestions on the second page of:
>   http://www.javaworld.com/jw-12-2000/jw-1221-junit.html
> So the utility *did* save me time.  And for that reason I've decided to choke down my
embarassment and post it to a Jira issue for other developers who may find it useful (or perhaps
entertaining as an example of bad programming)...

-- 
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