Hi,

I'm trying to set up sqlunit tests with ant & webtest on stored procedure. So I first build up a very simple mockup in order to tune tests execution & report creation with a main folder containing all the stuff needed to perform tests (with less dependencies as possible)
But I get an error that I do not understand the root cause...

Error message:
<failure message="net.sourceforge.sqlunit.SQLUnitException: Unresolved compilation problem: &#xa;&#x9;The constructor XMLOutputter(Format) is undefined&#xa;"/>

Can you please help me ??
Best regards
Olivier

To launch tests execution, in a console:
setup.bat
ant run

OS: windows XP SP2
Java: jdk 1.6.0_14
oracle 10g free edition (but I plan to use MySql too)

Folders structure:
c:\MyTest
    L"apache-ant-1.7.1" (folder)
    L"junit4.7" (folder)
    L"properties" (folder)
         L"connection.properties" (files)
         L"ojdbc14.jar" (files)
         L"WebTestReport.xsl" (files)
    L"results" (folder)
    L"sqlunit-5.0" (folder)
    L"tests" (folder)
         L"test01.xml" (files)
    L"build.xml"
    L"setup.bat"

Content of "connection.properties" file:
#
# properties/connection.properties
#
sqlunit.driver = oracle.jdbc.driver.OracleDriver
sqlunit.url = jdbc:oracle:thin:@localhost:1521:XE
sqlunit.user = test
sqlunit.password = test

Content of "setup.bat" file:
SET TEST_HOME=C:\mytest
SET ANT_HOME=%TEST_HOME%\apache-ant-1.7.1
SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_14
SET CLASSPATH=%TEST_HOME%\properties\ojdbc14.jar;%TEST_HOME% \sqlunit-5.0\lib\log4j-1.2.13.jar;%TEST_HOME%\sqlunit-5.0\lib \junit.jar;%TEST_HOME%\sqlunit-5.0\lib\jdom.jar;%CLASSPATH%
PATH=%TEST_HOME%\properties;%ANT_HOME%\bin;%PATH%;

Content of "build.xml" file:
<?xml version="1.0"?>
<project name="slqlunit" basedir=".">
 <description>SQLUnit tests tasks</description>
 <!-- Sets variables which can later be used. -->
 <!-- The value of a property is accessed via ${} -->
 <property name="sql.debug" value="true" />
 <!-- This is specified once per buildfile -->
 <target name="def">
   <taskdef  name="sqlunit"
             classname="net.sourceforge.sqlunit.ant.SqlunitTask" >
     <classpath>
<pathelement location="${basedir}\sqlunit-5.0\lib \sqlunit-5.0.jar" />
     </classpath>
   </taskdef>
 </target>
<!-- This is repeated for each test or group of tests in case of nested filesets -->
 <target name="run" depends="def">
   <sqlunit  testfile="${basedir}\tests\test02.xml"
             haltOnFailure="false"
             debug="${sql.debug}"
             logfile="${basedir}\results\result_test01.xml"
             logformat="canoo"/>
 </target>
 <!-- reporting -->
 <target name="htmlreport">
    <delete file="${basedir}\results\result_test01.html" />
    <xslt in="${basedir}\results\result_test01.xml"
          out="${basedir}\results\result_test01.html"
          style="${basedir}\properties\WebTestReport.xsl" />
 </target>
</project>

Content of "test01.xml" file:
<?xml version="1.0"?>
<!DOCTYPE sqlunit SYSTEM "file:docs/sqlunit.dtd">
<sqlunit>
<connection connection-id="1" extern="C:\mytest\properties \connection.properties" />
 <!-- basic tests of SQLUnit functionality -->
 <test name="Testing DataBase access">
   <sql connection-id="1">
     <stmt>SELECT 1 as col1 FROM DUAL</stmt>
   </sql>
   <result>
     <resultset id="1">
       <row id="1">
         <col id="1" name="col1" type="INTEGER">1</col>
       </row>
     </resultset>
   </result>
 </test>
</sqlunit>

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to