db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r356553 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ testing/org/apache/derbyTesting/functionTest...
Date Tue, 13 Dec 2005 17:41:36 GMT
Author: kmarsden
Date: Tue Dec 13 09:41:06 2005
New Revision: 356553

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

have attached a second patch 'derby-706_2.diff' which adds some more tests and re-arranges/removes
some internal methods. Details of patch are:

* DDMWriter: Removes min method because Math.min is used. Use doesRequestContainData() method.
* DDMReader: Use readCodePoint() method
* DRDAConnThread: QRYOPTVAL codepoint is not part of DRDA spec. parseCcsidSBC was giving NPE.
* CodePointNameTable: Add codepoints to be used in protocol.tests
* protocol.tests: Added tests to cover methods which were not tested before.
* Session, DRDAStatement, Database, DRDAProtocolException: Remove some methods which are not
needed. The same can be done using other methods.
* TestProto: Use lookup method.
* testProtocol: Added "derby.drda.traceAll=true" to derby.properties file to test methods
in DssTrace
* testProperties: Added test for trace off command. Added "derby.drda.traceAll=true" to derby.properties
file to test memcheck.
* runtimeinfo: Rearranged test because the output was not predictable on different jvms/machines.

Ran derbyall with Sun JDK 1.4.2 on WinXP. No failures. 

Contributed by Deepa Remesh



Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol_derby.properties
  (with props)
Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.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/Database.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java
    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/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/testProtocol.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
    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/testProperties.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java Tue Dec
13 09:41:06 2005
@@ -70,6 +70,7 @@
     put (new Integer (CodePoint.MGRDEPRM), "MGRDEPRM");
     put (new Integer (CodePoint.MGRLVLLS), "MGRLVLLS");
     put (new Integer (CodePoint.MGRLVLRM), "MGRLVLRM");
+    put (new Integer (CodePoint.MONITOR), "MONITOR");
     put (new Integer (CodePoint.NBRROW), "NBRROW");
     put (new Integer (CodePoint.OBJNSPRM), "OBJNSPRM");
     put (new Integer (CodePoint.OPNQFLRM), "OPNQFLRM");
@@ -83,6 +84,7 @@
     put (new Integer (CodePoint.PKGBNARM), "PKGBNARM");
     put (new Integer (CodePoint.PKGBPARM), "PKGBPARM");
     put (new Integer (CodePoint.PKGNAMCSN), "PKGNAMCSN");
+    put (new Integer (CodePoint.PKGNAMCT), "PKGNAMCT");
     put (new Integer (CodePoint.PRCCNVRM), "PRCCNVRM");
     put (new Integer (CodePoint.PRDID), "PRDID");
     put (new Integer (CodePoint.PRDDTA), "PRDDTA");
@@ -91,6 +93,7 @@
     put (new Integer (CodePoint.QRYBLKCTL), "QRYBLKCTL");
     put (new Integer (CodePoint.QRYBLKRST), "QRYBLKRST");
     put (new Integer (CodePoint.QRYBLKSZ), "QRYBLKSZ");
+    put (new Integer (CodePoint.QRYCLSRLS), "QRYCLSRLS");
     put (new Integer (CodePoint.QRYDSC), "QRYDSC");
     put (new Integer (CodePoint.QRYDTA), "QRYDTA");
     put (new Integer (CodePoint.QRYINSID), "QRYINSID");

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java Tue Dec 13 09:41:06
2005
@@ -286,17 +286,6 @@
 	}
 
 	/**
-	 * Return buffer 
-	 *
-	 *
-	 * @return buffer
-	 */
-	protected byte [] getBuffer()
-	{
-		return buffer;
-	}
-
-	/**
 	 * Read DSS header
 	 * DSS Header format is 
 	 * 	2 bytes	- length
@@ -513,13 +502,9 @@
 	{
 		ensureBLayerDataInBuffer (4, NO_ADJUST_LENGTHS);
 
-		ddmScalarLen =
-			((buffer[pos++] & 0xff) << 8) +
-			((buffer[pos++] & 0xff) << 0);
-
-		int codePoint =
-			((buffer[pos++] & 0xff) << 8) +
-			((buffer[pos++] & 0xff) << 0);
+		ddmScalarLen = readCodePoint();
+		int codePoint = readCodePoint();
+		
 		if (SanityManager.DEBUG)
 			trace("length = "+ ddmScalarLen + " codepoint = " + java.lang.Integer.toHexString(codePoint));
 		// SYNERRCD 0x0D - Object code point index not supported.

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java Tue Dec 13 09:41:06
2005
@@ -1720,12 +1720,6 @@
     }
   }
 
-
-	private static int min (int i, int j)
-	{
-		return (i < j) ? i : j;
-	}
-
 	protected String toDebugString(String indent)
 	{
 		String s = indent + "***** DDMWriter toDebugString ******\n";
@@ -1815,7 +1809,7 @@
 			agent.trace("Sending data");
 
 		resetChainState();
-		if (offset != 0) {
+		if (doesRequestContainData()) {
 			try {
 				flush(socketOutputStream);
 			} catch (java.io.IOException e) {

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Tue Dec 13
09:41:06 2005
@@ -1714,10 +1714,6 @@
 					// Ignore release of read locks.  Nothing we can do here
 					parseQRYCLSRLS();
 					break;
-				case CodePoint.QRYOPTVAL:
-					// optimize for n rows. Not supported by cloudscape(ignore)
-					parseQRYOPTVAL();
-					break;
 				// optional
 				case CodePoint.MONITOR:
 					parseMONITOR();
@@ -1896,12 +1892,6 @@
 		return 0;
 	}
 
-	private int parseQRYOPTVAL() throws DRDAProtocolException
-	{
-		reader.skipBytes();
-		return 0;
-	}
-
 	/**
 	 * Write a QRYPOPRM - Query Previously opened
 	 * Instance Variables
@@ -4820,7 +4810,17 @@
 	private String parseCcsidSBC(int length) throws DRDAProtocolException
 	{
 		String strVal = null;
-		String ccsidSBCEncoding = database.getCurrentStatement().ccsidSBCEncoding;
+		DRDAStatement  currentStatement;
+		
+		currentStatement = database.getCurrentStatement();
+		if (currentStatement == null)
+		{
+			currentStatement = database.getDefaultStatement();
+			currentStatement.initialize();
+		}
+		String ccsidSBCEncoding = currentStatement.ccsidSBCEncoding;
+		System.out.println("ccsidSBCEncoding - " + ccsidSBCEncoding);
+		
 		if (length == 0)
 			return null;
 		byte [] byteStr = reader.readBytes(length);

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java Tue
Dec 13 09:41:06 2005
@@ -323,37 +323,6 @@
 										oa);
 	}
 	
-	protected final byte[] getCrrtkn()
-	{
-		return crrtkn;
-	}
-	
-	protected final int getCodpntArg()
-	{
-		return codpntArg;
-	}
-	
-	protected final int getErrorCodePoint()
-	{
-		return errorCodePoint;
-	}
-	
-	protected final int getSvrcod()
-	{
-		return  svrcod;
-	}
-	
-	protected final int getErrcd()
-	{
-		return  errcd;
-	}
-	
-	protected final String getMessageid()
-	{
-		return  messageid;
-	}
-	
-	
 	protected final boolean isDisconnectException()
 	{
 		return (errorCodePoint == 0);

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=356553&r1=356552&r2=356553&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 Tue Dec 13
09:41:06 2005
@@ -196,14 +196,6 @@
 	}
 
 	/**
-	 * Set result set options to default for statement
-	 */
-	protected void setRsDefaultOptions()
-	{
-		setRsDefaultOptions(currentDrdaRs);
-	}
-
-	/**
 	 * Get the extData Objects
 	 *
 	 *  @return ArrayList with extdta

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java Tue Dec 13 09:41:06
2005
@@ -164,21 +164,6 @@
 	}
 
 	/**
-	 * Get prepared statement based on pkgnamcsn
-	 *
-	 * @param pkgnamcsn - key to access statement
-	 * @return prepared statement
-	 */
-	protected PreparedStatement getPreparedStatement(String pkgnamcsn) 
-		throws SQLException
-	{
-		currentStatement = getDRDAStatement(pkgnamcsn);
-		if (currentStatement == null)
-			return null;
-		return currentStatement.getPreparedStatement();
-	}
-	
-	/**
 	 * Get a new DRDA statement and store it in the stmtTable if stortStmt is true
 	 * If possible recycle an existing statement
 	 * If we are asking for one with the same name it means it
@@ -271,25 +256,6 @@
 		return attrString;
 	}
 
-	/**
-	 * Get result set
-	 *
-	 * @param pkgnamcsn - key to access prepared statement
-	 * @return result set
-	 */
-	protected ResultSet getResultSet(String pkgnamcsn) throws SQLException
-	{
-		return getDRDAStatement(pkgnamcsn).getResultSet();
-	}
-	/**
- 	 * Set result set
-	 *
-	 * @param value
-	 */
-	protected void setResultSet(ResultSet value) throws SQLException
-	{
-		currentStatement.setResultSet(value);
-	}
 	/**
 	 * Store DRDA prepared statement
 	 * @param  stmt	DRDA prepared statement

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java Tue Dec 13 09:41:06
2005
@@ -268,34 +268,4 @@
 		s += "\n";
 		return s;
 	}
-
-	private String getStateString(int s)
-	{
-		switch (s)
-		{
-			case INIT: 
-				return "INIT";
-			case ATTEXC:
-				return "ATTEXC";
-			case CLOSED:
-				return "CLOSED";
-			default:
-				return "UNKNOWN_STATE";
-
-		}
-	}
-
-	private String getTypeString(int t)
-	{
-		switch (t)
-		{
-			case DRDA_SESSION:
-				return "DRDA_SESSION";
-			case CMD_SESSION:
-				return "CMD_SESSION";
-			default:
-				return "UNKNOWN_TYPE";
-		}
-					
-	}
 }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java Tue Dec 13 09:41:06
2005
@@ -865,8 +865,8 @@
 	 */
 	private void cpError(int cp, int reqCP) throws IOException
 	{
-		String cpName = (String)codePointNameTable.get(new Integer(cp));
-		String reqCPName = (String)codePointNameTable.get(new Integer(reqCP));
+		String cpName = codePointNameTable.lookup(cp);
+		String reqCPName = codePointNameTable.lookup(reqCP);
 		fail("wrong codepoint val = " + Integer.toHexString(cp) + 
 			 "("+cpName+")" +
 			 ", required codepoint = " + Integer.toHexString(reqCP) +

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/XADatabase.java Tue Dec 13 09:41:06
2005
@@ -80,7 +80,7 @@
 		if (conn == null)
 		{
 			xaConnection = xaDataSource.getXAConnection(userId,password);
-			xaResource = xaConnection.getXAResource();
+			setXAResource(xaConnection.getXAResource());
 		}
 		else // this is just a connection reset. Close the logical connection.
 		{

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=356553&r1=356552&r2=356553&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
Tue Dec 13 09:41:06 2005
@@ -16,23 +16,6 @@
 # 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 ---
@@ -46,7 +29,7 @@
 	-------------	-----------
 	SYSLH0002	VALUES(1)
 	SYSLH0001	SELECT count(*) from sys.systables
-Session # :5
+Session # :4
 Database :wombat;create=true
 User :APP
 # Statements:2
@@ -55,14 +38,14 @@
 	-------------	-----------
 	SYSLH0002	VALUES(2)
 	SYSLH0001	SELECT count(*) from sys.systables
-Session # :6
+Session # :5
 Database :wombat;create=true
 User :APP
 # Statements:0
 Prepared Statement Information: 
 	Stmt ID		SQLText
 	-------------	-----------
-Session # :7
+Session # :6
 -----
 # Connection Threads : 4
 # Active Sessions : 4
@@ -70,10 +53,9 @@
 Total Memory : #####	Free Memory : #####
 End test (locale)
 Testing Runtimeinfo after closing connectiosn
-org.apache.derby.drda.NetworkServerControl runtimeinfo 
 ----- Derby Network Server Runtime Information ---
 ----- Session Information ---------------
-Session # :8
+Session # :7
 -----
 # Connection Threads : 4
 # Active Sessions : 1

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=356553&r1=356552&r2=356553&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
Tue Dec 13 09:41:06 2005
@@ -16,23 +16,6 @@
 # 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 ---
@@ -46,7 +29,7 @@
 	-------------	-----------
 	SYSSH2001	SELECT count(*) from sys.systables
 	SYSSH2002	VALUES(1)
-Session # :5
+Session # :4
 Database :wombat;create=true
 User :APP
 # Statements:2
@@ -55,14 +38,14 @@
 	-------------	-----------
 	SYSSH2001	SELECT count(*) from sys.systables
 	SYSSH2002	VALUES(2)
-Session # :6
+Session # :5
 Database :wombat;create=true
 User :APP
 # Statements:0
 Prepared Statement Information: 
 	Stmt ID		SQLText
 	-------------	-----------
-Session # :7
+Session # :6
 -----
 # Connection Threads : 4
 # Active Sessions : 4
@@ -70,10 +53,9 @@
 Total Memory : #####	Free Memory : #####
 End test (locale)
 Testing Runtimeinfo after closing connectiosn
-org.apache.derby.drda.NetworkServerControl runtimeinfo 
 ----- Derby Network Server Runtime Information ---
 ----- Session Information ---------------
-Session # :8
+Session # :7
 -----
 # 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=356553&r1=356552&r2=356553&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
Tue Dec 13 09:41:06 2005
@@ -44,6 +44,19 @@
 derby.drda.startNetworkServer=false
 derby.drda.host=localhost
 derby.drda.traceAll=true
+org.apache.derby.drda.NetworkServerControl trace off -p 1527 
+Trace turned off for all sessions.
+Trace turned off for all sessions.
+----- 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=false
 org.apache.derby.drda.NetworkServerControl shutdown -p 1527 
 Shutdown successful.
 org.apache.derby.drda.NetworkServerControl 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProtocol.out
Tue Dec 13 09:41:06 2005
@@ -137,6 +137,7 @@
 Test that we only send one RDBUPRM per transaction
 PASSED
 Test for missing PKGNAMCSN on OPNQRY
+Also test QRYCLSRLS and MONITOR codepoints which are ignored currently
 PASSED
 Test for missing QRYBLKSZ on OPNQRY
 PASSED
@@ -160,6 +161,8 @@
 PASSED
 Test invalid value for QRYROWSET on OPNQRY
 PASSED
+Test to see OPNQRY returns PRCCNVRM if non-existent RDBNAM specified
+PASSED
 Test too large value for QRYRFRTBL codepoint on CNTQRY
 PASSED
 Test invalid value for QRYRFRTBL codepoint on CNTQRY
@@ -280,4 +283,8 @@
 Test for invalid codepoint in DSCSQLSTT
 PASSED
 Test for non-existant prepared statement in DSCSQLSTT
+PASSED
+Test exception is thrown when specifying non-null indicator for both MBCS and SBCS in SQLSTT
+PASSED
+Test for missing SQLSTT in EXCSQLSET - PKGNAMCT is ignored
 PASSED

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/copyfiles.ant
Tue Dec 13 09:41:06 2005
@@ -20,7 +20,9 @@
 testij_app.properties
 testij_sed.properties
 testProperties_app.properties
+testProperties_derby.properties
 testProtocol_app.properties
+testProtocol_derby.properties
 testSecMec_app.properties
 timeslice_app.properties
 protocol.tests

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests?rev=356553&r1=356552&r2=356553&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/protocol.tests
Tue Dec 13 09:41:06 2005
@@ -1359,6 +1359,7 @@
 endTest
 //
 DISPLAY "Test for missing PKGNAMCSN on OPNQRY"
+DISPLAY "Also test QRYCLSRLS and MONITOR codepoints which are ignored currently"
 include connect.inc
 createDssRequest
 startDdm PRPSQLSTT
@@ -1382,6 +1383,12 @@
 checkSQLCard 0 "     "
 createDssRequest
 startDdm OPNQRY
+startDdm QRYCLSRLS
+writeBytes "0x00" 
+endDdm
+startDdm MONITOR
+writeBytes "00000000" 
+endDdm
 endDdm
 endDss
 flush
@@ -1794,6 +1801,52 @@
 checkerror SYNTAXRM 8 20 QRYROWSET
 endTest
 //
+DISPLAY "Test to see OPNQRY returns PRCCNVRM if non-existent RDBNAM specified"
+include connect.inc
+createDssRequest
+startDdm PRPSQLSTT
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+endDdm
+endDss
+createDssObject 
+startDdm SQLSTT
+writeByte 0	// null indicator
+writeEncodedLDString "values(1)" "UTF-8" 4
+writeByte 255 // null indicator
+endDdm
+endDss
+flush
+checkSQLCard 0 "     "
+createDssRequest
+startDdm OPNQRY
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+startDdm QRYBLKSZ
+writeInt 32767
+endDdm
+startDdm QRYROWSET 
+writeInt 1	
+endDdm
+startDdm RDBNAM 	//this is optional
+writeScalarString RDBNAM "non-existent-db   " 
+endDdm
+endDdm
+endDss
+flush
+checkerror PRCCNVRM 8 18
+endTest
+//
 DISPLAY "Test too large value for QRYRFRTBL codepoint on CNTQRY"
 include values1.inc
 createDssRequest
@@ -2469,6 +2522,7 @@
 flush
 checkError SYNTAXRM 8 20 PKGNAMCSN
 endTest
+//
 // Remove this test for now until JCC issue with JCC sending close twice 
 // resolved
 DISPLAY "Test closing an already closed statement"
@@ -2990,5 +3044,60 @@
 endDss
 flush
 checkError SYNTAXRM	8 20 PKGNAMCSN
+endTest
+//
+DISPLAY "Test exception is thrown when specifying non-null indicator for both MBCS and SBCS
in SQLSTT"
+//This covers DRDAConnThread.agentError method
+include connect.inc
+createDssRequest
+startDdm PRPSQLSTT
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+endDdm
+endDss
+createDssObject 
+startDdm SQLSTT
+writeByte 0	// non-null indicator
+writeEncodedLDString "values(1)" "UTF-8" 4
+writeByte 0 // non-null indicator
+endDdm
+endDss
+flush
+//Network server throws a DRDAProtocolException
+//It does not send back anything
+endTest
+//
+DISPLAY "Test for missing SQLSTT in EXCSQLSET - PKGNAMCT is ignored"
+include connect.inc
+createDssRequest
+startDdm EXCSQLSET
+startDdm PKGNAMCT
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+startDdm PKGNAMCSN
+writePaddedString "test" 18
+writePaddedString "rdbcolid" 18
+writePaddedString "pkgid"  18
+writeBytes "0x0101010101010101"
+writeShort 1
+endDdm
+writeScalarString TYPDEFNAM  QTDSQLASC
+startDdm TYPDEFOVR
+writeScalar2Bytes CCSIDSBC	1208
+writeScalar2Bytes CCSIDMBC	1208
+endDdm
+endDdm
+endDss
+flush
+checkError SYNTAXRM	8 29 TYPDEFNAM
 endTest
 //

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=356553&r1=356552&r2=356553&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
Tue Dec 13 09:41:06 2005
@@ -118,16 +118,6 @@
 			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");
@@ -152,9 +142,13 @@
 			conn2.close();
 			conn3.close();
 			/** once more after closing the connections 
+			 * - by calling NetworkServerControl.getRuntimeInfo 
 			 */
 			System.out.println("Testing Runtimeinfo after closing connectiosn");
-			execCmdDumpResults(RuntimeinfoCmd);	
+			NetworkServerControl derbyServer = 
+				new NetworkServerControl( InetAddress.getByName("localhost"),
+										NetworkServerControl.DEFAULT_PORTNUMBER);
+			System.out.println(derbyServer.getRuntimeInfo());	
 			System.out.println("End test");
 
 			bos.close();

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=356553&r1=356552&r2=356553&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
Tue Dec 13 09:41:06 2005
@@ -94,6 +94,14 @@
 									"-p",
 									"1527"};
     
+    //trace off
+    private static String[] cmdTraceOff =
+		new String[] {  "org.apache.derby.drda.NetworkServerControl",
+						"trace",
+						"off",
+						"-p",
+						"1527"};
+    
     //logconnections on
     private static String[] cmdLogconnectionsOn =
 					new String[] {  "org.apache.derby.drda.NetworkServerControl",
@@ -273,8 +281,12 @@
 			waitForStart("1527",15000);
 			//check that default properties are used
 			listProperties("1527");
+			
+			//Test trace and logconnections commands
 			execCmdDumpResults(cmdTraceOn);
 			execCmdDumpResults(cmdLogconnectionsOn);
+			listProperties("1527");
+			execCmdDumpResults(cmdTraceOff);
 			listProperties("1527");
 			derbyServerCmd("shutdown","1527");
 			

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties?rev=356553&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties
Tue Dec 13 09:41:06 2005
@@ -0,0 +1,19 @@
+#defaults
+derby.infolog.append=true
+derby.locks.waitTimeout=120
+derby.language.logStatementText=true
+
+#added to cover call to memCheck class
+derby.drda.debug=true#defaults
+derby.infolog.append=true
+derby.locks.waitTimeout=120
+derby.language.logStatementText=true
+
+#added to cover call to memCheck class
+derby.drda.debug=true#defaults
+derby.infolog.append=true
+derby.locks.waitTimeout=120
+derby.language.logStatementText=true
+
+#added to cover call to memCheck class
+derby.drda.debug=true
\ No newline at end of file

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties_derby.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol_derby.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol_derby.properties?rev=356553&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol_derby.properties
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol_derby.properties
Tue Dec 13 09:41:06 2005
@@ -0,0 +1,7 @@
+#defaults
+derby.infolog.append=true
+derby.locks.waitTimeout=120
+derby.language.logStatementText=true
+
+#added to cover call to DssTrace methods
+derby.drda.traceAll=true
\ No newline at end of file

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol_derby.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message