the blog for developers

Why, oh why, doesn't TestNG work for me?

I switched several projects from JUnit 3 to TestNG. After some minor problems with the fact that TestNG doesn’t seperate tests as JUnit does per default, everything works in IDEA and Maven. But whatever I tried, I can’t get TestNG to work with Ant. The TestNG Ant task just doesn’t find any tests. I used testjar, dir, includes and it also doesn’t help that the TestNG documentation is sparse and misleading. I moved Messages to TestNG too, but without Ant support this will not be released. Everything works fine, just Ant doesn’t. If I can’t get it working, I’ll give Junit 4 a try.

You can leave a Reply here. Of course, you should follow me on twitter here.

You can share this post!
Do you want to tell others about this article? Use the social bookmark icons to submit this artice to the service of your choice. Thanks.

About the author: Stephan Schmidt has more than 15 years of internet technology experience and 10 years experience in agile. He was head of development, consultant and CTO and is a speaker, author and blog writer. He specializes in organizing and optimizing software development helping companies by increasing productivity with lean software development and agile methodologies. Want to know more? All views are only his own.
Leave a reply.

Comments

Hi Stephan!

I am wondering what may be wrong because Ant task is the oldest supported by TestNG and evolved all the time. Maybe you can drop an email to user list or if this is not possible drop me an offline message. I am sure we can make it work for you. And I am sure that TestNG will work well for you (or at least this is what I expect ;-) ).

./alex

.w( the_mindstorm )p.

(TestNG co-founder)
(http://themindstorms.blogspot.com)

stephan

Thanks. Dropped a mail. Great support :-)

stephan

Thanks. Problem solved with your feedback :-)

Glad to hear! Please feel free in future to get to me or to the TestNG user lists. Our support tries
always to be this way ;-).

./alex

.w( the_mindstorm )p.

(http://themindstorms.blogspot.com)

Rinki Goyal

Hello,
I am also facing the same following problem :
I switched several projects from JUnit 3 to TestNG. After some minor problems with the fact that TestNG doesn’t seperate tests as JUnit does per default, everything works in IDEA and Maven. But whatever I tried, I can’t get TestNG to work with Ant. The TestNG Ant task just doesn’t find any tests. I used testjar, dir, includes and it also doesn’t help that the TestNG documentation is sparse and misleading. I moved Messages to TestNG too, but without Ant support this will not be released. Everything works fine, just Ant doesn’t. If I can’t get it working, I’ll give Junit 4 a try.
.
Can anyone provide solution for the same

Thanks & Regards
Rinki

Leave a Reply

What people wrote somewhere else:

Additional comments powered by BackType

Guide to CodeMonkeyism

Over the last 4 years I wrote many articles on this blog. To make it easier for you to find the relevant ones, I've organized them into topics.

Top 10

6 reasons why my VC funded startup did fail

Go Ahead: Next Generation Java Programming Style

Java Interview questions: Write a String Reverser

The dark side of NoSQL

7 Bad Signs not to Work for a Software Company or Startup

Is Java dead?

Scala vs. Clojure

Never, never, never use String in Java

No future for functional programming in 2008 – Scala, F# and Nu

Clojure vs Scala, Part 2

Java Developer

Is Java Dead?

Go Ahead: Next Generation Java Programming Style

Be careful with magical code

All variables in Java must be final

Never, never, never use String in Java

Bending Java: More readable code with methods that do nothing?

NoSQL Guy

NoSQL: The Dawn of Polyglot Persistence

The dark side of NoSQL

Essential storage tradeoff: Simple Reads vs. Simple Writes

Sharding destroys the goals of your relational database

The unholy legacy of databases

Startup/CTO

Development Dream Teams

6 reasons why my VC funded startup did fail

American vs. European style of Software Development

12 Things to Reduce Your Lead Time and Time to Market

The high cost of overhead when working in parallel

Essential storage tradeoff: Simple Reads vs. Simple Writes

Job Seeker

Another Good (Java) Interview Question

7 Bad Signs not to Work for a Software Company or Startup

Java Interview questions: Write a String Reverser (and use Recursion!)

Java Interview questions: Multiple Inheritance

As a Manager: What I value in developers

Top 10 Tips (+1) to Get a Pay Raise

Agilist

What Developers Need to Know About Agile

5 Practices Better to Change in Your Scrum Implementation

Scrum is not about engineering practices

ScrumMaster and ZenMaster: The joke of certification

What is Trans-Scrum?