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 "Houx Zhang (JIRA)" <ji...@apache.org> on 2011/07/12 15:23:00 UTC

[jira] [Created] (DERBY-5327) Convert tools/ij5.sql to junit

Convert tools/ij5.sql  to junit
-------------------------------

                 Key: DERBY-5327
                 URL: https://issues.apache.org/jira/browse/DERBY-5327
             Project: Derby
          Issue Type: Sub-task
          Components: Test
            Reporter: Houx Zhang
            Assignee: Houx Zhang




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang closed DERBY-5327.
-----------------------------


Thanks for your checking and committing, Bryan.

> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>             Fix For: 10.9.0.0
>
>         Attachments: 5327-1.patch, 5327-2.patch, 5327-2.stat, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5327) Convert tools/ij5.sql to junit

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

Bryan Pendleton commented on DERBY-5327:
----------------------------------------

I think we could re-factor some of the behaviors of utilMain.go() so that they were
also performed by goScript(), and that might make it easier for us to test them.

It would also be OK to defer this issue for now, and work on some of the other
testing and bug-fixing projects, and come back to this later.


> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang updated DERBY-5327:
------------------------------

    Attachment: 5327-2.stat
                5327-2.patch

With ScriptTestCase supporting "ij.showNoCountForSelect" and "ij.showNoConnectionsAtStart", the issue can be pushed forward.

In 5327-2.patch, the property "ij.connection.connOne=jdbc:derby:wombat;create=true" in ij5_app.properties has been removed, as I don'y think this is important with the testing point, and it has been tested fully in other ij test.

Besides, "runwithfoundation=false" is removed too, as ij5.sql doesn't relate to it too much.

> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-2.patch, 5327-2.stat, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5327) Convert tools/ij5.sql to junit

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

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

Just for the reference: the use of ij.connection. property is already tested in the ijConnNameTest.

> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>             Fix For: 10.9.0.0
>
>         Attachments: 5327-1.patch, 5327-2.patch, 5327-2.stat, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang updated DERBY-5327:
------------------------------

    Issue & fix info: [Patch Available]

> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-2.patch, 5327-2.stat, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang updated DERBY-5327:
------------------------------

    Attachment: 5327-ij5-1.out
                5327-1.patch

Ask for help!

I have ij5Test.java to test ij5.sql, but can not get the expected result.

Question 1:
As the ij5.sql has shows:
"1)at the startup time, it will list all the connections".
 I have set  "ij.showNoConnectionsAtStart" to "false". but no connection is shown. Why?

Question 2:
As the ij5.sql has shows:
"2)select will now display number of rows selected".
 I have set  "ij.showNoCountForSelect" to "false". but no count is shown. Why?

Question 3:
With the property "props.setProperty("ij.connection.connOne", "jdbc:derby:wombat;create=true");", connOne is 

created actually(I have ever tested this by adding "show connections;"). However, subclass of ScriptTestCase 

will create wombat by default, this will affect the expected result. How to stop subclass of ScriptTestCase to 

create wombat by default, please?

Thanks!



> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang commented on DERBY-5327:
-----------------------------------

Thanks for your detailed instructions, Bryan.

I think ij5.sql is not suitable to convert by extending ScriptTestCase, even not suitable to convert to junit, as its name contains "ij", which shows it's expected to test as a sql script. So it's best to keep it stay as a script one.

What' your opinion?

> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang edited comment on DERBY-5327 at 7/12/11 1:55 PM:
------------------------------------------------------------

Ask for help!

I have ij5Test.java to test ij5.sql, but can not get the expected result.

Question 1:
As the ij5.sql has shows:
"1)at the startup time, it will list all the connections".
 I have set  "ij.showNoConnectionsAtStart" to "false". but no connection is shown. Why?

Question 2:
As the ij5.sql has shows:
"2)select will now display number of rows selected".
 I have set  "ij.showNoCountForSelect" to "false". but no count is shown. Why?

Question 3:
With the property "props.setProperty("ij.connection.connOne", "jdbc:derby:wombat;create=true");", connOne is created actually(I have ever tested this by adding "show connections;"). However, subclass of ScriptTestCase will create wombat by default, this will affect the expected result. How to stop subclass of ScriptTestCase to create wombat by default, please?

Thanks!



      was (Author: houxzhang):
    Ask for help!

I have ij5Test.java to test ij5.sql, but can not get the expected result.

Question 1:
As the ij5.sql has shows:
"1)at the startup time, it will list all the connections".
 I have set  "ij.showNoConnectionsAtStart" to "false". but no connection is shown. Why?

Question 2:
As the ij5.sql has shows:
"2)select will now display number of rows selected".
 I have set  "ij.showNoCountForSelect" to "false". but no count is shown. Why?

Question 3:
With the property "props.setProperty("ij.connection.connOne", "jdbc:derby:wombat;create=true");", connOne is 

created actually(I have ever tested this by adding "show connections;"). However, subclass of ScriptTestCase 

will create wombat by default, this will affect the expected result. How to stop subclass of ScriptTestCase to 

create wombat by default, please?

Thanks!


  
> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5327) Convert tools/ij5.sql to junit

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

Houx Zhang commented on DERBY-5327:
-----------------------------------

OK, I will work on other tasks first.

> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5327) Convert tools/ij5.sql to junit

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

Bryan Pendleton resolved DERBY-5327.
------------------------------------

          Resolution: Fixed
       Fix Version/s: 10.9.0.0
    Issue & fix info:   (was: [Patch Available])

The new test program seems quite clean now.

I ran both the tools suite and the old derbytools tests and
everything seemed fine to me, so I committed this to the
trunk as revision 1152796.

Thank you for the contribution!


> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>             Fix For: 10.9.0.0
>
>         Attachments: 5327-1.patch, 5327-2.patch, 5327-2.stat, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5327) Convert tools/ij5.sql to junit

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

Bryan Pendleton commented on DERBY-5327:
----------------------------------------

I think that these problems arise from the fact that ScriptTestCase.runTest calls
ij.runScript, which in turn calls utilMain.goScript, and these are not the "normal"
ij invocation methods, but rather are slightly special and don't do quite the
same things.

In particular:

Question 1: 
  Since ij.runScript calls utilMain.goScript, rather than utilMain.go, we don't
ever process the ij.showNoConnectionsAtStart logic, because the code to
show the connections at start is in utilMain.go, and isn't being executed.

Question 2: 
  Similar to (1), ij.showNoCountForSelect is handled by utilMain.go, and so
it isn't being executed, either.

Question 3:
  ScriptTestCase passes a newly-created connection through to utilMain.goScript,
and it gets set to be the current connection, which does indeed affect the
expected result. I had some limited success with fixing this by making the
following change to utilMain.goScript; the idea is that if there is already a current
session when goScript() is called, it should preserve that current session
instead of using the connection passed to it from the caller.

Index: utilMain.java
===================================================================
--- utilMain.java	(revision 1145422)
+++ utilMain.java	(working copy)
@@ -273,7 +273,10 @@
 			LocalizedInput in)
 	{
 		JDBCDisplayUtil.showSelectCount = false;
+		Session curSess = connEnv[0].getSession();
 		connEnv[0].addSession(conn, (String) null);
+		if( curSess != null )
+			connEnv[0].setCurrentSession( curSess.name );
 		fileInput = initialFileInput = !in.isStandardInput();
 		commandGrabber[0].ReInit(in);
 		return runScriptGuts();

I guess the bottom line here is that 'ij5.sql' is testing certain
features of utilMain.go(), and therefore it is hard to test these
through ScriptTestCase because it uses runScript/goScript
rather than go().



> Convert tools/ij5.sql  to junit
> -------------------------------
>
>                 Key: DERBY-5327
>                 URL: https://issues.apache.org/jira/browse/DERBY-5327
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Test
>            Reporter: Houx Zhang
>            Assignee: Houx Zhang
>              Labels: gsoc2011
>         Attachments: 5327-1.patch, 5327-ij5-1.out
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira