testng doesn't support the nested "propertyset" element, ant error

1,328 views
Skip to first unread message

Justin Allen

unread,
Jan 31, 2011, 7:12:19 PM1/31/11
to testng-users
I'm having a bit of trouble and trying to understand the source of
this error then fix the problem. Here is the situation. I have been
able to successfully run my testng ant task on my local windows XP
workstation, which has ant 1.7.1 (6/27/08 build). However I checked
out my project code and I'm trying a test run on a Linux server with
the build.xml from my workstation. The server is running ant 1.7.0
and I get the following error message,

"/root/justin/ui-trunk/build.xml:541: testng doesn't support the
nested "propertyset" element."

Here is a portion of the build.xml

<taskdef resource="testngtasks" classpath="${lib.dir}/
testng-5.14.6.jar" />

....

<property name="testng.report.dir" value="${basedir}/test-report" />
<property name="test.src.dir" value="${basedir}/test" />
<property name="test.class.dir" value="${build.home}/classes" />
<property name="test.libs.dir" value="${basedir}/libs" />
<propertyset id="testngpropset1">
<propertyref name="testng.report.dir" />
<propertyref name="test.src.dir" />
<propertyref name="test.class.dir" />
</propertyset>

<path id="base.test.path">
<pathelement location="${test.class.dir}"/>
<pathelement location="${src.home}"/>
<fileset dir="${test.libs.dir}">
<include name="**/*.jar"/>
</fileset>
</path>

<target name="ui-test" >

<mkdir dir="${build.home}/classes"/>
<javac srcdir="${src.home}:${test.src.dir}"
destdir="${build.home}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="base.test.path"/>
</javac>

<testng classpathref="base.test.path" outputDir="$
{testng.report.dir}" verbose="2">
<xmlfileset dir="${basedir}/test" includes="testng.xml"/>
<propertyset refid="testngpropset1"/>
</testng>
</target>

What is the minimum Apache Ant version which supports the nested
propertyset element? Is there another reason for this error message?

Thanks.
Justin

Cédric Beust ♔

unread,
Jan 31, 2011, 8:21:59 PM1/31/11
to testng...@googlegroups.com
Hi Justin,

I think the error message has nothing to do with ant but more to do with the version of TestNG itself.

I suggest starting by making sure you're using the latest TestNG and report back if you're still having this problem.

-- 
Cédric



--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


Justin Allen

unread,
Jan 31, 2011, 8:30:54 PM1/31/11
to testng-users
I have the testng-5.14.6 jar in a lib directory and the taskdef
pointing to this jar (shown below). Was there a problem in 5.14.6? I
got this from the testng.org site about a week ago, but I do see there
is a 5.14.7 available. I'll give the newest one a try and see what
happens.

<taskdef resource="testngtasks" classpath="${lib.dir}/
testng-5.14.6.jar" />


Justin
> > testng-users...@googlegroups.com<testng-users%2Bunsubscribe@google groups.com>
> > .

Cédric Beust ♔

unread,
Jan 31, 2011, 8:33:37 PM1/31/11
to testng...@googlegroups.com
No, there are no changes in the ant task in 5.14.7, so that's not the problem.

I can't investigate right now, maybe someone else can take a look.

-- 
Cédric


To unsubscribe from this group, send email to testng-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


Nalin Makar

unread,
Jan 31, 2011, 9:01:29 PM1/31/11
to testng...@googlegroups.com
whats the verbose output when running ant?

-nalin



To unsubscribe from this group, send email to testng-users...@googlegroups.com.

Justin Allen

unread,
Feb 1, 2011, 3:43:35 PM2/1/11
to testng-users
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
Reply all
Reply to author
Forward
0 new messages