TestNG5.2 error message: "No tests were run"

628 views
Skip to first unread message

BK Lau

unread,
Oct 14, 2006, 7:45:00 PM10/14/06
to testng...@googlegroups.com
Hi :
I have one one more JUnit tests running under TestNG5.2 with
Ant 1.6.5/JDK1.4.2 with "junit" attribute set to "true" in one or more testng.xml files.
I set Ant attribute 'haltOnFailures"=true and even after running
all the test successfully, the Ant build running TestNG task reported
build failed with the following "red herring" error message "No Test were run".
A typical stack trace is:

G:\TestNG_5.1_Stage4\xute-0.2.0\xute.build.xml:141: No tests were run
at org.testng.TestNGAntTask.actOnResult(TestNGAntTask.java:486)
at org.testng.TestNGAntTask.execute(TestNGAntTask.java:472)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

You can reproduced this error easily, using the suite test "junit.samples.AllTests"
from the shipped Junit tests, for example:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="5" verbose="1" name="All JUnit tests" parallel="null" annotations="JDK5">
<test name="junit.samples.AllTests" junit="true">
<classes>
<class name="junit.samples.AllTests"/>
</classes>
</test>
</suite>

Will this be fixed in TestNG5.3?.

Thanks,

BK
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=46333&messageID=93613#93613

Alexandru Popescu

unread,
Oct 15, 2006, 4:27:12 AM10/15/06
to testng...@googlegroups.com
I think the problem is parallel="null" in your suite definition. Can
you fix that and retry?

./alex
--
.w( the_mindstorm )p.
TestNG co-founder
EclipseTestNG Creator

BK Lau

unread,
Oct 16, 2006, 12:14:47 PM10/16/06
to testng...@googlegroups.com
>
> I think the problem is parallel="null" in your suite
> definition. Can
> you fix that and retry?

Alex:

What value should I use in place of parallel="null"?.

Thanks,

BK


>
> ./alex
> --
> .w( the_mindstorm )p.
> TestNG co-founder

> org.apache.tools.ant.Project.executeTarget(Project.jav
> a:1185)
> > at
> org.apache.tools.ant.helper.DefaultExecutor.executeTar
> gets(DefaultExecutor.java:40)
> > at
> org.apache.tools.ant.Project.executeTargets(Project.ja

http://forums.opensymphony.com/thread.jspa?threadID=46333&messageID=93922#93922

Cédric Beust ♔

unread,
Oct 16, 2006, 12:16:31 PM10/16/06
to testng...@googlegroups.com
true or false

--
Cedric


> org.apache.tools.ant.Target.performTasks (Target.java:3

> 69)
> >         at
> org.apache.tools.ant.Project.executeSortedTargets(Proj
> ect.java:1216)
> >         at
> org.apache.tools.ant.helper.SingleCheckExecutor.execut
> eTargets(SingleCheckExecutor.java:37)
> >         at
> org.apache.tools.ant.Project.executeTargets(Project.ja
> va:1068)
> >         at
> org.apache.tools.ant.taskdefs.Ant.execute (Ant.java:382

BK Lau

unread,
Oct 16, 2006, 2:15:22 PM10/16/06
to testng...@googlegroups.com
> true or false
>

Cederic:

I set it parallel="false" and it still gave the me the same
error message "No tests were run".


-BK-

> org.apache.tools.ant.Target.performTasks(Target.java:3


> > > 69)
> > > > at
> > >
> org.apache.tools.ant.Project.executeSortedTargets(Proj
> > > ect.java:1216)
> > > > at
> > >
> org.apache.tools.ant.helper.SingleCheckExecutor.execut
> > > eTargets(SingleCheckExecutor.java:37)
> > > > at
> > >
> org.apache.tools.ant.Project.executeTargets(Project.ja
> > > va:1068)
> > > > at
> > >

> org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382

> 333&messageID=93922#93922
> >
> >
> > >
> >
>
>
> --
> Cédric


>
>
> ---------------------------------------------------------------------
Posted via Jive Forums

http://forums.opensymphony.com/thread.jspa?threadID=46333&messageID=93954#93954

BK Lau

unread,
Oct 17, 2006, 12:32:38 PM10/17/06
to testng...@googlegroups.com
> true or false
>
Cederic:

I noted in the TestNG 5.2 release note:

[b]Added: parallel can now be "methods" or "tests". Boolean version deprecated[/b]

I also checked the source code for the TestNG class [i]org.testng.xml.XmlSuite[/i], it seems
that setParallel(boolean) is now changed to
setParallel(String).

Can you pls explain a bit about the intended use for above change?. Also is "true" or "false" still legitimate values for parallel?.

Thanks,

-BK-

> org.apache.tools.ant.Target.performTasks(Target.java:3


> > > 69)
> > > > at
> > >
> org.apache.tools.ant.Project.executeSortedTargets(Proj
> > > ect.java:1216)
> > > > at
> > >
> org.apache.tools.ant.helper.SingleCheckExecutor.execut
> > > eTargets(SingleCheckExecutor.java:37)
> > > > at
> > >
> org.apache.tools.ant.Project.executeTargets(Project.ja
> > > va:1068)
> > > > at
> > >

> org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382

> 333&messageID=93922#93922
> >
> >
> > >
> >
>
>
> --
> Cédric


>
>
> ---------------------------------------------------------------------
Posted via Jive Forums

http://forums.opensymphony.com/thread.jspa?threadID=46333&messageID=94253#94253

Cédric Beust ♔

unread,
Oct 17, 2006, 1:11:41 PM10/17/06
to testng...@googlegroups.com
On 10/17/06, BK Lau <testng...@opensymphony.com> wrote:

> true or false
>
Cederic:

I noted in the TestNG 5.2 release note:

[b]Added: parallel can now be "methods" or "tests". Boolean version deprecated[/b]

I also checked the source code for the TestNG class [i]org.testng.xml.XmlSuite[/i], it seems
that setParallel(boolean) is now changed to
setParallel(String).

Can you pls explain a bit about the intended use for above change?. Also is "true" or "false" still legitimate values for parallel?.

Oops, sorry, I lose track of even my own changes :-)

Yes, true and false are still supported but deprecated.  Please use either "methods" or "tests".  The older usage (parallel="true") is now parallel="methods", and the new one, parallel="tests", means that each <test> will be run in its own thread.

--
Cédric

Alexandru Popescu

unread,
Oct 17, 2006, 1:17:40 PM10/17/06
to testng...@googlegroups.com

However, this is not gonna have any influence because BK is running
junit tests :-).

./alex
--
.w( the_mindstorm )p.
TestNG co-founder

EclipseTestNG Creator

> --
> Cédric
>
> >
>

Alexandru Popescu

unread,
Oct 17, 2006, 1:26:52 PM10/17/06
to testng...@googlegroups.com
I have rerun the suite definition you have provided with 5.3 beta and
I am seeing the following result:

===============================================
junit.samples.AllTests
Tests run: 131, Failures: 0, Skips: 0
===============================================


===============================================
All JUnit tests
Total tests run: 131, Failures: 0, Skips: 0
===============================================

[TestNG] No tests found. Nothing was run

I will check why the last message is displayed.

Alexandru Popescu

unread,
Oct 17, 2006, 3:17:12 PM10/17/06
to testng...@googlegroups.com
On 10/17/06, Alexandru Popescu <the.mindstor...@gmail.com> wrote:
> I have rerun the suite definition you have provided with 5.3 beta and
> I am seeing the following result:
>
> ===============================================
> junit.samples.AllTests
> Tests run: 131, Failures: 0, Skips: 0
> ===============================================
>
>
> ===============================================
> All JUnit tests
> Total tests run: 131, Failures: 0, Skips: 0
> ===============================================
>
> [TestNG] No tests found. Nothing was run
>
> I will check why the last message is displayed.
>

This is fixed now in the SVN trunk v240.

BK Lau

unread,
Oct 17, 2006, 3:24:05 PM10/17/06
to testng...@googlegroups.com
Alex:

Thanks for the fix.


---------------------------------------------------------------------
Posted via Jive Forums

http://forums.opensymphony.com/thread.jspa?threadID=46333&messageID=94304#94304

Reply all
Reply to author
Forward
0 new messages