[Webtest] [testSpec] ERROR (Step.java:333) - Cannot handle unexpected exception in step InvokePage at with (stepId="get local file"
CF Wong
webtest@lists.canoo.com
Mon, 17 May 2004 10:33:14 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0050_01C43BFA.5C0FD220
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Lezoul, I don't know why I have so much problem with the installTest.xml. I
am having different message after moving the <taskdef> prior to the
<target>.
However, I did made some progress in using the "http" protocol in lieu of
"file". May be the installTest.xml should include both protocols as most
users would be using http.
I am enclosing both the installTest.xml and error message for your
information. I would still want to find out why it does not work. As a
matter of fact, there are 2 more computers at work that could not run the
webtest properly.
Best Regards,
CF
---------- installTest.xml ------------------
<project name="InstallationCheck" basedir="." default="all">
<property name="base.dir" value="${basedir}"/>
<property name="webtest.home" value="${base.dir}/../.."/>
<taskdef file="${webtest.home}/webtestTaskdefs.properties">
<classpath>
<fileset dir="${webtest.home}" includes="**/lib/*.jar"/>
</classpath>
</taskdef>
<target name="all" depends="mayPrintANTError, checkWebTest" />
<target name="checkWebTest">
<echo message="base dir is ${base.dir}"/>
<echo message="home dir is ${webtest.home}"/>
<testSpec name="check calling and parsing a local file">
<config
host=""
port=""
basepath=""
summary="false"
verbose="true"
saveresponse="true"
haltonfailure="true"
protocol="file" />
<steps>
<invoke
stepid="get local file"
url="${base.dir}\testfile.html" />
<verifytitle
stepid="check the title is parsed correctly"
text="Test File Title" />
</steps>
</testSpec>
</target>
<target name="checkANT">
<available classname="org.apache.tools.ant.ProjectComponent"
property="ant.version.ok"/>
</target>
<target name="mayPrintANTError" unless="ant.version.ok" depends="checkANT">
<echo message="You have a non-compliant version of ANT"/>
<echo message="Consider moving WEBTESTHOME/lib/ant.jar"/>
<echo message="to ANT_HOME/lib."/>
</target>
</project>
------------- error message ----------------
D:\WebTest\doc\samples>ant -v -buildfile installTest.xml
Apache Ant version 1.5.4 compiled on August 12 2003
Buildfile: installTest.xml
Detected Java version: 1.4 in: D:\Sun\AppServer\jdk\jre
Detected OS: Windows XP
parsing buildfile installTest.xml with URI =
file:D:/WebTest/doc/samples/install
Test.xml
Project base dir set to: D:\WebTest\doc\samples
[taskdef] Loading definitions from file
D:\WebTest\webtestTaskdefs.properties
Build sequence for target `all' is [checkANT, mayPrintANTError,
checkWebTest, al
l]
Complete build sequence is [checkANT, mayPrintANTError, checkWebTest, all]
checkANT:
mayPrintANTError:
Skipped because property 'ant.version.ok' set.
checkWebTest:
[echo] base dir is D:\WebTest\doc\samples
[echo] home dir is D:\WebTest\doc\samples/../..
BUILD FAILED
file:D:/WebTest/doc/samples/installTest.xml:18:
java.lang.NumberFormatException:
For input string: ""
at
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe
lper.java:435)
at
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:306)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:242)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:211)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:259)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:260)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:211)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:259)
at org.apache.tools.ant.Task.perform(Task.java:340)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.lang.NumberFormatException: For input string: ""
at
java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:489)
at java.lang.Integer.<init>(Integer.java:609)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at
org.apache.tools.ant.IntrospectionHelper$12.set(IntrospectionHelper.j
ava:804)
at
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe
lper.java:426)
... 15 more
--- Nested Exception ---
java.lang.NumberFormatException: For input string: ""
at
java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Integer.parseInt(Integer.java:489)
at java.lang.Integer.<init>(Integer.java:609)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at
org.apache.tools.ant.IntrospectionHelper$12.set(IntrospectionHelper.j
ava:804)
at
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe
lper.java:426)
at
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:306)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:242)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:211)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:259)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:260)
at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:211)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:259)
at org.apache.tools.ant.Task.perform(Task.java:340)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Total time: 1 second
------=_NextPart_000_0050_01C43BFA.5C0FD220
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><!--StartFragment --><FONT face=3DArial>Lezoul<SPAN=20
class=3D937072114-17052004>, I don't know why I have so much problem =
with the=20
installTest.xml. I am having different message after moving the =
<taskdef>=20
prior to the <target>. </SPAN></FONT></DIV>
<DIV><FONT face=3DArial><SPAN =
class=3D937072114-17052004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial><SPAN class=3D937072114-17052004>However, I did =
made some=20
progress in using the "http" protocol in lieu of "file". May be the=20
installTest.xml should include both protocols as most users would be =
using=20
http.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial><SPAN =
class=3D937072114-17052004></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial><SPAN class=3D937072114-17052004>I am enclosing =
both the=20
installTest.xml and error message for your information. I would still =
want to=20
find out why it does not work. As a matter of fact, there are 2 =
more=20
computers at work that could not run the webtest properly. =
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial><SPAN =
class=3D937072114-17052004></SPAN></FONT> </DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>CF</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2>---------- =20
installTest.xml ------------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2><project=20
name=3D"InstallationCheck" basedir=3D"." =
default=3D"all"><BR> <property=20
name=3D"base.dir" value=3D"${basedir}"/><BR> <property=20
name=3D"webtest.home" =
value=3D"${base.dir}/../.."/><BR> </FONT></SPAN></DIV>
<DIV><SPAN class=3D937072114-17052004></SPAN><SPAN =
class=3D937072114-17052004><FONT=20
face=3DArial size=3D2> <taskdef=20
file=3D"${webtest.home}/webtestTaskdefs.properties"><BR> &l=
t;classpath><BR> <fileset=20
dir=3D"${webtest.home}"=20
includes=3D"**/lib/*.jar"/><BR> </classpath><BR> =
;</taskdef></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2> <target=20
name=3D"all" depends=3D"mayPrintANTError, checkWebTest" =
/></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2> <target=20
name=3D"checkWebTest"><BR> =
<echo=20
message=3D"base dir is=20
${base.dir}"/><BR> <echo =
message=3D"home dir is ${webtest.home}"/><BR> <testSpec =
name=3D"check calling and parsing a local=20
file"><BR> <config<BR> &nbs=
p; =20
host=3D""<BR> port=3D""<BR>  =
;basepath=3D""<BR> summary=3D"false"<BR> &nbs=
p; verbose=3D"true"<BR> saveresponse=3D=
"true"<BR> haltonfailure=3D"true"<BR> &=
nbsp; protocol=3D"file"=20
/><BR> <steps><BR> <i=
nvoke<BR> stepid=3D"get=20
local =
file"<BR> url=3D"${base.dir}\testfile.html" =
/><BR> <verifytitle<BR> &nb=
sp; stepid=3D"check=20
the title is parsed =
correctly"<BR> text=3D"Test File=20
Title"=20
/><BR> </steps><BR> </testSpec>=
;<BR> </target></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2> <target=20
name=3D"checkANT"><BR> <available=20
classname=3D"org.apache.tools.ant.ProjectComponent"<BR> =
property=3D"ant.version.ok"/><BR> </target></FONT></SPAN></=
DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2> <target=20
name=3D"mayPrintANTError" unless=3D"ant.version.ok"=20
depends=3D"checkANT"><BR> <echo message=3D"You have a =
non-compliant=20
version of ANT"/><BR> <echo message=3D"Consider moving=20
WEBTESTHOME/lib/ant.jar"/><BR> <echo message=3D"to=20
ANT_HOME/lib."/><BR> </target><BR></project></FONT></=
SPAN></DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial =
size=3D2>------------- error=20
message ----------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2>D:\WebTest\doc\samples>ant -v -buildfile =
installTest.xml<BR>Apache Ant=20
version 1.5.4 compiled on August 12 2003<BR>Buildfile:=20
installTest.xml<BR>Detected Java version: 1.4 in:=20
D:\Sun\AppServer\jdk\jre<BR>Detected OS: Windows XP<BR>parsing buildfile =
installTest.xml with URI =3D=20
file:D:/WebTest/doc/samples/install<BR>Test.xml<BR>Project base dir set =
to:=20
D:\WebTest\doc\samples<BR> [taskdef] Loading definitions from file =
D:\WebTest\webtestTaskdefs.properties<BR>Build sequence for target `all' =
is=20
[checkANT, mayPrintANTError, checkWebTest, al<BR>l]<BR>Complete build =
sequence=20
is [checkANT, mayPrintANTError, checkWebTest, all]</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2>checkANT:</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2>mayPrintANTError:<BR>Skipped because property 'ant.version.ok'=20
set.</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2>checkWebTest:<BR> [echo] base dir is=20
D:\WebTest\doc\samples<BR> [echo] home dir is=20
D:\WebTest\doc\samples/../..</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial size=3D2>BUILD=20
FAILED<BR>file:D:/WebTest/doc/samples/installTest.xml:18:=20
java.lang.NumberFormatException:<BR> For input string:=20
""<BR> at=20
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe<BR>=
lper.java:435)<BR> =20
at=20
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:306)<BR>&=
nbsp; =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:242)<BR> =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:211)<BR> =20
at=20
org.apache.tools.ant.Task.maybeConfigure(Task.java:259)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:260)<BR> =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:211)<BR> =20
at=20
org.apache.tools.ant.Task.maybeConfigure(Task.java:259)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.Task.perform(Task.java:340)<BR> &nb=
sp; =20
at=20
org.apache.tools.ant.Target.execute(Target.java:309)<BR>  =
; =20
at=20
org.apache.tools.ant.Target.performTasks(Target.java:336)<BR> =
=20
at=20
org.apache.tools.ant.Project.executeTarget(Project.java:1339)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.Project.executeTargets(Project.java:1255)<BR> &=
nbsp; =20
at=20
org.apache.tools.ant.Main.runBuild(Main.java:609)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.Main.start(Main.java:196)<BR>  =
; =20
at org.apache.tools.ant.Main.main(Main.java:235)<BR>Caused by:=20
java.lang.NumberFormatException: For input string:=20
""<BR> at=20
java.lang.NumberFormatException.forInputString(NumberFormatException.<BR>=
java:48)<BR> =20
at=20
java.lang.Integer.parseInt(Integer.java:489)<BR> &=
nbsp; =20
at=20
java.lang.Integer.<init>(Integer.java:609)<BR> &nb=
sp; =20
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native=20
Method)</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2> at=20
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct<BR>=
orAccessorImpl.java:39)<BR> =20
at=20
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC<BR>=
onstructorAccessorImpl.java:27)<BR> &n=
bsp;=20
at=20
java.lang.reflect.Constructor.newInstance(Constructor.java:274)<BR> =
=20
at=20
org.apache.tools.ant.IntrospectionHelper$12.set(IntrospectionHelper.j<BR>=
ava:804)<BR> =20
at=20
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe<BR>=
lper.java:426)<BR> =20
... 15 more<BR>--- Nested Exception =
---<BR>java.lang.NumberFormatException: For=20
input string: ""<BR> at=20
java.lang.NumberFormatException.forInputString(NumberFormatException.<BR>=
java:48)<BR> =20
at=20
java.lang.Integer.parseInt(Integer.java:489)<BR> &=
nbsp; =20
at=20
java.lang.Integer.<init>(Integer.java:609)<BR> &nb=
sp; =20
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native=20
Method)</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial=20
size=3D2> at=20
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct<BR>=
orAccessorImpl.java:39)<BR> =20
at=20
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC<BR>=
onstructorAccessorImpl.java:27)<BR> &n=
bsp;=20
at=20
java.lang.reflect.Constructor.newInstance(Constructor.java:274)<BR> =
=20
at=20
org.apache.tools.ant.IntrospectionHelper$12.set(IntrospectionHelper.j<BR>=
ava:804)<BR> =20
at=20
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe<BR>=
lper.java:426)<BR> =20
at=20
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:306)<BR>&=
nbsp; =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:242)<BR> =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:211)<BR> =20
at=20
org.apache.tools.ant.Task.maybeConfigure(Task.java:259)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:260)<BR> =20
at=20
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig<BR>=
urable.java:211)<BR> =20
at=20
org.apache.tools.ant.Task.maybeConfigure(Task.java:259)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.Task.perform(Task.java:340)<BR> &nb=
sp; =20
at=20
org.apache.tools.ant.Target.execute(Target.java:309)<BR>  =
; =20
at=20
org.apache.tools.ant.Target.performTasks(Target.java:336)<BR> =
=20
at=20
org.apache.tools.ant.Project.executeTarget(Project.java:1339)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.Project.executeTargets(Project.java:1255)<BR> &=
nbsp; =20
at=20
org.apache.tools.ant.Main.runBuild(Main.java:609)<BR> &n=
bsp; =20
at=20
org.apache.tools.ant.Main.start(Main.java:196)<BR>  =
; =20
at org.apache.tools.ant.Main.main(Main.java:235)</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D937072114-17052004><FONT face=3DArial size=3D2>Total =
time: 1=20
second</DIV>
<DIV><BR></DIV></FONT></SPAN></BODY></HTML>
------=_NextPart_000_0050_01C43BFA.5C0FD220--