problems with recent eclipse plugin - @AfterClass not working

99 views
Skip to first unread message

JW

unread,
Aug 24, 2011, 9:47:25 AM8/24/11
to testng-users
I'm using the latest version of the eclipse plugin: 1537. Since the
version before this one (I think that was 0944?), the @AfterClass
annotation is ignored. (I have mine in a super class of the class
with the @Test annotations). When I run testng through the maven
plugin, it works fine. It is only in eclipse that I have this
problem.

The eclipse plugin having this jar manifest does NOT have this
problem:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 16.3-b01-279 (Apple Inc.)
Main-Class: org.testng.TestNG
Implementation-Version: 6.1.2beta-201107281008

Cédric Beust ♔

unread,
Aug 24, 2011, 1:01:51 PM8/24/11
to testng...@googlegroups.com
It seems to work for me:

RemoteTestNG starting
Context:/private/var/folders/d2/zrhr2td92f1cpbnt6cyht4qr0000gq/T/testng-eclipse--890370158/testng-customsuite.xml
After class
PASSED: a1(org.testng.TestRunner@5c1428ea)

Can you create a small Eclipse project, zip it and email it to me?

Thanks.

-- 
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.


JW

unread,
Aug 24, 2011, 3:03:08 PM8/24/11
to testng-users
I found the issue. As I stated in my email to you with the requested
zip attachment:

The key is to:

1. Inherit from a class with a @Test annotation
2. Run from xml – so choose the Suite option in the eclipse run
configuration. This xml points to a method in the child class

It doesn’t matter if @AfterClass is in the parent or the child class.

If you comment out the @Test annotation in the super class, it works
fine.


On Aug 24, 1:01 pm, Cédric Beust ♔ <ced...@beust.com> wrote:
> It seems to work for me:
>
> RemoteTestNG starting
> Context:/private/var/folders/d2/zrhr2td92f1cpbnt6cyht4qr0000gq/T/testng-ecl­ipse--890370158/testng-customsuite.xml
> *After class*
> >http://groups.google.com/group/testng-users?hl=en.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages