db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren" <m.v.lunte...@gmail.com>
Subject Re: svn commit: r379723 - in /db/derby/code/trunk/java/testing: ./ org/apache/derbyTesting/functionTests/harness/ org/apache/derbyTesting/functionTests/suites/
Date Wed, 22 Feb 2006 14:22:20 GMT
Hi,
Is it possible / Would it make sense to change the description of this
commit? The original patch was contributed by deepa...

Myrna


On 2/21/06, fuzzylogic@apache.org <fuzzylogic@apache.org> wrote:
>
> Author: fuzzylogic
> Date: Tue Feb 21 23:50:51 2006
> New Revision: 379723
>
> URL: http://svn.apache.org/viewcvs?rev=379723&view=rev
> Log:
> DERBY-683: Commit _tstpatch3_ by Myrna. Adds derbyTesting.encodingproperty to
> harness. Excludes encodingTests from all JDKs except Sun JDK 1.5. Further
> investigation is required to understand why this is necessary. The changes
> introduced in this patch (specifically, setting -Dfile.encoding on the
> command-
> line of the spawned JVM) should not cause NoClassDefFoundErrors on JDK
> 1.4.2,
> but they do.
>
> Committed for Myrna Van Lunteren <m.v.lunteren@gmail.com>
>
> Added:
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.properties
> (with props)
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.runall
> Modified:
>    db/derby/code/trunk/java/testing/README.htm
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/HandleResult.java
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/ProcessStreamResult.java
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
>
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
>
> Modified: db/derby/code/trunk/java/testing/README.htm
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/README.htm?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> --- db/derby/code/trunk/java/testing/README.htm (original)
> +++ db/derby/code/trunk/java/testing/README.htm Tue Feb 21 23:50:51 2006
> @@ -688,7 +688,11 @@
>         <p style="margin-bottom: 0in;">As tests are added to this
> quite, it could require more and more time to run (several minutes to
> several hours to several days), which is why it is NOT included as part
> -of the derbyall suite. Currently the largedata/LobLimits.java test takes
> about 17Gb of disk space. On a linux machine with 2.8Ghz Intel Xeon CPU,
> 4Gb RAM , Linux machine and IBM 1.4.2 JVM with default memory heap size,
> the test ran for about 4.5 hrs. If the test is successful, it will cleanup
> the database and other files.</p>
> +of the derbyall suite. Currently the largedata/LobLimits.java test
> +takes about 17Gb of disk space. On a linux machine with 2.8Ghz Intel
> +Xeon CPU, 4Gb RAM , Linux machine and IBM 1.4.2 JVM with default memory
> +heap size, the test ran for about 4.5 hrs. If the test is successful,
> +it will cleanup the database and other files.</p>
>       </li>
>     </ul>
>   </li>
> @@ -1058,6 +1062,10 @@
> functionality than the (rest of the) functionTests, which are more
> geared toward how end-users might use functionality.</p>
>   </li>
> +  <li>.junit&nbsp;&nbsp;&nbsp;&nbsp; junit tests. These require
> +junit.jar to run and are actually run with junit.textui.TestRunner. The
> +actual tests are .java files. <br>
> +  </li>
> </ul>
> <p><br>
> <br>
> @@ -1510,6 +1518,13 @@
> SecurityManager. See section 4.13<br>
> hostName - allows for running Network Server on a remote host. See
> section <a href="#hostName">4.14</a>.<br>
> +derbyTesting.encoding - allows for running the harness with a different
> +encoding. Only supported with jdk15. Example: <br>
> +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<small> java
> +-DderbyTesting.encoding=UTF-16
> +org.apache.derbyTesting.functionTests.harness.RunTest
> +jdbcapi/resultset.java</small><br>
> +      <br>
>       </td>
>     </tr>
>   </tbody>
> @@ -1590,7 +1605,9 @@
> derbyTesting.jar or from the svn source to a location on
> the host on which you want to run the NetworkServer</li>
>   <li>Set up the classpath for Network Server to include derbynet.jar
> -and derbyTesting.jar (or equivalent classes).<br>
> +and derbyTesting.jar (or equivalent classes). You need to have
> +derby.jar available also, although it does not need to be in the
> +classpath.<br>
>   </li>
>   <li>Start Network Server like so when using compiled classes for
> it:</li>
> </ol>
>
> Modified:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/HandleResult.java
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/HandleResult.java?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/HandleResult.java
> (original)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/HandleResult.java
> Tue Feb 21 23:50:51 2006
> @@ -39,8 +39,15 @@
>        {
>        }
>
> +       public static String handleResult(int exitCode, InputStream
> stdout,
> +               InputStream stderr, PrintWriter printWriter)
> +               throws IOException
> +       {
> +               return handleResult(exitCode, stdout, stderr, printWriter,
> null);
> +       }
> +
>     public static String handleResult(int exitCode, InputStream stdout,
> -        InputStream stderr, PrintWriter printWriter)
> +        InputStream stderr, PrintWriter printWriter, String encoding)
>         throws IOException
>     {
>                StringBuffer sb = new StringBuffer();
> @@ -52,7 +59,11 @@
>         if (stdout != null)
>         {
>                // reader for stdout
> -               BufferedReader outReader = new BufferedReader(new
> InputStreamReader(stdout));
> +               BufferedReader outReader;
> +               if(encoding != null)
> +                       outReader = new BufferedReader(new
> InputStreamReader(stdout, encoding));
> +               else
> +                       outReader = new BufferedReader(new
> InputStreamReader(stdout));
>
>             // Read each line and write to printWriter
>                String s = null;
> @@ -74,7 +85,11 @@
>         if (stderr != null)
>         {
>             // reader for stderr
> -               BufferedReader errReader = new BufferedReader(new
> InputStreamReader(stderr));
> +               BufferedReader errReader;
> +               if(encoding != null)
> +                       errReader = new BufferedReader(new
> InputStreamReader(stderr, encoding));
> +               else
> +                       errReader = new BufferedReader(new
> InputStreamReader(stderr));
>
>                String s = null;
>                int lines = 0;
>
> Modified:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/ProcessStreamResult.java
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/ProcessStreamResult.java?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/ProcessStreamResult.java
> (original)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/ProcessStreamResult.java
> Tue Feb 21 23:50:51 2006
> @@ -27,8 +27,10 @@
> public class ProcessStreamResult implements Runnable
> {
>
> -       protected InputStream in;
> -       protected BufferedOutputStream bos;
> +       protected InputStream in;
> +       protected OutputStreamWriter outStream;
> +       // Encoding to be used to read output of test jvm process
> +       protected String encoding;
>        protected boolean finished;
>        protected IOException ioe;
>        protected Thread myThread;
> @@ -37,10 +39,17 @@
>        protected int timeout;
>
>        public ProcessStreamResult(InputStream in, BufferedOutputStream
> bos,
> -           String timemin) throws IOException, InterruptedException
> +                   String timemin) throws IOException,
> InterruptedException
> +       {
> +               this(in, bos, timemin, null);
> +       }
> +
> +       public ProcessStreamResult(InputStream in, BufferedOutputStream
> bos,
> +         String timemin, String encoding) throws IOException,
> InterruptedException
>        {
>                this.in = in;
> -        this.bos = bos;
> +               this.outStream = new OutputStreamWriter(bos);
> +               this.encoding = encoding;
>         this.startTime = System.currentTimeMillis();
>         if (timemin != null)
>         {
> @@ -65,10 +74,19 @@
>
>                try
>                {
> -                       byte[] ba = new byte[1024];
> +                       char[] ca = new char[1024];
>                        int valid;
>                        interrupted = false;
> -                       while ((valid = in.read(ba, 0, ba.length)) != -1)
> +
> +                       // Create an InputStreamReader with encoding, if
> specified.
> +                       // Otherwise, use default.
> +                       InputStreamReader inStream;
> +                       if(encoding != null)
> +                       inStream = new InputStreamReader(in, encoding);
> +               else
> +                       inStream = new InputStreamReader(in);
> +
> +                       while ((valid = inStream.read(ca, 0, ca.length))
> != -1)
>                        {
>                            //System.out.println("Still reading thread: " +
> tname);
> /*                             if (timeout > 0) {
> @@ -90,8 +108,8 @@
>                                                }
>                                        }
>                            }
> -*/                     bos.write(ba, 0, valid);
> -                       bos.flush();
> +*/                     outStream.write(ca, 0, valid);
> +                       outStream.flush();
>                        }
>                }
>                catch (IOException ioe)
>
> Modified:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
> (original)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
> Tue Feb 21 23:50:51 2006
> @@ -118,7 +118,8 @@
>        static Properties specialProperties; // for testSpecialProps
>        static BufferedReader runlistFile;
>        static String hostName;
> -
> +       static String testEncoding;     // Encoding used for child jvm and
> to read the test output
> +
>     static String [] clientExclusionKeywords = new String [] {
>         "at-or-before:", "at-or-after:", "when-at-or-before:jdk",
>         "when-at-or-after:jdk", "when:jdk"
> @@ -414,6 +415,9 @@
>             jvmProps.addElement("serverJvm=" + serverJvm);
>         if ( (serverJvmName != null) && (serverJvmName.length()>0) )
>             jvmProps.addElement("serverJvmName=" + serverJvmName);
> +        if (testEncoding != null)
> +            jvmProps.addElement("derbyTesting.encoding=" + testEncoding);
> +
>         if ( (hostName != null) && (hostName.length()>0) )
>                jvmProps.addElement("hostName=" + hostName);
>         if ( useprocess == false )
> @@ -516,7 +520,7 @@
>                     pr.waitFor();
>
>                     String result = HandleResult.handleResult(pr.exitValue
> (),
> -                        stdout.getData(), stderr.getData(), pwOut);
> +                        stdout.getData(), stderr.getData(), pwOut,
> testEncoding);
>                     pr.destroy();
>                 }
>                 catch(Throwable t)
> @@ -611,6 +615,7 @@
>         {
>             // Reset framework to the parent suite's framework, if any
>             // because framework may have been set by previous suite
> +            testEncoding = parentProps.getProperty("derbyTesting.encoding
> ");
>             framework = parentProps.getProperty("framework");
>             serverJvm = parentProps.getProperty("serverJvm");
>             serverJvmName = parentProps.getProperty("serverJvmName");
> @@ -739,6 +744,7 @@
>                serverJvm = suiteProperties.getProperty("serverJvm");
>                serverJvmName = suiteProperties.getProperty
> ("serverJvmName");
>                hostName = suiteProperties.getProperty("hostName");
> +               testEncoding = suiteProperties.getProperty("
> derbyTesting.encoding");
>                canondir = suiteProperties.getProperty("canondir");
>                mtestdir = suiteProperties.getProperty("mtestdir");
>                String usepr = suiteProperties.getProperty("useprocess");
> @@ -822,6 +828,14 @@
>             p.put("serverJvmName", serverJvmName);
>                else
>             serverJvmName = p.getProperty("serverJvmName");
> +
> +        // derbyTesting.encoding may be set at the top, or just
> +        // set for individual suites
> +        if(parentProperties.getProperty("derbyTesting.encoding") != null)
> +                   p.put("derbyTesting.encoding", testEncoding);
> +               else
> +            testEncoding = p.getProperty("derbyTesting.encoding");
> +
>         if ( hostName != null )
>             p.put("hostName", hostName);
>         else
>
> Modified:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
> (original)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
> Tue Feb 21 23:50:51 2006
> @@ -72,6 +72,7 @@
>        static String bootcp; //  path for j9 bootclasspath setting
>        static String serverJvm; //  path for j9 bootclasspath setting
>        static String hostName; // needs to be settable for IPV6 testing;
> localhost otherwise.
> +       static String testEncoding; // setting the encoding.
>        static String ijdefaultResourcePackage; // for ij tests only
>        static String debug; // for setting verbose mode to pass down to
> RunTest
>     static String timeout; // to allow killing a hanging test
> @@ -351,6 +352,7 @@
>             reportstderr = p.getProperty("reportstderr");
>             timeout = p.getProperty("timeout");
>             shutdownurl = p.getProperty("shutdownurl");
> +            testEncoding = p.getProperty("derbyTesting.encoding");
>         }
>         suites = p.getProperty("suites");
>                return p;
> @@ -475,6 +477,9 @@
>                String serverJvm = sp.getProperty("serverJvm");
>                if (serverJvm != null)
>                    suiteProperties.put("serverJvm", serverJvm);
> +               String cmlTestEncoding = sp.getProperty("
> derbyTesting.encoding");
> +               if (cmlTestEncoding != null)
> +                   suiteProperties.put("derbyTesting.encoding",
> cmlTestEncoding);
>                String testout = sp.getProperty("testoutname");
>                if (testout != null)
>                    suiteProperties.put("testoutname", testout); //
> toursDemo
>
> Modified:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
> (original)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
> Tue Feb 21 23:50:51 2006
> @@ -122,6 +122,7 @@
>        static String runwithjvm="true";
>        static boolean startServer=true; // should test harness start the
> server
>        static String hostName; // needs to be settable for ipv testing,
> localhost otherwise.)
> +       static String testEncoding; // Encoding used for child jvm and to
> read the test output
>
>        // Other test variables for directories, files, output
>        static String scriptName = ""; // testname as passed in
> @@ -930,6 +931,13 @@
>             }
>         }
>
> +        testEncoding = sp.getProperty("derbyTesting.encoding");
> +        if ((testEncoding != null) && (!jvmName.equals("jdk15")))
> +        {
> +            skiptest = true;
> +            addSkiptestReason("derbyTesting.encoding can only be used
> with jdk15, skipping test");
> +        }
> +
>         javaCmd = sp.getProperty("javaCmd");
>         bootcp = sp.getProperty("bootcp");
>         jvmflags = sp.getProperty("jvmflags");
> @@ -1528,6 +1536,18 @@
>                            jvmflags = "";
>                    }
>                }
> +               //Check derbyTesting.encoding property
> +               if(testEncoding == null) {
> +                   testEncoding = ap.getProperty("derbyTesting.encoding
> ");
> +                   // only bother if we have jdk15, otherwise we'll be
> skipping
> +                   if ((jvmName.equals("jdk15")) && (testEncoding !=
> null))
> +                   {
> +                           jvmflags = (jvmflags==null?"":jvmflags+" ")
> +                                       + "-Dfile.encoding=" +
> testEncoding;
> +                           ap.put("file.encoding",testEncoding);
> +                   }
> +               }
> +
>                if (NetServer.isJCCConnection(framework)
>                                || "true".equalsIgnoreCase(ap.getProperty
> ("noSecurityManager")))
>                        runWithoutSecurityManager = true;
> @@ -2067,6 +2087,15 @@
>             if ((hostName != null) && (!hostName.equals("localhost")))
>                        jvmProps.addElement("hostName=" + hostName);
>         }
> +
> +        // if we're not jdk15, don't, we'll skip
> +        if ((testEncoding != null) && (jvmName.equals("jdk15")))
> +        {
> +            jvmProps.addElement("derbyTesting.encoding=" + testEncoding);
> +            jvmProps.addElement("file.encoding=" + testEncoding);
> +            jvmflags = (jvmflags==null?"":jvmflags+" ")
> +                         + "-Dfile.encoding=" + testEncoding;
> +        }
>
>         if ( (jvmflags != null) && (jvmflags.length()>0) )
>         {
> @@ -2195,17 +2224,20 @@
>                 fos = new FileOutputStream(tmpOutFile);
>                 bos = new BufferedOutputStream(fos, 1024);
>                 prout =
> -                    new ProcessStreamResult(pr.getInputStream(), bos,
> timeoutStr);
> +                    new ProcessStreamResult(pr.getInputStream(), bos,
> +                                                       timeoutStr,
> testEncoding);
>             }
>             else
>             {
>                 fos = new FileOutputStream(stdOutFile);
>                 bos = new BufferedOutputStream(fos, 1024);
>                 prout =
> -                    new ProcessStreamResult(pr.getInputStream(), bos,
> timeoutStr);
> +                    new ProcessStreamResult(pr.getInputStream(), bos,
> +                                                       timeoutStr,
> testEncoding);
>             }
>             prerr =
> -                new ProcessStreamResult(pr.getErrorStream(), bos,
> timeoutStr);
> +                new ProcessStreamResult(pr.getErrorStream(), bos,
> +
> timeoutStr, testEncoding);
>
>             if (framework != null && ! framework.equals(""))
>                 if (verbose) System.out.println("The test should be
> running...");
>
> Modified:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties?rev=379723&r1=379722&r2=379723&view=diff
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
> (original)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetclientmats.properties
> Tue Feb 21 23:50:51 2006
> @@ -1,5 +1,5 @@
> framework=DerbyNetClient
> -suites= derbynetclientmats derbynetmats
> +suites= encodingTests derbynetclientmats derbynetmats
> jdk12test=true
> runwithj9=false
> #Exclude for J2ME/Foundation - Network Server not supported
>
> Added:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.properties
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.properties?rev=379723&view=auto
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.properties
> (added)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.properties
> Tue Feb 21 23:50:51 2006
> @@ -0,0 +1,28 @@
> +framework=DerbyNetClient
> +timeout=60
> +
> +# Encoding test with UTF-16 can currently be run only on Sun JDK 15 (Feb
> 1, 2006)
> +derbyTesting.encoding=UTF-16
> +
> +runwithibm13=false
> +runwithibm14=false
> +runwithibm15=false
> +runwithj9=false
> +runwithfoundation=false
> +runwithjdk12=false
> +runwithjdk13=false
> +runwithjdk14=false
> +framework=DerbyNetClient
> +timeout=60
> +
> +# Encoding test with UTF-16 can currently be run only on Sun JDK 15 (Feb
> 1, 2006)
> +derbyTesting.encoding=UTF-16
> +
> +runwithibm13=false
> +runwithibm14=false
> +runwithibm15=false
> +runwithj9=false
> +runwithfoundation=false
> +runwithjdk12=false
> +runwithjdk13=false
> +runwithjdk14=false
>
> Propchange:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.properties
>
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Added:
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.runall
> URL:
> http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.runall?rev=379723&view=auto
>
> ==============================================================================
> ---
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.runall
> (added)
> +++
> db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/encodingTests.runall
> Tue Feb 21 23:50:51 2006
> @@ -0,0 +1,2 @@
> +jdbcapi/lobStreams.java
> +jdbcapi/lobStreams.java
> \ No newline at end of file
>
>
>

Mime
View raw message