You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jayaram Subramanian (JIRA)" <ji...@apache.org> on 2010/01/08 04:23:58 UTC

[jira] Created: (DERBY-4509) Convert autoincrement.sql to JUnit

Convert autoincrement.sql to JUnit
----------------------------------

                 Key: DERBY-4509
                 URL: https://issues.apache.org/jira/browse/DERBY-4509
             Project: Derby
          Issue Type: Task
          Components: Test
         Environment: Apache Derby
            Reporter: Jayaram Subramanian
            Assignee: Jayaram Subramanian
            Priority: Minor


The task is to convert existing autoincrement.sql to JUnit

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


[jira] Commented: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12849288#action_12849288 ] 

Kathey Marsden commented on DERBY-4509:
---------------------------------------

I looked at the autoincrement_March162010.txt  patch and it looks good except that there seem to be some extra commented out statements that should be removed, e.g as I think they must be something superfluous from your work converting the test e.g after //-with unique index you have.

		//s.execute("insert into uniquet4(i) values(3)");
		//s.execute("insert into uniquet4(i) values(4)");
		//s.execute("insert into uniquet4(i) values(5)");		
		//assertStatementError("23505",s,"insert into uniquet4(i,uniquet4_autogen) values(1,0)");
		//assertStatementError("23505",s,"insert into uniquet4(i,uniquet4_autogen) values(1,0)");
		
Please remove those and post a new patch and I will commit it.  I will be out next week, so hopefully you can do this today or tomorrow.

After commit,  It might be nice too as extra credit, to  make an additional patch in which you add javadoc comments to the fixtures.  In Eclipse, you can just click on the method name and then right click -> Source -> Generate element comment and then add a brief comment of what the fixture is testing, just to make things tidy, but first just remove the superfluous commented code and then follow up with this if you want to.



> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: autoincrement_March162010.txt, AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, stat_March162010.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: autoincrement_March24.txt
                stat_March24.txt

Submitting the patch as per the latest review comments from Kathy

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: autoincrement_March162010.txt, autoincrement_March24.txt, AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, stat_March162010.txt, stat_March24.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Commented: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831202#action_12831202 ] 

Kathey Marsden commented on DERBY-4509:
---------------------------------------

Thank you Jayaram for the patch.
My first general comment would be for the creation and cleanup of schema objects, you use CleanDatabaseTestSetup and decorateSQL to create the objects such as tables and views up front and then let them get cleaned up automatically at the end of the test.   You can then remove the drop statements from the test.  If any table names are reused in the test you will have to choose distinct names so there is no collision.   One big advantage of doing it this way is that if the test fails for some reason we are assured that things get cleaned up properly and also declutters the test.   Take a look at GroupByTest for an example of how to do this.

My second would be that it would be good to break the test up into multiple fixtures instead of just one big one, for example maybe testIdentity  testIdentityWithStartValue, testIdentityWithIncrement, etc.    Just go down through the autoincrement.out file and group it into logical chunks and make sure each fixture has javadoc comments.

I did not check the out file against the new test, but noticed that the lock checking seems to be missing.  You need to add the creation of the lock_table view and  check the locks where they are being checked in the original test.  The master/autoincrement.out file has the expected output.  

Also a small thing, instead of doing:
Connection conn = getConnection();
		Statement s = conn.createStatement();
to get a statement, just do 
   Statement s - getStatement();

Here again the statement will get cleaned up automatically, so you don't have to put the cleanup code in the test.

There are other built in helper methods too, like
conn.commit();   -> commit()
conn.setAutoCommit(true); -> setAutoCommit(true);

Take a look at BaseJDBCTestCase to see what is available.

Thanks 

Kathey




> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-4509:
--------------------------------------

    Issue & fix info:   (was: [Patch Available])

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: autoincrement_March162010.txt, autoincrement_March24.txt, AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, stat_March162010.txt, stat_March24.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Issue & fix info: [Patch Available]

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Commented: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841544#action_12841544 ] 

Kathey Marsden commented on DERBY-4509:
---------------------------------------

I spoke with Jayaram on the phone and IRC about the Autoincrementrevised.txt patch.
The main thing was that he needs to review the new test and compare it to  autoincrement.out and make sure everything is included. I put suggested he put it in the same general order  and copy the comments exactly so we don't miss anything and it is easy to check.   Besides that, I had the following  details:
- suite.addTest(OrderByAndOffsetFetchInSubqueries.suite()); seems to be missing now from lang/_Suite.java
- autoincrement.sql is still in derbylang.runall and needs to be removed.
- test name in AutoIncrementTest in licence header should be changed from SimpleTest
- use local variables for rs and expectedRows in each fixture instead of fields.  Fields tend to leak memory in Junit tests.
- make sure lock_table queries are being executed as they were in autoincrement.sql. The view creation is there but I didn't see the queries to check for locking behavior.


> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Resolved: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren resolved DERBY-4509.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0

Looks fine from the nightly tests from IBM (not sure what's up with the ones from Sun/Oracle, but likely unrelated to this issue), so resolving. The reporter can close this, I think.

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: autoincrement_March162010.txt, autoincrement_March24.txt, AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, stat_March162010.txt, stat_March24.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Commented: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852857#action_12852857 ] 

Myrna van Lunteren commented on DERBY-4509:
-------------------------------------------

I ran the tests with ibm 1.6 on windows, and derbyall and suites.All both passed for me.
Committed patch autoincrement_March24.txt to trunk with revision 930311. 
I suggest we leave this open for a day or so until the tinderbox tests have passed.
Thanks for the contribution and congratulations on getting your first patch committed Jayaram!


> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: autoincrement_March162010.txt, autoincrement_March24.txt, AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, stat_March162010.txt, stat_March24.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: AutoIncrementDO_NOT_COMMIT_diff.txt

Complete converted code of autoincrement.sql

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: AutoIncrementDO-NOT_COMMIT_diff.txt

Partial patch for JUnit conversion of autoincrement.sql

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: AutoIncrementDO_NOT_COMMIT_diff.txt

Interim patch for AutoIncrement Test conversion

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: jira4509feb4stat.txt
                jira4509feb4.txt

Patch updated after discussion and review comments from Kathy

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: stat_March162010.txt
                autoincrement_March162010.txt

Update AutoIncrementTest as per interim review comments from Kathy.. 

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: autoincrement_March162010.txt, AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, stat_March162010.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: statrevised.txt
                AutoIncrementrevised.txt

Attaching the autoincrement revised file based on the review comments from Kathy.

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementrevised.txt, jira4509.txt, jira4509feb4.txt, jira4509feb4stat.txt, jira4509stat.txt, statrevised.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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


[jira] Updated: (DERBY-4509) Convert autoincrement.sql to JUnit

Posted by "Jayaram Subramanian (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayaram Subramanian updated DERBY-4509:
---------------------------------------

    Attachment: jira4509stat.txt
                jira4509.txt

All changes related to conversion of autoincrementTest.sql file to autoincrementTest.java junit file have been included in this patch.  

> Convert autoincrement.sql to JUnit
> ----------------------------------
>
>                 Key: DERBY-4509
>                 URL: https://issues.apache.org/jira/browse/DERBY-4509
>             Project: Derby
>          Issue Type: Task
>          Components: Test
>         Environment: Apache Derby
>            Reporter: Jayaram Subramanian
>            Assignee: Jayaram Subramanian
>            Priority: Minor
>         Attachments: AutoIncrementDO-NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, AutoIncrementDO_NOT_COMMIT_diff.txt, jira4509.txt, jira4509stat.txt
>
>
> The task is to convert existing autoincrement.sql to JUnit

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