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 "Kristian Waagan (JIRA)" <ji...@apache.org> on 2007/10/26 07:45:50 UTC

[jira] Created: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Reduce dependency on NetworkServerControl in TestConfiguration
--------------------------------------------------------------

                 Key: DERBY-3151
                 URL: https://issues.apache.org/jira/browse/DERBY-3151
             Project: Derby
          Issue Type: Improvement
          Components: Test
    Affects Versions: 10.4.0.0
            Reporter: Kristian Waagan
            Priority: Minor
             Fix For: 10.4.0.0


Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).

I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.

With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.

The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
A typical error message:
Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl

I'm sure there are other solutions as well, but this one is really easy.
Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537979 ] 

Daniel John Debrunner commented on DERBY-3151:
----------------------------------------------

Was there some recent change that caused this? I used to run tests without derbynet.jar with no problems.
That's alos how the J2ME foundation runs are usually made.

There is a test method to see if the network server is available, Derby.hasServer.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-1a-proposal.diff

'derby-3151-1a-proposal.diff' is a proposal of what can be done.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604388#action_12604388 ] 

Dag H. Wanvik commented on DERBY-3151:
--------------------------------------

In derby-3151-2a-wrapper, the contructor seems to push and then immediately pop
the value of derby.drda.sslMode. What is the purpose of this?


> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-4a-wrapper_with_reflection.diff

Uploaded a new version of the 4a patch. There was no reason to duplicate the logic, so reflection is now being used to obtain a NetworkServerControl instance through a static method in NetworkServerTestSetup (as before).
I found it easier to keep the new wrapper class, but in theory this code could be moved into TestConfiguration. I do feel that TestConfiguration is large enough as it is, so I prefer not to add more code to it unless it is necessary.

I'm a bit unsure about the error handling. Is it sufficient?

My regression test got aborted, so I've restarted it. 
Patch ready for commit.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-2b-wrapper.diff

'derby-3151-2b-wrapper.diff' has the following changes: some restructuring in the constructor, fixed typos, removed a commented code line and added comments.

Thank you for reviewing the patch Dag.
There is no purpose of what you describe. It's a bug I introduced by copying code and then making some small changes...

The second revision is available for review.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Assigned: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan reassigned DERBY-3151:
--------------------------------------

    Assignee: Kristian Waagan

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Issue Comment Edited: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545741 ] 

mamtas edited comment on DERBY-3151 at 11/27/07 12:35 AM:
-------------------------------------------------------------------

Once we reach a resolution to this jira entry, we should provide a similar central mechanism to start and stop network server in 10.3 codeline. Currently, in 10.3 codeline,  tests like TestConnectionMethods.java and OutBufferedStream.java have their own code to start and stop network server. I will be soon committing changes(in 10.3 codeline) into jdbcapi.DataSourceTest and jdbc4.DataSourceTest which will also have code to start and stop network server. It will be good for the some base class in 10.3 to provide start and stop network server functionality so specific tests can rely on that functionality rather than duplicating code.

      was (Author: mamtas):
    Once we need a resolution to this jira entry, we should provide a similar central mechanism to start and stop network server in 10.3 codeline. Currently, in 10.3 codeline,  tests like TestConnectionMethods.java and OutBufferedStream.java have their own code to start and stop network server. I will be soon committing changes(in 10.3 codeline) into jdbcapi.DataSourceTest and jdbc4.DataSourceTest which will also have code to start and stop network server. It will be good for the some base class in 10.3 to provide start and stop network server functionality so specific tests can rely on that functionality rather than duplicating code.
  
> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment:     (was: derby-3151-4a-wrapper_with_reflection.diff)

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605796#action_12605796 ] 

Dag H. Wanvik commented on DERBY-3151:
--------------------------------------

Looks good to me, +1.Just some nits (non-blockers):

* header of NetworkServerControlWrapper
  - is depending -> depends        
  - typo: reqired

* Is the NO_ARGS and NO_ARGS_CLASS objects really needed? I think you
  can just use "null". E.g., quoting from Method#invoke JavaDoc:

  "If the number of formal parameters required by the underlying
  method is 0, the supplied args array may be of length 0 or null.

I tried to see if this patch changed anything by removing derbynet.jar
and derbyrun.jar from my classpatch a running a test which uses

            TestConfiguration.clientServerDecorator

but in my environment that worked even without the patch (the
decorator omits the test), cf. TestConfiguration#defaultServerDecorator 
which tests if there are suitable jars available.  But perhaps this is a
problem for other environments like JME (?).


> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Fix Version/s:     (was: 10.4.0.0)

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Rick Hillegas commented on DERBY-3151:
--------------------------------------

This may address Dag's question about class name resolution: The VM spec allows a lot of flexibility in when class references are resolved. See the second paragraph in this section of the vm spec: http://java.sun.com/docs/books/jvms/second_edition/html/Concepts.doc.html#22574

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-4b-wrapper_with_reflection.diff

'derby-3151-4b-wrapper_with_reflection.diff' replaces patch 4a and addresses the comments made by Dag. Thanks for the tip about using 'null' instead of empty arrays!

I don't understand why you don't see the exception. I picked a random test in lang, and got this when I tried running 'lang.TimeHandlingTest' without derbynet.jar and derbyrun.jar:
Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl

I ran this with Sun JDK 1.6. With the patch applied, 3 tests were run (as opposed to 6 with everything on the classpat).
Can you try to run 'lang.TimeHandlingTest' to confirm, so I don't commit anything that's not required?


thanks,

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605112#action_12605112 ] 

Dag H. Wanvik commented on DERBY-3151:
--------------------------------------

I am curious as to why it works to remove the import and just specify the class fully qualified.
It seems the the class loader refrains from looking up NetworkServerControl when you use this trick.
Is this behavior documented anywhere, and is if VM specific? I would have though the only safe way to achive this
late binding was by using reflection, but if this is good enough, thats fine :)


> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-4a-wrapper_with_reflection.diff

'derby-3151-4a-wrapper_with_reflection.diff' uses reflection.
The regression tests haven't completed yet.

Ready for comments!

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605921#action_12605921 ] 

Dag H. Wanvik commented on DERBY-3151:
--------------------------------------

Sorry for the red herring; it was late, I must have forgotten to rebuild the jars so I ran *with* the patch also when I thought I didn't.
So, yes, the patch is needed :)

+1 (modulo some property changes I didn't understand at the beginning of the diff...)

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Issue Comment Edited: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

kristwaa edited comment on DERBY-3151 at 6/17/08 7:34 AM:
-----------------------------------------------------------------

Uploaded a new version of the 4a patch. There was no reason to duplicate the logic, so reflection is now being used to obtain a NetworkServerControl instance through a static method in NetworkServerTestSetup (as before).
I found it easier to keep the new wrapper class, but in theory this code could be moved into TestConfiguration. I do feel that TestConfiguration is large enough as it is, so I prefer not to add more code to it unless it is necessary.

I'm a bit unsure about the error handling. Is it sufficient?

My regression test got aborted, so I've restarted it. 
Patch ready for review.

      was (Author: kristwaa):
    Uploaded a new version of the 4a patch. There was no reason to duplicate the logic, so reflection is now being used to obtain a NetworkServerControl instance through a static method in NetworkServerTestSetup (as before).
I found it easier to keep the new wrapper class, but in theory this code could be moved into TestConfiguration. I do feel that TestConfiguration is large enough as it is, so I prefer not to add more code to it unless it is necessary.

I'm a bit unsure about the error handling. Is it sufficient?

My regression test got aborted, so I've restarted it. 
Patch ready for commit.
  
> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545741 ] 

Mamta A. Satoor commented on DERBY-3151:
----------------------------------------

Once we need a resolution to this jira entry, we should provide a similar central mechanism to start and stop network server in 10.3 codeline. Currently, in 10.3 codeline,  tests like TestConnectionMethods.java and OutBufferedStream.java have their own code to start and stop network server. I will be soon committing changes(in 10.3 codeline) into jdbcapi.DataSourceTest and jdbc4.DataSourceTest which will also have code to start and stop network server. It will be good for the some base class in 10.3 to provide start and stop network server functionality so specific tests can rely on that functionality rather than duplicating code.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Commented: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537988 ] 

Kristian Waagan commented on DERBY-3151:
----------------------------------------

I haven't studied the history much, but maybe something has been added that we already have support for?
The import statement was added the 9th of September, revision 574053.

If I write this test;
package org.apache.derbyTesting.functionTests.tests.jdbcapi;
import junit.framework.Test;
import org.apache.derbyTesting.junit.BaseJDBCTestCase;
import org.apache.derbyTesting.junit.TestConfiguration;

public class BogusTest extends BaseJDBCTestCase {

    public BogusTest(String name) {
        super(name);
    }

    public static Test suite() {
        return TestConfiguration.embeddedSuite(BogusTest.class);
    }
}

And then run it:
java -classpath jars/sane/derbyTesting.jar:jars/sane/derby.jar:tools/java/junit.jar junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.jdbcapi.BogusTest

I get:
Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl

To me this seems like a problem, since I haven't planned to run a network server at all. I just want to run my tests with the embedded driver.
Have I overlooked something?

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Closed: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan closed DERBY-3151.
----------------------------------


There has been no request for a backport, so I'm closing the issue.
A backport can easily be done later anyway.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-4b-wrapper_with_reflection.diff

Thanks for the confirmation and spotting the diff error, Dag.
I accidentally included some property changes done by my IDE in the diff. I'm uploading a new patch (same name).

I intend to commit this tomorrow.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Resolved: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan resolved DERBY-3151.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.5.0.0

Committed 'derby-3151-4b-wrapper_with_reflection.diff' to trunk with revision 669808.

This patch can be backported to 10.4, but it will require either backporting another small change (BaseTestCase.fail(String,Exception)) or a few small changes to the patch (manual merge).
I'll do the backport if I get any requests to do so.

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-2b-wrapper.diff, derby-3151-3a-test.diff, derby-3151-4a-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff, derby-3151-4b-wrapper_with_reflection.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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


[jira] Updated: (DERBY-3151) Reduce dependency on NetworkServerControl in TestConfiguration

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

Kristian Waagan updated DERBY-3151:
-----------------------------------

    Attachment: derby-3151-3a-test.diff
                derby-3151-2a-wrapper.stat
                derby-3151-2a-wrapper.diff

Attaching another fix and a test to demonstrate the problem/fix (see earlier comment for how to run the test).

'derby-3151-2a-wrapper.diff' removes references to NetworkServerControl in TestConfiguration, and uses a wrapper class to start and shutdown a server. I tried using an existing class (NetworkServerTestSetup), but wasn't able to do that easily.
Note that the wrapper class is only intended to solve the problem related to importing NetworkServerControl in TestConfiguration.

Patch ready for review.
Is the patch solving  a problem, or am I just adding complexity?

> Reduce dependency on NetworkServerControl in TestConfiguration
> --------------------------------------------------------------
>
>                 Key: DERBY-3151
>                 URL: https://issues.apache.org/jira/browse/DERBY-3151
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.4.1.3
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3151-1a-proposal.diff, derby-3151-2a-wrapper.diff, derby-3151-2a-wrapper.stat, derby-3151-3a-test.diff
>
>
> Code has been added in TestConfiguration to allow for starting and stopping a Derby network server.
> Even if you know will not need this functionality, or you simply don't want to have this functionality available, you must include derbynet.jar (or point to classes/).
> I think this dependency should be reduced, by not having any instance variables and by not importing the class with an explicit import statement. The existing instance variables are not used.
> With this planned change, you can run tests without including derbynet.jar on the classpath, as long as they don't call 'startNetworkServer' or 'stopNetworkServer'. Most often these methods will be called by a decorator.
> The downside of this change, is that you won't get any error messages before the mentioned methods are actually executed.
> A typical error message:
> Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/derby/drda/NetworkServerControl
> I'm sure there are other solutions as well, but this one is really easy.
> Any opinions on this change?

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