[Adding: Krishantha] Hi Malithi,
Have you written the 'BeforeTest' and 'AfterTest' inside the same test class with 'BeforeClasst' ,'AfterClasst and other "@Test" test methods? If so put 'BeforeTest' and 'AfterTest' in a different class and add that class to testng.xml with OpenIDSSOTestCase. Thanks and Best Regards, Saneth Dharmakeerthi Senior Software Engineer WSO2, Inc. Mobile: +94772325511 On Mon, Mar 16, 2015 at 6:44 PM, Malithi Edirisinghe <malit...@wso2.com> wrote: > Hi All, > > I'm using Factories in TestNG to instantiate tests dynamically for > different parameter sets. And I have configured the test class inside a > <test> block in the testng.xml as below. > > <test name="Test - IS - OpenID" preserve-order="true" parallel="false"> > <classes> > <class > name="org.wso2.identity.integration.test.openid.OpenIDSSOTestCase" /> > </classes> > </test> > > When running this test on the TAF 4.3.1 I found that the methods annotated > with 'BeforeTest' and 'AfterTest' runs for each test instance instantiated > with the factory. > But when running the same test on an earlier version of TAF, methods > annotated with 'BeforeTest' and 'AfterTest' are executed only once, which > is the expected behavior [1]. > > I found that TAF 4.3.1 is using TestNG 6.1.1 where as earlier versions of > TAF use TestNG 6.8. Seems this issue is with TestNG 6.1.1 version. This is > also reported in [2]. > > Is there a specific reason to downgrade the TestNG version in TAF 4.3.1 ? > In that case, what would be the way to achieve the expected behavior ? > > [1] http://testng.org/doc/documentation-main.html#annotations > [2] http://osdir.com/ml/java-testng-user/2011-07/msg00166.html > > Thanks, > Malithi. > -- > > *Malithi Edirisinghe* > Senior Software Engineer > WSO2 Inc. > > Mobile : +94 (0) 718176807 > malit...@wso2.com > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev