[infinispan-issues] [JBoss JIRA] (ISPN-3078) @AfterMethod/alwaysRun and alike are not used correctly

Mircea Markus (JIRA) jira-events at lists.jboss.org
Wed May 8 11:27:53 EDT 2013


     [ https://issues.jboss.org/browse/ISPN-3078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mircea Markus updated ISPN-3078:
--------------------------------

    Description: 
alwaysRun=true makes the invocation of that method to happen even if the test that has the method is not in the running group:http://testng.org/javadoc/org/testng/annotations/BeforeMethod.html#alwaysRun()

E.g. if I want to run the "xsite" groups, all the @AfterMethod(alwaysRun=true) from the "functional" groups are also invoked, most likely causing NPEs as the resources from this tests haven't been initialised. So unless used for an abstract test class that would be extended by multiple classes from different groups, I don't see any point in using "alwaysRun" on neither @BeforeMethod nor on @AfterMethod.


This is causing the suite to exit:
{quote}
[14:53:10][org.infinispan:infinispan-server-core] 
[14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) Exiting because MarshallingTest has NOT shut down all the cache managers it has started !!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) The still-running cacheManager was created here: org.infinispan.server.core.AbstractMarshallingTest.setUp(AbstractMarshallingTest.scala:49) !!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{quote}

AbstractMarshallingTest.tearDown is always invoked(always=true) so I don't know why this doesn't get cleaned up. Anyway better to use TestUtil.killCacheManager(..) for handling this.
 
http://ci.infinispan.org/viewLog.html?buildId=1005&buildTypeId=bt2&tab=buildLog#_focus=27336



  was:
This is causing the suite to exit:
{quote}
[14:53:10][org.infinispan:infinispan-server-core] 
[14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) Exiting because MarshallingTest has NOT shut down all the cache managers it has started !!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) The still-running cacheManager was created here: org.infinispan.server.core.AbstractMarshallingTest.setUp(AbstractMarshallingTest.scala:49) !!!!!!!
[14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{quote}

AbstractMarshallingTest.tearDown is always invoked(always=true) so I don't know why this doesn't get cleaned up. Anyway better to use TestUtil.killCacheManager(..) for handling this.
 
http://ci.infinispan.org/viewLog.html?buildId=1005&buildTypeId=bt2&tab=buildLog#_focus=27336


The above issue is caused by the following:
This makes the invocation of that method happen even if the test is not in the running group:http://testng.org/javadoc/org/testng/annotations/BeforeMethod.html#alwaysRun()

E.g. if I want to run the "xsite" groups, all the @AfterMethod(alwaysRun=true) from the "functional" groups are also invoked, most likely causing NPEs as the resources from this tests haven't been initialised. So unless used for an abstract test class that would be extended by multiple classes from different groups, I don't see any point in using "alwaysRun" on neither @BeforeMethod nor on @AfterMethod.




    
> @AfterMethod/alwaysRun and alike are not used correctly 
> --------------------------------------------------------
>
>                 Key: ISPN-3078
>                 URL: https://issues.jboss.org/browse/ISPN-3078
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Test Suite
>    Affects Versions: 5.3.0.Beta1
>            Reporter: Mircea Markus
>            Assignee: Mircea Markus
>             Fix For: 5.3.0.Beta2
>
>
> alwaysRun=true makes the invocation of that method to happen even if the test that has the method is not in the running group:http://testng.org/javadoc/org/testng/annotations/BeforeMethod.html#alwaysRun()
> E.g. if I want to run the "xsite" groups, all the @AfterMethod(alwaysRun=true) from the "functional" groups are also invoked, most likely causing NPEs as the resources from this tests haven't been initialised. So unless used for an abstract test class that would be extended by multiple classes from different groups, I don't see any point in using "alwaysRun" on neither @BeforeMethod nor on @AfterMethod.
> This is causing the suite to exit:
> {quote}
> [14:53:10][org.infinispan:infinispan-server-core] 
> [14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> [14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) Exiting because MarshallingTest has NOT shut down all the cache managers it has started !!!!!!!
> [14:53:10][org.infinispan:infinispan-server-core] !!!!!! (testng-MarshallingTest) The still-running cacheManager was created here: org.infinispan.server.core.AbstractMarshallingTest.setUp(AbstractMarshallingTest.scala:49) !!!!!!!
> [14:53:10][org.infinispan:infinispan-server-core] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> {quote}
> AbstractMarshallingTest.tearDown is always invoked(always=true) so I don't know why this doesn't get cleaned up. Anyway better to use TestUtil.killCacheManager(..) for handling this.
>  
> http://ci.infinispan.org/viewLog.html?buildId=1005&buildTypeId=bt2&tab=buildLog#_focus=27336

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list