just wanted to try out SQLUnit (4.4) and i have run directly into my first problems. I don't build up the system from the scratch, using the jar in the lib directory. I'm using Ant out of WebSphere Studio / Eclipse.
I got this exception:
WARN [ModalContext] (SQLUnit.java:167) - log4j.properties not found (using defaults)
*** Running SQLUnit file: H:\\Eigene Dateien\\IBM\WBIMBToolkit\\workspace\\SQLUnitTestProj1\\test-oracle1.xml
Getting connection(DEFAULT)
sqlunit-ant: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
Build exception: H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
Build exception: H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
at net.sourceforge.sqlunit.ant.SqlunitTask.execute(SqlunitTask.java:138)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:262)
at java.lang.reflect.Method.invoke(Native Method)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:234)
at org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute(AntFileRunner.java:56)
at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeRunner(DefaultRunnerContext.java:428)
at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run(DefaultRunnerContext.java:479)
at org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run(AntLaunchWizard.java:117)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:98)
Build exception: H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
My Ant-Script and the testfile are looking good, but maybe i have done something wrong?
<target name="help">
<echo message="Test ant file for sqlunit" />
</target>
<!-- Setting up the taskdef for the sqlunit ant task -->
<target name="def" depends="init">
<echo message="*** Def ***" />
<taskdef name="sqlunit" classname="net.sourceforge.sqlunit.ant.SqlunitTask">
<classpath>
<fileset dir="${sqlunit.lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</taskdef>
<echo message=" -- Def finished -- " />
</target>
<!-- This is repeated for each test or
group of tests in case of nested filesets -->
<target name="run-oracle1-test" depends="def,init">
<echo message="*** run-oracle1-test ***" />
<sqlunit testfile="H:\\Eigene Dateien\\IBM\WBIMBToolkit\\workspace\\SQLUnitTestProj1\\test-oracle1.xml" haltOnFailure="true" debug="false" />
<echo message=" -- run-oracle1-test fished -- " />
</target>
</project>
Any my testfile test-oracle1.xml (some parts x'ed):
<?xml version="1.0"?>
<!DOCTYPE sqlunit SYSTEM "file:H:\Eigene Dateien\sqlunit-4.4\docs\sqlunit.dtd">
<test name="Fetching from the View CUST">
<sql>
<stmt>select * from ADAPTERS.CONFIGURATIONS where TABLE_NAME=?</stmt>
<param id="1" type="VARCHAR2" inout="in" is-null="false">cust</param>
</sql>
<result>
<resultset id="1" rowcount="1" />
</result>
</test>
</sqlunit>
I tried to change the connection parameters... then i change the URL (wrong port) i became the following error:
sqlunit-ant: java.lang.Exception: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
java.lang.Exception: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
This is a bit different to my first error, so i think, my connection is ok but something else is going wrong?
Any suggestions?
Thanks!
Che
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for posting your result. I remember someone else having similar problems and this is in Open Discussion somewhere, but its kind of hard to search for :-).
So, just to reiterate, SQLUnit was written with JDK 1.4 and has a few things that make this backward incompatible with JDK 1.3.
-sujit
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Folks,
just wanted to try out SQLUnit (4.4) and i have run directly into my first problems. I don't build up the system from the scratch, using the jar in the lib directory. I'm using Ant out of WebSphere Studio / Eclipse.
I got this exception:
WARN [ModalContext] (SQLUnit.java:167) - log4j.properties not found (using defaults)
*** Running SQLUnit file: H:\\Eigene Dateien\\IBM\WBIMBToolkit\\workspace\\SQLUnitTestProj1\\test-oracle1.xml
Getting connection(DEFAULT)
sqlunit-ant: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
Build exception: H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
Build exception: H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
at net.sourceforge.sqlunit.ant.SqlunitTask.execute(SqlunitTask.java:138)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:104)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:262)
at java.lang.reflect.Method.invoke(Native Method)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:234)
at org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute(AntFileRunner.java:56)
at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeRunner(DefaultRunnerContext.java:428)
at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run(DefaultRunnerContext.java:479)
at org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run(AntLaunchWizard.java:117)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:98)
Build exception: H:\Eigene Dateien\IBM\WBIMBToolkit\workspace\SQLUnitTestProj1\sqlunitTest1.xml:38: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
My Ant-Script and the testfile are looking good, but maybe i have done something wrong?
My Ant-Script:
<project name="sqlunitTest1" default="help" basedir=".">
<!--
<property environment="env"/>
-->
<property name="sqlunit.home.dir" value="H://Eigene Dateien//sqlunit-4.4" />
<property name="sqlunit.lib.dir" value="${sqlunit.home.dir}/lib" />
<target name="init">
<echo message="*** Init ***" />
<echo message=" sqlunit.home.dir = ${sqlunit.home.dir}" />
<echo message=" sqlunit.lib.dir = ${sqlunit.lib.dir}" />
</target>
<target name="help">
<echo message="Test ant file for sqlunit" />
</target>
<!-- Setting up the taskdef for the sqlunit ant task -->
<target name="def" depends="init">
<echo message="*** Def ***" />
<taskdef name="sqlunit" classname="net.sourceforge.sqlunit.ant.SqlunitTask">
<classpath>
<fileset dir="${sqlunit.lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</taskdef>
<echo message=" -- Def finished -- " />
</target>
<!-- This is repeated for each test or
group of tests in case of nested filesets -->
<target name="run-oracle1-test" depends="def,init">
<echo message="*** run-oracle1-test ***" />
<sqlunit testfile="H:\\Eigene Dateien\\IBM\WBIMBToolkit\\workspace\\SQLUnitTestProj1\\test-oracle1.xml" haltOnFailure="true" debug="false" />
<echo message=" -- run-oracle1-test fished -- " />
</target>
</project>
Any my testfile test-oracle1.xml (some parts x'ed):
<?xml version="1.0"?>
<!DOCTYPE sqlunit SYSTEM "file:H:\Eigene Dateien\sqlunit-4.4\docs\sqlunit.dtd">
<sqlunit>
<connection>
<driver>oracle.jdbc.driver.OracleDriver</driver>
<url>jdbc:oracle:thin:@xx.xx.xx.xx:1526:xxx</url>
<user>XXX</user>
<password>XXX</password>
</connection>
<test name="Fetching from the View CUST">
<sql>
<stmt>select * from ADAPTERS.CONFIGURATIONS where TABLE_NAME=?</stmt>
<param id="1" type="VARCHAR2" inout="in" is-null="false">cust</param>
</sql>
<result>
<resultset id="1" rowcount="1" />
</result>
</test>
</sqlunit>
I tried to change the connection parameters... then i change the URL (wrong port) i became the following error:
sqlunit-ant: java.lang.Exception: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
java.lang.Exception: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
This is a bit different to my first error, so i think, my connection is ok but something else is going wrong?
Any suggestions?
Thanks!
Che
Hi Folks,
me again :-)
Just my answer to my problem:
my WebSphere Studio used a 1.3 JDK. Switching to 1.4 helped. replaceAll(...) is only since 1.4.
Bye
Che
Hi Che,
Thanks for posting your result. I remember someone else having similar problems and this is in Open Discussion somewhere, but its kind of hard to search for :-).
So, just to reiterate, SQLUnit was written with JDK 1.4 and has a few things that make this backward incompatible with JDK 1.3.
-sujit