Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates > by-pkgid > 58de6be3705c875194e822c24ebf1a0a > files > 14

hsqldb-manual-1.8.1.3-4.1.mga1.noarch.rpm

<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Appendix&nbsp;E.&nbsp;Hsqldb Test Utility</title><link href="guide.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.65.1" name="generator"><meta name="keywords" content="Hsqldb, Test, Utility"><meta name="keywords" content="Hsqldb, Hypersonic, Database, JDBC, Java"><link rel="home" href="index.html" title="Hsqldb User Guide"><link rel="up" href="index.html" title="Hsqldb User Guide"><link rel="previous" href="apd.html" title="Appendix&nbsp;D.&nbsp;Running Hsqldb with OpenOffice.org 1.1.x"><link rel="next" href="apf.html" title="Appendix&nbsp;F.&nbsp;Database Manager"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">Appendix&nbsp;E.&nbsp;Hsqldb Test Utility</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="apd.html"><img src="navicons/prev.gif" alt="Prev"></a>&nbsp;</td><th align="center" width="60%">&nbsp;</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="apf.html"><img src="navicons/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="N12BDE"></a>Appendix&nbsp;E.&nbsp;Hsqldb Test Utility</h2></div><div><p class="pubdate">$Date: 2004/12/24 23:40:59 $</p></div></div><div></div></div><p>The <tt class="literal">org.hsqldb.test</tt> package contains a number of
  tests for various functions of the database engine. Among these, the
  <tt class="classname">TestSelf</tt> class performs the tests that are based on
  scripts. To run the tests, you should compile the
  <tt class="filename">hsqldbtest.jar</tt> target with Ant.</p><p>For <tt class="classname">TestSelf</tt>, a batch file is provided in the
  testrun/hsqldb directory, together with a set of TestSelf*.txt files. To
  start the application in Windows, change to the directory and type:</p><pre class="screen">
    runtest TestSelf</pre><p>In Unix / Linux, type:</p><pre class="screen">
    ./runTest.sh TestSelf</pre><p>The new version of <tt class="classname">TestSelf</tt> runs multiple SQL
  test files to test different SQL operations of the database. All files in
  the working directory with names matching TestSelf*.txt are processed in
  alphabetical order.</p><p>You can add your own scripts to test different series of SQL queries.
  The format of the TestSelf*.txt file is simple text, with some indentation
  and prefixes in the form of Java-style comments. The prefixes indicate what
  the expected result should be.</p><div class="itemizedlist"><ul type="disc"><li><p>Comment lines must start with -- and are ignored</p></li><li><p>Lines starting with spaces are the continuation of the previous
      line</p></li><li><p>SQL statements with no prefix are simply executed.</p></li><li><p>
        <span class="emphasis"><em>The remaining items in this list exemplify use of the
        available command line-prefixes.</em></span>
      </p></li><li><div class="informalexample"><p>The /*s*/ option stands for silent. It is used for executing
        quries regardless of results. Used for preparation of tests, not for
        actual tests.</p><pre class="programlisting">
/*s*/ Any SQL statement - errors are ignored</pre></div></li><li><div class="informalexample"><p>The /*c&lt;rows&gt;*/ option is for SELECT queries and
        asserts the number of rows in the result matches the given
        count.</p><pre class="programlisting">
/*c&lt;rows&gt;*/ SQL statement returning count of &lt;rows&gt;</pre></div></li><li><div class="informalexample"><p>The /*u*/ option is for queries that return an update count,
        such as DELETE and UPDATE. It asserts the update count
        matches.</p><pre class="programlisting">
/*u&lt;count&gt;*/ SQL statement returning an update count equal to &lt;count&gt;</pre></div></li><li><div class="informalexample"><p>The /*e*/ option asserts that the given query results in an
        erros. It is mainly used for testing the error detection capabilities
        of the engine. It can also be used with syntactically valid queries to
        assert a certain state in the database. For example a CREATE TABLE can
        be used to assert the table of the same name already exists.</p><pre class="programlisting">
/*e*/ SQL statement that should produce an error when executing</pre></div></li><li><div class="informalexample"><p>The /*r....*/ option asserts the SELECT query returns a
        single row containing the given set of field values.</p><pre class="programlisting">
/*r&lt;string1&gt;,&lt;string2&gt;*/ SQL statement returning a single row ResultSet equal to the specified value</pre></div></li><li><div class="informalexample"><p>The extended /*r...*/ option asserts the SELECT query returns
        the given rows containing the given set of field values.</p><pre class="programlisting">
/*r
    &lt;string1&gt;,&lt;string2&gt;
    &lt;string1&gt;,&lt;string2&gt;
    &lt;string1&gt;,&lt;string2&gt;
*/ SQL statement returning a multiple row ResultSet equal to the specified values</pre></div><p>(note that the result set lines are indented).</p></li><li><p>All the options are lowercase letters. During development, an
      uppercase can be used for a given test to exclude a test from the test
      run. The utility will just report the test blocks that have been
      excluded without running them. Once the code has been developed, the
      option can be turned into lowercase to perform the actual test. </p></li></ul></div><p>See the TestSelf*.txt files in the /testrun/hsqldb/ directory for
  actual examples.</p></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="apd.html"><img src="navicons/prev.gif" alt="Prev"></a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="index.html"><img src="navicons/up.gif" alt="Up"></a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="apf.html"><img src="navicons/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Appendix&nbsp;D.&nbsp;Running Hsqldb with OpenOffice.org 1.1.x&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html"><img src="navicons/home.gif" alt="Home"></a></td><td valign="top" align="right" width="40%">&nbsp;Appendix&nbsp;F.&nbsp;Database Manager</td></tr></table></div></body></html>