db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r521977 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/TestFile.java drda/org/apache/derby/impl/drda/TestProto.java testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java
Date Sat, 24 Mar 2007 04:35:47 GMT
Author: fuzzylogic
Date: Fri Mar 23 21:35:37 2007
New Revision: 521977

URL: http://svn.apache.org/viewvc?view=rev&rev=521977
Log:
DERBY-2418: testProtocol should not use a hardcoded port number

Committed for Julius Stroffek <Julius.Stroffek@sun.com>

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestFile.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestFile.java?view=diff&rev=521977&r1=521976&r2=521977
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestFile.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestFile.java Fri Mar 23 21:35:37
2007
@@ -21,6 +21,7 @@
 
 package org.apache.derby.impl.drda;
 
+import org.apache.derby.drda.NetworkServerControl;
 
 /**
 	This tests protocol errors and protocol not used by JCC
@@ -53,6 +54,6 @@
 	 */
 	public static void executeFile(String filename)
 	{
-		TestProto t = new TestProto(filename);
+		TestProto t = new TestProto(filename, NetworkServerControl.DEFAULT_PORTNUMBER);
 	}
 }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/TestProto.java?view=diff&rev=521977&r1=521976&r2=521977
==============================================================================
--- 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 Fri Mar 23 21:35:37
2007
@@ -129,11 +129,13 @@
 	private boolean failed = false;
 	private StreamTokenizer tkn;
 	private String current_filename;
+    private int port;
 
-	// constructor
-	public TestProto(String filename) 
-	{
+	// constructors
+    public TestProto(String filename, int port) 
+    {
 		current_filename = filename;
+        this.port = port;
 		getConnection();
 
 		try 
@@ -153,8 +155,8 @@
 		{
 			closeConnection();
 		}
+    }
 
-	}
 	/**
 	 * Process include file
 	 *
@@ -179,10 +181,9 @@
 	{
 		String prev_filename = current_filename;
 		current_filename = filename;
-        	String hostName=getHostName();
+       	String hostName=getHostName();
 		BufferedReader fr;
-                try
-		{
+        try {
 			fr = new BufferedReader(new InputStreamReader(new FileInputStream(filename),"UTF-8"));
 		} catch (FileNotFoundException fnfe) {
 			// if useprocess=false & we're running in a suite, 
@@ -215,7 +216,7 @@
 	{
         String hostName=getHostName();
 		try {
-            monitorSocket = new Socket(hostName,1527);
+            monitorSocket = new Socket(hostName, port);
         } catch (UnknownHostException e) {
             System.err.println("Don't know about host: " + hostName);
             System.exit(1);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java?view=diff&rev=521977&r1=521976&r2=521977
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProtocol.java
Fri Mar 23 21:35:37 2007
@@ -54,6 +54,6 @@
 	 */
 	public static void executeFile(String filename)
 	{
-		TestProto t = new TestProto(filename);
+		TestProto t = new TestProto(filename, TestConfiguration.getCurrent().getPort());
 	}
 }



Mime
View raw message