db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3801) Convert "org.apache.derbyTesting.functionTests.tests.lang.holdCursorIJ.sql" to junit.
Date Mon, 04 Aug 2008 22:28:44 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619730#action_12619730
] 

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

Hi Junjie,

re 1. I see what you're asking now, sorry for the confusion earlier...The problem is that
you were using the BaseJDBCTestCase method 'dropTable()'. This method "takes over" and the
test doesn't get to check on the (if) resulting SQLException. In your block: 
            ...
            }else{
	    try{
		dropTable("t1");
	    }catch (SQLException e) {
		assertSQLState("X0X95", e);
	    }
The 'assertSQLState("X0X95",e); is never reached, instead, the assert in the stack trace is
originating from the BaseJDBCTestCase.dropTable method.
As you're expecting a specific error out of the drop table statement, you'd have to spell
out the actual drop table statement, like you do elsewhere.

re 2. The script mechanism still is junit. If you follow through from e.g. LangScripts.java
you see the extending goes via ScriptTestCase<-CanonTestCase<-BaseJDBCTestCase. Most
of the other junit tests for derby extend BaseJDBCTestCase. BaseJDBCTestCase extends BaseTestCase
extends junit.framework.TestCase.

Still, you raise a good point. Ideally, we'd not use master files, as the maintenance of those
can get tedious. The CanonTestCase tests only work if there is only 1 master file, which is
why in this case we'd have to do something special - the HoldCursorIJ test gives different
results for embedded and DerbyNetClient...
But to test language aspects specific to ij, this is the best the community has come up with.

Maybe the best approach is to strip the ij/script test down so the .sql only does very basic
testing of creating the cursors ('get ... cursor ...', 'next',...) which gives the same result
for DerbyNetClient and embedded. The majority of test cases can then be added as fixtures
to the existing HoldCursorTest.


> Convert "org.apache.derbyTesting.functionTests.tests.lang.holdCursorIJ.sql" to junit.

> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-3801
>                 URL: https://issues.apache.org/jira/browse/DERBY-3801
>             Project: Derby
>          Issue Type: Test
>            Reporter: Junjie Peng
>            Assignee: Junjie Peng
>         Attachments: derby-3801-1-patch.txt
>
>
> Convert "org.apache.derbyTesting.functionTests.tests.lang.holdCursorIJ.sql" to junit.


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