[ 
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: 10.4.1.3
>
>         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.

Reply via email to