db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Junjie Peng" <pjj.c...@gmail.com>
Subject Re: [jira] Commented: (DERBY-3724) Converting big.sql to JUnit
Date Thu, 19 Jun 2008 15:10:29 GMT
    Thank you for the verbose instructions from you and Kathey! I accept
your comments and will do the improvement. It seems most of my problem comes
from not so good understanding of BaseJDBCTestCase, and I will reuse more
reusable things.

   ---My IDE is Eclipse on Windows XP, I use subclipse to check and create
the patch, the result starts with
  I do know why it doesn't include a revision number. And
"D:/myproject/java/eclipse/java" was deleted by hand. I have done another
testing --- if I change a class file which has been submitted, the patch
will include some Non-ASCII code. Maybe I should try SVN.
   ----Besides, I have another question:
        Where to put unit test codes for the unit test itself?  When I do
this converting, I have a trouble in doing unit testing for my new test
case. So far, I just put the testing codes in the same class file, then
delete all of them before submit. It is not so smart. How should we deal
with this problem?
     Thank you!


2008/6/19, Myrna van Lunteren (JIRA) <jira@apache.org>:

>    [
> https://issues.apache.org/jira/browse/DERBY-3724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12606144#action_12606144]
> Myrna van Lunteren commented on DERBY-3724:
> -------------------------------------------
> Thanks for this great first effort!
> Kathey and I put our heads together and noticed the following:
> - what tool did you use to create the patch? Normally, patches are created
> using svn diff from the top of the trunk. That way, the diff would have
> something like:
> =========================================================
> ---
> java/testing/org/apache/derbyTesting/functionTests/tests/lang/BigDataTest.java      (revision
> 0)
> +++
> java/testing/org/apache/derbyTesting/functionTests/tests/lang/BigDataTest.java      (revision
> 0)
>   In your patch, we miss the revisions, and there's an extra level
> ('derdy')

- at Derby, we have to convention to not use @author tags.      (ownership &
> history is documented in JIRA and svn)
> - BIG_TABLE_NAME should be static
> - There should be no need for private Connection conn. The fixtures can
> just call 'getConnection' (picking up from BaseJDBCTestCase) to connect to
> the default db
> - similarly, you don't need to use Statement stmt =
> conn.createStatement(...), you can just use createStatement(int
> resultSetType,int resultSetConcurrency) from BaseJDBCTestCase.
> - it would be good to have a suite() method using defaultSuite. That way
> the test would run automatically with both embedded and network
> server/client, using cleanDatabaseSetup to remove all tables from the db
> between fixtures.
> - instead of validTabe() and validRows() it looks as if you should be able
> to use one of the JDBC.assertFullResultSet() methods
> - At the end of big.sql there are various tests commented out because at
> one point it wasn't supported. Some of that functionality is (again?)
> supported; you should be able to insert characters into tables with datatype
> char, varchar, long varchar. (The max lengths are different per char -
> should be in the manual). You should see if those test cases can be revived.
> - the fixture 'testMixture' is based on a section that in big.sql has half
> of it commented out, mentioning some problem with getting a
> DRDAProtocolException. This section should make it into the test - if it
> does still return a protocolException it can be commented out with reference
> to a JIRA (I looked, but it doesn't appear one was logged, so that would
> need to get done too, if reproducible).
> - nit: we usually have the code inside a method indented 8 spaces.
> In general, there's a utility that we can use to convert .sql type tests to
> junit type tests - org.apache.derbyTesting.functionTests.util.SQLToJUnit -
> when you use it, a lot of the conversion should get done for you.
> > Converting big.sql  to JUnit
> > -----------------------------
> >
> >                 Key: DERBY-3724
> >                 URL: https://issues.apache.org/jira/browse/DERBY-3724
> >             Project: Derby
> >          Issue Type: Task
> >          Components: Test
> >         Environment: windows XP Professional SP2,
> >            Reporter: Junjie Peng
> >            Assignee: Junjie Peng
> >             Fix For:
> >
> >         Attachments: patch.txt
> >
> >   Original Estimate: 168h
> >  Remaining Estimate: 168h
> >
> > It is a task of "Converting old tests to JUnit ". It request
> coverting  "derdy/java/testing/org/apache/derbyTesting/functionTests/tests/lang/big.sql"
> into a junit. Also, it is a task of 2008 GSoc.
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.

View raw message