Okay I upgraded the testng jar to 5.14.7 in my project lib folder and
i have this as the task def:
<taskdef resource="testngtasks" classpath="${lib.dir}/
testng-5.14.7.jar" />
Running with Ant 1.8.2 on my Linux server gives the following error
BUILD FAILED
/root/justin/ui-trunk/build.xml:542: testng doesn't support the nested
"propertyset" element.
at
org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:
362)
at
org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:201)
at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:
163)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:
1368)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
41)
at org.apache.tools.ant.Project.executeTargets(Project.java:
1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:
109)
Caused by: The <testng> type doesn't support the nested "propertyset"
element.
at
org.apache.tools.ant.IntrospectionHelper.throwNotSupported(IntrospectionHelper.java:
503)
at
org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:
352)
... 13 more
I'm not sure how to get the ant -v option to show more of the stack
trace. Also here is my testng task starting on line 542 of my
build.xml
<testng classpathref="base.test.path" outputDir="${testng.report.dir}"
verbose="2">
<xmlfileset dir="${basedir}/test" includes="testng.xml"/>
<propertyset refid="testngpropset1"/>
</testng>
By the way upgrading to my testng jar to 5.14.7 causes class not found
exception on my Windows XP workstation with the following error:
C:\Documents and Settings\ja186002\workspace\scanner-ui\build.xml:182:
taskdef class org.testng.JUnitConverterTask cannot be found
using the classloader AntClassLoader[C:\Documents and Settings
\ja186002\workspa
ce\scanner-ui\libs\testng-5.14.7.jar]
at
org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:622)
at
org.apache.tools.ant.taskdefs.Definer.loadProperties(Definer.java:423
)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:
279)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
180)
at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:82)
at org.apache.tools.ant.Main.runBuild(Main.java:793)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:
109)
Caused by: java.lang.ClassNotFoundException:
org.testng.JUnitConverterTask
at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa
der.java:1361)
at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:131
1)
at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:106
4)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:594)
... 16 more
I should make it clear that downgrading to testng-5.14.6.jar results
in successful testng run on the same Windows XP workstation. With
either jar version, the Linux server has the same issue with the
nested propertyset. Just for kicks I decided to remove the nested
propertyset element and re ran on the Linux server with successful run
of testng test suite.
The issue remains of the broken nested propertyset element, and the
class not found exception with The Windows OS in the 5.14.7 jar.
I hope the information and details I provided are helpful and clear.
Justin