/**
* Calling with 'a' causes a NFE which results in an error.
* @throws Exception
*/
public void testMaxThreads_Invalid() throws Exception {
NetworkServerControl server = new NetworkServerControl(InetAddress.getLocalHost(),TestConfiguration.getCurrent().getPort());
String[] maxthreadsCmd5 = new String[]{"org.apache.derby.drda.NetworkServerControl",
"maxthreads", "10000","-p", String.valueOf(TestConfiguration.getCurrent().getPort())};
assertExecJavaCmdAsExpected(new String[]{"Max threads changed to 10000."}, maxthreadsCmd5, 0);
int maxValue = server.getMaxThreads();
assertEquals("Fail! Max threads value incorrect!", 10000, maxValue);
String[] maxthreadsCmd6 = new String[]{"org.apache.derby.drda.NetworkServerControl",
"maxthreads", "a"};
assertExecJavaCmdAsExpected(new String[]{"Invalid value, a, for maxthreads.",
"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>]",}, maxthreadsCmd6, 1);
maxValue = server.getMaxThreads();
assertEquals("Fail! Max threads value incorrect!", 10000, maxValue);
}