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

Bryan Pendleton commented on DERBY-5261:
----------------------------------------

For an overview of how Derby's regression tests are organized, how to run a 
regression test, and how to contribute new regression tests, please look here: 
https://wiki.apache.org/db-derby/DerbyJUnitTesting

In your particular case, you should be able to run the current 
NetworkServerControlClientCommandTest by:

    ant 
-Dderby.junit.testclass=org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest
  junit-single

To add a new test to this suite, you would modify this Java class, to add a new 
"testDerby5261" method, which would run the command "java -jar derbynet.jar 
abc" and verify that you get the expected message once and only once.

You could add some other syntax error commands, and verify that they get the 
expected message, too, that would be great.

thanks,

bryan



> NetworkServerControl prints usage message twice on some errors
> --------------------------------------------------------------
>
>                 Key: DERBY-5261
>                 URL: https://issues.apache.org/jira/browse/DERBY-5261
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.8.1.2
>            Reporter: Knut Anders Hatlen
>            Assignee: INDIKA KUMARA
>            Priority: Minor
>              Labels: derby_triage10_9
>
> If you invoke NetworkServerControl with an invalid command, the usage message 
> will be printed twice.
> $ java -jar derbynet.jar abc
> Mon Jun 06 10:14:25 CEST 2011 : Command abc is unknown.
> Usage: NetworkServerControl <commands> 
> Commands:
> start [-h <host>] [-p <portnumber>] [-noSecurityManager] [-ssl <sslmode>]
> shutdown [-h <host>][-p <portnumber>] [-ssl <sslmode>] [-user <username>] 
> [-password <password>]
> ping [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> sysinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> runtimeinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> logconnections {on|off} [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> maxthreads <max>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> timeslice <milliseconds>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> trace {on|off} [-s <session id>][-h <host>][-p <portnumber>] [-ssl <sslmode>]
> tracedirectory <traceDirectory>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> Mon Jun 06 10:14:25 CEST 2011 : No command given.
> Usage: NetworkServerControl <commands> 
> Commands:
> start [-h <host>] [-p <portnumber>] [-noSecurityManager] [-ssl <sslmode>]
> shutdown [-h <host>][-p <portnumber>] [-ssl <sslmode>] [-user <username>] 
> [-password <password>]
> ping [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> sysinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> runtimeinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> logconnections {on|off} [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> maxthreads <max>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> timeslice <milliseconds>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> trace {on|off} [-s <session id>][-h <host>][-p <portnumber>] [-ssl <sslmode>]
> tracedirectory <traceDirectory>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> Printing it once should be enough.
> The same problem is seen if you don't specify a required argument for an 
> option. For example "java -jar derbynet start -p" (no port number).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to