db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r348577 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/functionTests/mast...
Date Wed, 23 Nov 2005 21:52:34 GMT
Author: kmarsden
Date: Wed Nov 23 13:52:19 2005
New Revision: 348577

URL: http://svn.apache.org/viewcvs?rev=348577&view=rev
Log:
DERBY-706 Improve testing and increase code coverage for Network Server classes
Contributed by Deepa Remesh

This patch adds some tests for network server and re-arranges/removes some internal methods
which are not used. 

Details of patch are: * derbynet/getCurrentProperties.java - Added tests for NetworkServerControl.logConnections
and setTraceDirectory methods. Modified getCurrentProperties_sed.properties to use a substitute
instead of delete for traceDirectory. * derbynet/testProperties.java - Added some more command
line tests. * derbynet/timeslice.java and maxthreads.java - Added tests for invalid values.
* derbynet/runtimeinfo.java and sysinfo.java - Added test to call methods in NetworkServer
control * Modified master files. * DRDAResultSet.java - removed unused constructor "DRDAResultSet(ResultSet
rs)" * DRDAStatement.java - Changed getNumRsCols() to use getRsDRDATypes() instead of directly
calling DRDAResultSet method. Removed isProcedure() method which is not used. Changed getResultSetCursorName()
to call drdaRs.getResultSetCursorName() which handles case for null result set. * NetworkServerControlImpl.java
- Removed methods for connection pooling which is not implemented and not used. With this
patch, I ran derbyall with Sun JDK 1.4.2. No failures. 


Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/sysinfo.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/runtimeinfo.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/sysinfo.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurrentProperties.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxthreads.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/runtimeinfo.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/timeslice.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java Wed Nov 23
13:52:19 2005
@@ -82,14 +82,6 @@
 
 	protected String pkgcnstknStr;               // Unique consistency token for ResultSet 0
 
-
-
-	protected DRDAResultSet(ResultSet rs) throws SQLException
-	{
-		setResultSet(rs);
-		state = NOT_OPENED;
-	}
-
 	protected DRDAResultSet()
 	{
 		state = NOT_OPENED;

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java Wed Nov 23
13:52:19 2005
@@ -802,7 +802,6 @@
 		}
 	}
 	
-
 	/*
 	 * get DRDAResultSet by result set number
 	 *
@@ -1183,7 +1182,7 @@
 
 	protected int getNumRsCols()
 	{
-		int[] rsDrdaTypes = currentDrdaRs.getRsDRDATypes();
+		int[] rsDrdaTypes = getRsDRDATypes();
 		if (rsDrdaTypes != null)
 			return rsDrdaTypes.length;
 		else 
@@ -1224,24 +1223,12 @@
 	}
 
 	/**
-	 * return whether this is a procedure
-	 * 
-	 * @return true if procName is not null 
-	 * RESOLVE: (should we check for isCall or is this good enough)
-	 */ 
-	public  boolean isProcedure()
-	{
-		return (procName != null);
-	}
-
-
-	/**
 	 * @param rsNum  - result set # starting with 0 
 	 */
 	public String getResultSetCursorName(int rsNum) throws SQLException
 	{
-		ResultSet rs = getResultSet(rsNum);
-		return rs.getCursorName();			
+		DRDAResultSet drdaRs = getDrdaResultSet(rsNum);
+		return drdaRs.getResultSetCursorName();			
 
 	}
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Wed Nov 23 13:52:19 2005
@@ -916,48 +916,6 @@
 	}
 
 	/**
-	 * Set connection pool parameters for a database
-	 *
-	 * @param database	database parameters applied to
-	 * @param min		minimum number of connections, if 0, pooled connections not used
-	 *						if -1, use default						
-	 * @param max		maximum number of connections, if 0, pooled connections 
-	 *						created when no free connection available, if -1, 
-	 *						use default
-	 * @param host		machine network server is running on, if null, localhost is used
-	 * @param portNumber	port number server is to use, if <= 0, default port number
-	 *			is used
-	 *
-	 * @exception Exception	throws an exception if an error occurs
-	 */
-	protected void setConnectionPoolParameters(String database, int min, int max,
-		String host, int portNumber)
-		throws Exception
-	{
-		consolePropertyMessage("DRDA_NotImplemented.S", "conpool");
-	}
-
-	/**
-	 * Set default connection pool parameters 
-	 *
-	 * @param min		minimum number of connections, if 0, pooled connections not used
-	 *						if -1, use default
-	 * @param max		maximum number of connections, if 0, pooled connections 
-	 *						created when no free connection available
-	 *						if -1, use default
-	 * @param host		machine network server is running on, if null, localhost is used
-	 * @param portNumber	port number server is to use, if <= 0, default port number
-	 *			is used
-	 *
-	 * @exception Exception	throws an exception if an error occurs
-	 */
-	protected void setConnectionPoolParameters(int min, int max, String host, 
-			int portNumber) throws Exception
-	{
-		consolePropertyMessage("DRDA_NotImplemented.S", "conpool");
-	}
-
-	/**
 	 * Connect to  network server and set connection maxthread parameter
 	 *
 	 * @param max		maximum number of connections, if 0, connections 
@@ -2974,52 +2932,7 @@
 			maxThreads = value;
 		}
 	}
-	/**
-	 * Get the current value of minimum number of pooled connections to create at start
-	 *
-	 * @return value of minimum number of pooled connections
-	 */
-	private int getMinPoolSize()
-	{
-		synchronized(threadsSync) {
-			return minPoolSize;
-		}
-	}
-
-	/**
-	 * Set the current value of minimum number of pooled connections to create at start
-	 *
-	 * @param value	 value of minimum number of pooled connections
-	 */
-	private void setMinPoolSize(int value)
-	{
-		synchronized(poolSync) {
-			minPoolSize = value;
-		}
-	}
-	
-	/**
-	 * Get the current value of maximum number of pooled connections to create 
-	 *
-	 * @return value of maximum number of pooled connections
-	 */
-	private int getMaxPoolSize()
-	{
-		synchronized(poolSync) {
-			return maxPoolSize;
-		}
-	}
-	/**
-	 * Set the current value of maximum number of pooled connections to create 
-	 *
-	 * @param value	value of maximum number of pooled connections
-	 */
-	private void setMaxPoolSize(int value)
-	{
-		synchronized(poolSync) {
-			maxPoolSize = value;
-		}
-	}
+		
 	/**
 	 * Get the current value of whether to trace all the sessions
 	 *

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/sysinfo.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/sysinfo.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/sysinfo.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/sysinfo.out
Wed Nov 23 13:52:19 2005
@@ -26,6 +26,33 @@
 Found support for locale: [zh_TW]
 -----
 End test
+Testing Sysinfo (method)
+----- Derby Network Server Information --------
+----- listing properties --
+derby.drda.maxThreads=0
+derby.drda.keepAlive=true
+derby.drda.minThreads=0
+derby.drda.portNumber=1527
+derby.drda.logConnections=false
+derby.drda.timeSlice=0
+derby.drda.startNetworkServer=false
+derby.drda.host=localhost
+derby.drda.traceAll=false
+----- Derby Information --------
+-----
+----- Locale Information -----------------
+Current Locale :  [English/United States [en_US]]
+Found support for locale: [de_DE]
+Found support for locale: [es]
+Found support for locale: [fr]
+Found support for locale: [it]
+Found support for locale: [ja_JP]
+Found support for locale: [ko_KR]
+Found support for locale: [pt_BR]
+Found support for locale: [zh_CN]
+Found support for locale: [zh_TW]
+-----
+End test (method)
 Testing Sysinfo (locale)
 -----Duser.language=err -Duser.country=DE org.apache.derby.drda.NetworkServerControl sysinfo

 ----- Derby Network Server Information --------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/runtimeinfo.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/runtimeinfo.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/runtimeinfo.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/runtimeinfo.out
Wed Nov 23 13:52:19 2005
@@ -16,6 +16,23 @@
 # Waiting  Sessions : 0
 Total Memory : #####	Free Memory : #####
 End test
+Testing Runtimeinfo (method)
+----- Derby Network Server Runtime Information ---
+----- Session Information ---------------
+Session # :2
+Database :wombat;create=true
+User :APP
+# Statements:0
+Prepared Statement Information: 
+	Stmt ID		SQLText
+	-------------	-----------
+Session # :4
+-----
+# Connection Threads : 2
+# Active Sessions : 2
+# Waiting  Sessions : 0
+Total Memory : #####	Free Memory : #####
+End test (method)
 Testing Runtimeinfo (locale)
 -----Duser.language=err -Duser.country=DE org.apache.derby.drda.NetworkServerControl runtimeinfo

 ----- Derby Network Server Runtime Information ---
@@ -29,7 +46,7 @@
 	-------------	-----------
 	SYSLH0002	VALUES(1)
 	SYSLH0001	SELECT count(*) from sys.systables
-Session # :4
+Session # :5
 Database :wombat;create=true
 User :APP
 # Statements:2
@@ -38,14 +55,14 @@
 	-------------	-----------
 	SYSLH0002	VALUES(2)
 	SYSLH0001	SELECT count(*) from sys.systables
-Session # :5
+Session # :6
 Database :wombat;create=true
 User :APP
 # Statements:0
 Prepared Statement Information: 
 	Stmt ID		SQLText
 	-------------	-----------
-Session # :6
+Session # :7
 -----
 # Connection Threads : 4
 # Active Sessions : 4
@@ -56,7 +73,7 @@
 org.apache.derby.drda.NetworkServerControl runtimeinfo 
 ----- Derby Network Server Runtime Information ---
 ----- Session Information ---------------
-Session # :7
+Session # :8
 -----
 # Connection Threads : 4
 # Active Sessions : 1

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/sysinfo.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/sysinfo.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/sysinfo.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/sysinfo.out
Wed Nov 23 13:52:19 2005
@@ -26,6 +26,33 @@
 Found support for locale: [zh_TW]
 -----
 End test
+Testing Sysinfo (method)
+----- Derby Network Server Information --------
+----- listing properties --
+derby.drda.maxThreads=0
+derby.drda.keepAlive=true
+derby.drda.minThreads=0
+derby.drda.portNumber=1527
+derby.drda.logConnections=false
+derby.drda.timeSlice=0
+derby.drda.startNetworkServer=false
+derby.drda.host=localhost
+derby.drda.traceAll=false
+----- Derby Information --------
+-----
+----- Locale Information -----------------
+Current Locale :  [English/United States [en_US]]
+Found support for locale: [de_DE]
+Found support for locale: [es]
+Found support for locale: [fr]
+Found support for locale: [it]
+Found support for locale: [ja_JP]
+Found support for locale: [ko_KR]
+Found support for locale: [pt_BR]
+Found support for locale: [zh_CN]
+Found support for locale: [zh_TW]
+-----
+End test (method)
 Testing Sysinfo (locale)
 -----Duser.language=err -Duser.country=DE org.apache.derby.drda.NetworkServerControl sysinfo

 ----- Derby Network Server Information --------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurrentProperties.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurrentProperties.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurrentProperties.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurrentProperties.out
Wed Nov 23 13:52:19 2005
@@ -1,4 +1,5 @@
 ----- listing properties --
+derby.drda.traceDirectory=MACHINE_SPECIFIC_DIR
 derby.drda.maxThreads=0
 derby.drda.keepAlive=true
 derby.drda.minThreads=0
@@ -10,23 +11,25 @@
 derby.drda.traceAll=false
 Properties with tracing on
 ----- listing properties --
+derby.drda.traceDirectory=MACHINE_SPECIFIC_DIR
 derby.drda.maxThreads=0
 derby.drda.trace.3=true
 derby.drda.keepAlive=true
 derby.drda.minThreads=0
 derby.drda.portNumber=1527
-derby.drda.logConnections=false
+derby.drda.logConnections=true
 derby.drda.timeSlice=0
 derby.drda.startNetworkServer=false
 derby.drda.host=localhost
 derby.drda.traceAll=false
 Properties with tracing on
 ----- listing properties --
+derby.drda.traceDirectory=MACHINE_SPECIFIC_DIR
 derby.drda.maxThreads=0
 derby.drda.keepAlive=true
 derby.drda.minThreads=0
 derby.drda.portNumber=1527
-derby.drda.logConnections=false
+derby.drda.logConnections=true
 derby.drda.timeSlice=0
 derby.drda.startNetworkServer=false
 derby.drda.host=localhost

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxthreads.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxthreads.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxthreads.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxthreads.out
Wed Nov 23 13:52:19 2005
@@ -26,6 +26,20 @@
 org.apache.derby.drda.NetworkServerControl maxthreads 9000 
 Max threads changed to 9000.
 PASS - max threads value, 9000 is correct
+org.apache.derby.drda.NetworkServerControl maxthreads a 
+Invalid value, a, for maxthreads.
+Usage: NetworkServerControl <commands> 
+Commands:
+start [-h <host>] [-p <portnumber>]
+shutdown [-h <host>][-p <portnumber>]
+ping [-h <host>][-p <portnumber>]
+sysinfo [-h <host>][-p <portnumber>]
+runtimeinfo [-h <host>][-p <portnumber>]
+logconnections {on |off}[-h <host>][-p <portnumber>]
+maxthreads <max>[-h <host>][-p <portnumber>]
+timeslice <milliseconds>[-h <host>][-p <portnumber>]
+trace {on |off} [-s <session id>][-h <host>][-p <portnumber>]
+tracedirectory <traceDirectory>[-h <host>][-p <portnumber>]
 PASS - max threads value, 0 is correct
 PASS - max threads value, 0 is correct
 DRDA_InvalidValue.U:Invalid value, -2, for maxthreads.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/runtimeinfo.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/runtimeinfo.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/runtimeinfo.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/runtimeinfo.out
Wed Nov 23 13:52:19 2005
@@ -16,6 +16,23 @@
 # Waiting  Sessions : 0
 Total Memory : #####	Free Memory : #####
 End test
+Testing Runtimeinfo (method)
+----- Derby Network Server Runtime Information ---
+----- Session Information ---------------
+Session # :2
+Database :wombat;create=true
+User :APP
+# Statements:0
+Prepared Statement Information: 
+	Stmt ID		SQLText
+	-------------	-----------
+Session # :4
+-----
+# Connection Threads : 2
+# Active Sessions : 2
+# Waiting  Sessions : 0
+Total Memory : #####	Free Memory : #####
+End test (method)
 Testing Runtimeinfo (locale)
 -----Duser.language=err -Duser.country=DE org.apache.derby.drda.NetworkServerControl runtimeinfo

 ----- Derby Network Server Runtime Information ---
@@ -29,7 +46,7 @@
 	-------------	-----------
 	SYSSH2001	SELECT count(*) from sys.systables
 	SYSSH2002	VALUES(1)
-Session # :4
+Session # :5
 Database :wombat;create=true
 User :APP
 # Statements:2
@@ -38,14 +55,14 @@
 	-------------	-----------
 	SYSSH2001	SELECT count(*) from sys.systables
 	SYSSH2002	VALUES(2)
-Session # :5
+Session # :6
 Database :wombat;create=true
 User :APP
 # Statements:0
 Prepared Statement Information: 
 	Stmt ID		SQLText
 	-------------	-----------
-Session # :6
+Session # :7
 -----
 # Connection Threads : 4
 # Active Sessions : 4
@@ -56,7 +73,7 @@
 org.apache.derby.drda.NetworkServerControl runtimeinfo 
 ----- Derby Network Server Runtime Information ---
 ----- Session Information ---------------
-Session # :7
+Session # :8
 -----
 # Connection Threads : 4
 # Active Sessions : 1

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
Wed Nov 23 13:52:19 2005
@@ -29,7 +29,63 @@
 derby.drda.startNetworkServer=false
 derby.drda.host=localhost
 derby.drda.traceAll=false
-Successfully Connected
+org.apache.derby.drda.NetworkServerControl trace on -p 1527 
+Trace turned on for all sessions.
+Trace turned on for all sessions.
+org.apache.derby.drda.NetworkServerControl logconnections on -p 1527 
+Log Connections changed to on.
+-- listing properties --
+derby.drda.maxThreads=0
+derby.drda.keepAlive=true
+derby.drda.minThreads=0
+derby.drda.portNumber=1527
+derby.drda.logConnections=true
+derby.drda.timeSlice=0
+derby.drda.startNetworkServer=false
+derby.drda.host=localhost
+derby.drda.traceAll=true
 org.apache.derby.drda.NetworkServerControl shutdown -p 1527 
 Shutdown successful.
+org.apache.derby.drda.NetworkServerControl 
+No arguments given.
+Usage: NetworkServerControl <commands> 
+Commands:
+start [-h <host>] [-p <portnumber>]
+shutdown [-h <host>][-p <portnumber>]
+ping [-h <host>][-p <portnumber>]
+sysinfo [-h <host>][-p <portnumber>]
+runtimeinfo [-h <host>][-p <portnumber>]
+logconnections {on|off}[-h <host>][-p <portnumber>]
+maxthreads <max>[-h <host>][-p <portnumber>]
+timeslice <milliseconds>[-h <host>][-p <portnumber>]
+trace {on|off} [-s <session id>][-h <host>][-p <portnumber>]
+tracedirectory <traceDirectory>[-h <host>][-p <portnumber>]
+org.apache.derby.drda.NetworkServerControl unknowncmd 
+Command unknowncmd is unknown.
+Usage: NetworkServerControl <commands> 
+Commands:
+start [-h <host>] [-p <portnumber>]
+shutdown [-h <host>][-p <portnumber>]
+ping [-h <host>][-p <portnumber>]
+sysinfo [-h <host>][-p <portnumber>]
+runtimeinfo [-h <host>][-p <portnumber>]
+logconnections {on|off}[-h <host>][-p <portnumber>]
+maxthreads <max>[-h <host>][-p <portnumber>]
+timeslice <milliseconds>[-h <host>][-p <portnumber>]
+trace {on|off} [-s <session id>][-h <host>][-p <portnumber>]
+tracedirectory <traceDirectory>[-h <host>][-p <portnumber>]
+org.apache.derby.drda.NetworkServerControl ping arg1 
+Invalid number of arguments for command ping.
+Usage: NetworkServerControl <commands> 
+Commands:
+start [-h <host>] [-p <portnumber>]
+shutdown [-h <host>][-p <portnumber>]
+ping [-h <host>][-p <portnumber>]
+sysinfo [-h <host>][-p <portnumber>]
+runtimeinfo [-h <host>][-p <portnumber>]
+logconnections {on|off}[-h <host>][-p <portnumber>]
+maxthreads <max>[-h <host>][-p <portnumber>]
+timeslice <milliseconds>[-h <host>][-p <portnumber>]
+trace {on|off} [-s <session id>][-h <host>][-p <portnumber>]
+tracedirectory <traceDirectory>[-h <host>][-p <portnumber>]
 End test

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/timeslice.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/timeslice.out?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/timeslice.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/timeslice.out
Wed Nov 23 13:52:19 2005
@@ -26,6 +26,20 @@
 org.apache.derby.drda.NetworkServerControl timeslice 9000 
 Time slice changed to 9000.
 PASS - time slice value, 9000 is correct
+org.apache.derby.drda.NetworkServerControl timeslice a 
+Invalid value, a, for timeslice.
+Usage: NetworkServerControl <commands> 
+Commands:
+start [-h <host>] [-p <portnumber>]
+shutdown [-h <host>][-p <portnumber>]
+ping [-h <host>][-p <portnumber>]
+sysinfo [-h <host>][-p <portnumber>]
+runtimeinfo [-h <host>][-p <portnumber>]
+logconnections {on |off}[-h <host>][-p <portnumber>]
+maxthreads <max>[-h <host>][-p <portnumber>]
+timeslice <milliseconds>[-h <host>][-p <portnumber>]
+trace {on |off} [-s <session id>][-h <host>][-p <portnumber>]
+tracedirectory <traceDirectory>[-h <host>][-p <portnumber>]
 PASS - time slice value, 0 is correct
 PASS - time slice value, 0 is correct
 Expecting exception:DRDA_InvalidValue.U:Invalid value, -2, for timeslice.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties.java
Wed Nov 23 13:52:19 2005
@@ -32,6 +32,8 @@
 
 public class getCurrentProperties
 {
+	private static final String DERBY_SYSTEM_HOME = System.getProperty("derby.system.home");
+	
 	private static Properties properties = new java.util.Properties();
 	private static Object joinsync = new Object();
 	private static boolean start = false;
@@ -51,12 +53,16 @@
 			//server.setLogWriter(System.out);
 			// set tracing on for the waiting connection
 			server.trace(3, true);
+			//test NetworkServerControl.logConnections
+			server.logConnections(true);
 			// get properties
 			System.out.println("Properties with tracing on");
 			p = server.getCurrentProperties();
 			p.list(System.out);
 			// set tracing on for all connections
 			server.trace(true);
+			//test NetworkServerControl.setTraceDirectory
+			server.setTraceDirectory(DERBY_SYSTEM_HOME);
 			// get properties
 			System.out.println("Properties with tracing on");
 			p = server.getCurrentProperties();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/getCurrentProperties_sed.properties
Wed Nov 23 13:52:19 2005
@@ -6,4 +6,4 @@
 # Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
 #   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
 # No commas or semicolons can be allowed in the patterns/subsitutes.
-delete=traceDirectory
\ No newline at end of file
+substitute=derby.drda.traceDirectory=.*;derby.drda.traceDirectory=MACHINE_SPECIFIC_DIR
\ No newline at end of file

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/maxthreads.java
Wed Nov 23 13:52:19 2005
@@ -51,6 +51,8 @@
 		"maxthreads", "2147483647"};
 	private static String[] maxthreadsCmd5 = new String[] {"org.apache.derby.drda.NetworkServerControl",
 		"maxthreads", "9000"};
+	private static String[] maxthreadsCmd6 = new String[] {"org.apache.derby.drda.NetworkServerControl",
+			"maxthreads", "a"};
     private static  BufferedOutputStream bos = null;
 	private static  NetworkServerControl server;
 	private static String host = "localhost";
@@ -146,6 +148,8 @@
 			//test maxthreads 9000 - should work
 			execCmdDumpResults(maxthreadsCmd5);	
 			checkMaxThreads(9000);
+			//test maxthreads with invalid value (NumberFormatException)
+			execCmdDumpResults(maxthreadsCmd6);	
 			// try the same values using the callable interface
 			//test maxthreads 0
 			server.setMaxThreads(0);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/runtimeinfo.java
Wed Nov 23 13:52:19 2005
@@ -19,6 +19,7 @@
  */
 package org.apache.derbyTesting.functionTests.tests.derbynet;
 
+import java.net.InetAddress;
 import java.sql.*;
 import java.util.Vector;
 import java.util.Properties;
@@ -28,6 +29,7 @@
 
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derby.tools.ij;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derby.tools.JDBCDisplayUtil;
@@ -115,7 +117,17 @@
 			System.out.println("Testing Runtimeinfo");
 			execCmdDumpResults(RuntimeinfoCmd);	
 			System.out.println("End test");
-
+			
+			/******************************************************************
+			 *  Test runtimeinfo by calling NetworkServerControl.getRuntimeInfo
+			******************************************************************/
+			System.out.println("Testing Runtimeinfo (method)");
+			NetworkServerControl derbyServer = 
+				new NetworkServerControl( InetAddress.getByName("localhost"),
+										NetworkServerControl.DEFAULT_PORTNUMBER);
+			System.out.println(derbyServer.getRuntimeInfo());	
+			System.out.println("End test (method)");
+			
 			// Now get a couple of connections with some prepared statements
 			Connection conn2 = ij.startJBMS();
 			PreparedStatement ps = prepareAndExecuteQuery(conn1,"SELECT count(*) from sys.systables");

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/sysinfo.java
Wed Nov 23 13:52:19 2005
@@ -25,9 +25,11 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.BufferedOutputStream;
+import java.net.InetAddress;
 
 import org.apache.derbyTesting.functionTests.harness.jvm;
 import org.apache.derbyTesting.functionTests.harness.ProcessStreamResult;
+import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derby.tools.ij;
 
 /**
@@ -110,7 +112,17 @@
 			System.out.println("Testing Sysinfo");
 			execCmdDumpResults(SysInfoCmd);	
 			System.out.println("End test");
-
+			
+			/************************************************************
+			 *  Test sysinfo by calling NetworkServerControl.getSysinfo()
+			 ************************************************************/
+			System.out.println("Testing Sysinfo (method)");
+			NetworkServerControl derbyServer = 
+				new NetworkServerControl( InetAddress.getByName("localhost"),
+										NetworkServerControl.DEFAULT_PORTNUMBER);
+			System.out.println(derbyServer.getSysinfo());
+			System.out.println("End test (method)");
+			
 			/************************************************************
 			 *  Test sysinfo w/ foreign (non-English) locale
 			 ************************************************************/

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
Wed Nov 23 13:52:19 2005
@@ -70,8 +70,38 @@
 									"-Dderby.drda.debug",
 									"org.apache.derby.drda.NetworkServerControl",
 									"start"};
-
-	/**
+    
+    //No arguments
+    private static String[] cmdWithoutArgs =
+					new String[] {  "org.apache.derby.drda.NetworkServerControl"};
+    
+    //Unknown command
+    private static String[] cmdUnknown =
+					new String[] {  "org.apache.derby.drda.NetworkServerControl",
+    								"unknowncmd"};
+    
+    //wrong no: of arguments
+    private static String[] cmdWithWrongArgNum =
+					new String[] {  "org.apache.derby.drda.NetworkServerControl",
+    								"ping",
+									"arg1"};
+    
+    //trace on
+    private static String[] cmdTraceOn =
+					new String[] {  "org.apache.derby.drda.NetworkServerControl",
+    								"trace",
+									"on",
+									"-p",
+									"1527"};
+    
+    //logconnections on
+    private static String[] cmdLogconnectionsOn =
+					new String[] {  "org.apache.derby.drda.NetworkServerControl",
+    								"logconnections",
+									"on",
+									"-p",
+									"1527"};	
+    /**
 	 * Execute the given command and dump the results to standard out
 	 *
 	 * @param args	command and arguments
@@ -243,9 +273,16 @@
 			waitForStart("1527",15000);
 			//check that default properties are used
 			listProperties("1527");
-			System.out.println("Successfully Connected");
+			execCmdDumpResults(cmdTraceOn);
+			execCmdDumpResults(cmdLogconnectionsOn);
+			listProperties("1527");
 			derbyServerCmd("shutdown","1527");
-
+			
+			//Test error conditions in command-line
+			execCmdDumpResults(cmdWithoutArgs);
+			execCmdDumpResults(cmdUnknown);
+			execCmdDumpResults(cmdWithWrongArgNum);
+			
 			System.out.println("End test");
 			bos.close();
 		}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java?rev=348577&r1=348576&r2=348577&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/timeslice.java
Wed Nov 23 13:52:19 2005
@@ -51,6 +51,8 @@
 		"timeslice", "2147483647"};
 	private static String[] timesliceCmd5 = new String[] {"org.apache.derby.drda.NetworkServerControl",
 		"timeslice", "9000"};
+	private static String[] timesliceCmd6 = new String[] {"org.apache.derby.drda.NetworkServerControl",
+			"timeslice", "a"};
     private static  BufferedOutputStream bos = null;
 	private static  NetworkServerControl server;
 	private static String host = "localhost";
@@ -143,6 +145,8 @@
 			//test timeslice 9000 - should work
 			execCmdDumpResults(timesliceCmd5);	
 			checkTimeSlice(9000);
+			//test timeslice with invlaid value - NumberFormatException
+			execCmdDumpResults(timesliceCmd6);
 			//test callable interface
 			//test timeslice 0
 			server.setTimeSlice(0);



Mime
View raw message