db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r395488 - in /db/derby/code/branches/10.1/java: drda/org/apache/derby/impl/drda/TestProto.java testing/README.htm testing/org/apache/derbyTesting/functionTests/harness/CopySuppFiles.java
Date Thu, 20 Apr 2006 05:18:57 GMT
Author: fuzzylogic
Date: Wed Apr 19 22:18:55 2006
New Revision: 395488

URL: http://svn.apache.org/viewcvs?rev=395488&view=rev
DERBY-658: Update README.htm for testing, fix TestProto and multi tests to run on non-ASCII

Committed for Myrna Van Lunteren <m.v.lunteren@gmail.com>


Modified: db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/TestProto.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/TestProto.java?rev=395488&r1=395487&r2=395488&view=diff
--- db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/TestProto.java (original)
+++ db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/TestProto.java Wed Apr
19 22:18:55 2006
@@ -25,7 +25,9 @@
 import java.io.OutputStream;
 import java.io.DataOutputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.FileReader;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.FileInputStream;
 import java.io.StreamTokenizer;
 import java.net.Socket;
 import java.net.UnknownHostException;
@@ -175,7 +177,7 @@
 		String prev_filename = current_filename;
 		current_filename = filename;
-		FileReader fr = new FileReader(filename);
+		BufferedReader fr = new BufferedReader(new InputStreamReader(new FileInputStream(filename),"UTF-8"));
 		tkn = new StreamTokenizer(fr);
 		int val;
 		while ( (val = tkn.nextToken()) != StreamTokenizer.TT_EOF)

Modified: db/derby/code/branches/10.1/java/testing/README.htm
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/README.htm?rev=395488&r1=395487&r2=395488&view=diff
--- db/derby/code/branches/10.1/java/testing/README.htm (original)
+++ db/derby/code/branches/10.1/java/testing/README.htm Wed Apr 19 22:18:55 2006
@@ -12,8 +12,7 @@
 org.apache.derbyTesting<!--mozToc h1 1 h2 2 h3 3 h4 4 h5 5 h6 6--><br>
-<small>created by myrna@golux.com<br>
-last updated on 04/18/2005 by: m.v.lunteren@gmail.com<br>
@@ -54,7 +53,7 @@
   <li style="margin-left: 40px;"><a href="#frameworks">4.11 Frameworks</a></li>
   <li style="margin-left: 40px;"><a href="#props">4.12 Some test
-harness properties</a> </li>
+harness properties</a></li>
 <h2>1. <a name="intro"></a>Introduction</h2>
@@ -71,7 +70,8 @@
 <p>In the following the top
 directory under which the subversion tree is placed is referred to as
 ${derby.source} - see also the
-derby <a href="http://svn.apache.org/repos/asf/db/derby/branches/10.1/BUILDING.txt">BUILDING.txt</a>.<br>
+derby <a
+ href="http://svn.apache.org/repos/asf/db/derby/branches/10.1/BUILDING.txt">BUILDING.txt</a>.<br>
 <p>The version of the classes and supporting files of the derbyTesting
 package have to match the version of the classes of the derby package.
@@ -269,46 +269,49 @@
 begun, although individual test files and result files will be cleaned
 out and overwritten.&nbsp;
-To run a suite with J2ME/CDC/Foundation:
+<p> To run a suite with J2ME/CDC/Foundation:
  style="text-align: left; width: 546px; height: 32px; margin-left: 40px;"
  border="1" cellpadding="2" cellspacing="2">
-      <td style="vertical-align: top;"><small>(note that the command below
+      <td style="vertical-align: top;"><small>(note that the command
 has carriage returns for formatting reasons):<br>
-		  syntax:<br></small>
-&nbsp; <small>&lt;java&gt;
--Xbootclasspath/a:$jardir/&lt;jdbc_jar&gt; -Dbootcp=$jardir/&lt;jdbc_jar&gt;
+      </small>&nbsp; <small>&lt;java&gt;
+-Dbootcp=$jardir/&lt;jdbc_jar&gt; <br>
 -Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource <br>
--Djvmflags="-Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource" <br>
+      <br>
       <small>where <br>
-        <li><small>&nbsp;&nbsp; &lt;java&gt; is the jvm with
any jvm flags. 
-        For testing with CDC/Foundation Profile using j9 jvm from IBM, 
-        this will be 'j9 -jcl:foun10'. </small></li>
-		<li><small>&nbsp;&nbsp; &lt;jdbc_jar&gt; is the jar file which
-		the JDBC API for CDC/Foundation Profile (JSR169). </small></li>
-        <li><small>&nbsp;&nbsp; &lt;testsuite&gt; is one of the
suites under
+        <li><small>&nbsp;&nbsp; &lt;java&gt; is the jvm with
any jvm
+flags. For testing with CDC/Foundation Profile using j9 jvm from IBM,
+this will be 'j9 -jcl:foun10'. </small></li>
+        <li><small>&nbsp;&nbsp; &lt;jdbc_jar&gt; is the jar file
+implements the JDBC API for CDC/Foundation Profile (JSR169). </small></li>
+        <li><small>&nbsp;&nbsp; &lt;testsuite&gt; is one of the
       <small>for example for running&nbsp; the suite derbyall:<br>
-      </small><small>&nbsp;&nbsp; j9 -jcl:foun10 -Xbootclasspath/a:$jardir/jdbc.jar

-      -Dbootcp=$jardir/jdbc.jar <br>
-	  -Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource <br>
-      -Djvmflags="-Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource" <br>
-      org.apache.derbyTesting.functionTests.harness.RunSuite derbyall</small><br>
+      </small><small>&nbsp;&nbsp; j9 -jcl:foun10
+-Xbootclasspath/a:$jardir/jdbc.jar -Dbootcp=$jardir/jdbc.jar <br>
+-Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource <br>
+      <br>
+org.apache.derbyTesting.functionTests.harness.RunSuite derbyall</small><br>
-The suites provided are:
+<p>The suites provided are:
   <li>derbylang: <br>
@@ -667,6 +670,10 @@
   <li>a .pass or .fail file. This file lists the test if it passes
 under .pass, and under .fail if the output in .out is different from
 the expected output in the master.</li>
+  <li>a .tmpmstr file. This file is a copy of the master file created
+local encoding, and in the case of networkserver, massaged to eliminate
+irrelevant differences. This is the file the .out file is compared with.</li>
 possibly created:<br>
@@ -674,9 +681,6 @@
   <li>additional files used in a specific test may get copied over to
 the test directory. These normally do not get cleaned up.</li>
-  <li>.tmpstr file is created for network server tests and is a
-massaged copy of the master file the output needs to be compared with.</li>
   <li>.err and .out files in network server database files for any
 additional error output.</li>
@@ -874,7 +878,11 @@
 <p>For example, in the file
+To support running on non-ISO-5889 systems, the harness copies files
+ending in sql, .view, .multi, .properties, .txt and .policy into local
+encoding; all other files are copied into UTF-8 encoding.<br>
 <h3><a class="mozTocH3" name="mozTocId427577"></a>4.3 <a name="ov3"></a>&lt;testname&gt;_app.properties</h3>
@@ -981,7 +989,7 @@
 The diff is executed between the final resulting output and the master
-file found.<br>
+file found copied into local encoding as .tmpmstr.<br>
 <h3><a name="Adding_a_new_test"></a>4.7<span style="font-weight: bold;">&nbsp;
@@ -1003,13 +1011,23 @@
 specific directory</li>
   <li>run the test. The first time around, the test will fail because
 no master file will be found. </li>
-  <li>if the output is correct, copy it to the master directory. Note
+  <li>if the output is correct, copy it to the master directory. <br>
+  </li>
+  <li>Build. This will copy the new master into the classes directory,
+and when building jars, into derbyTesting.jar, so it is found by the
+test harness at runtime. Note
 that there is no copyfiles.ant file needed for the master directory,
 all .out files are automatically copied.</li>
   <li>run the test again. Investigate if any differences need to be
 masked out using a test specific sed.properties file (e.g.
 newfunctest_sed.properties). If so, ensure this is added to
+  <li>ensure that the test does not cause any problems on non-ISO-5889
+systems. This includes avoiding use of non portable constructors such
+as String(byte[]) or String(byte[],int,int); and usage of appropriate
+readers (FileInputStream for specifying encoding, FileReader for
+accessing fixed encoding files).<br>
+  </li>
   <li>add the test to a specific suites/*.xml file, maintaining proper
 xml syntax. </li>
   <li>run the suite, and correct any problems found.</li>
@@ -1238,7 +1256,8 @@
 &nbsp;&nbsp;&nbsp; sets additional properties. Several can be set
 using '^' as separator: <br>
-&nbsp;&nbsp;&nbsp; -DtestSpecialProps=&lt;prop-1&gt;=&lt;value-1&gt;^
... ^&lt;prop-n&gt;=&lt;value-n&gt;<br>
+&nbsp;&nbsp;&nbsp; -DtestSpecialProps=&lt;prop-1&gt;=&lt;value-1&gt;^
+... ^&lt;prop-n&gt;=&lt;value-n&gt;<br>
 &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; java
 org.apache.derbyTesting.functionTests.RunTest lang/arithmetic.sql <br>
@@ -1246,8 +1265,7 @@
 &nbsp;&nbsp;&nbsp; sets specific jvm properties for the jvm used in the
 test harness, for
 instance initial memory, and heap size, or properties normally passed
-on with a -D. For instance:
-      <br>
+on with a -D. For instance: <br>
 &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; java
 -Djvmflags=ms32M -mx128M
 org.apache.derbyTesting.functionTests.RunTest lang/streamingColumn.java
@@ -1256,15 +1274,14 @@
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; See above section
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default=true) Controls
whether RunTest
-runs the test in a separate VM or in a  <br> 
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thread in harness
VM. It is potentially
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (default=true) Controls
+whether RunTest
+runs the test in a separate VM or in a <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thread in harness
VM. It is
 useful for debugging tests. Unit tests are <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; not (yet) runnable
-"useprocess=false", though. 
-      </td>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; not (yet) runnable
+"useprocess=false", though. </td>

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/harness/CopySuppFiles.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/harness/CopySuppFiles.java?rev=395488&r1=395487&r2=395488&view=diff
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/harness/CopySuppFiles.java
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/harness/CopySuppFiles.java
Wed Apr 19 22:18:55 2006
@@ -68,7 +68,7 @@
                 // need to make a guess so we copy text files to local encoding
                 // on non-ascii systems...
-                if ((fileName.indexOf("sql") > 0) || (fileName.indexOf("txt") > 0)
|| (fileName.indexOf(".view") > 0))
+                if ((fileName.indexOf("sql") > 0) || (fileName.indexOf("txt") > 0)
|| (fileName.indexOf(".view") > 0) || (fileName.indexOf(".multi") > 0) || (fileName.indexOf(".properties")
> 0))
                     BufferedReader inFile = new BufferedReader(new InputStreamReader(is,
                     PrintWriter pw = new PrintWriter

View raw message