You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "nodje (JIRA)" <ji...@codehaus.org> on 2008/12/19 07:26:20 UTC

[jira] Commented: (SUREFIRE-479) @BeforeClass and @AfterClass on parent class are not executed

    [ http://jira.codehaus.org/browse/SUREFIRE-479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158682#action_158682 ] 

nodje commented on SUREFIRE-479:
--------------------------------

I met the problem as well.
I uploaded a test case that reproduce the problem.

It does only appear (in my case) when you use a group though.
If you don't specify the group in the @BeforeClass annotation as well, the annotated method won't be called.

The behaviour is different without using Surefire: the @BeforeClass annotation would be taken into account regardless of the specified group.

I'm glad I figured this one, I was pretty stuck!

> @BeforeClass and @AfterClass on parent class are not executed
> -------------------------------------------------------------
>
>                 Key: SUREFIRE-479
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-479
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>    Affects Versions: 2.4.2
>            Reporter: Erik Putrycz
>         Attachments: surefire479.zip
>
>
> I have 
> public abstract class A {
>    @BeforeClass
>    public void init() {...}
>    @AfterClass
>    public void cleanup() {...}
> }
> and 
> @Test
> public class TestA extends A {
>   public void testSomething() {...}
> }
> when surefire executes testSomething, the @BeforeClass and @AfterClass are never being called. I have testng 5.7.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira