0

I am trying to have a method in the testBaseClass, which all my test classes extend, run once before the entire suite is run. I am having trouble getting this to happen. my testNG file looks like this:

<parameter name="test-domain" value="Base.Gamma"/>
<parameter name="domain" value="gamma" />
<parameter name="realm" value="lolo" />


<test name="ComputeCorAndPfmInternalTest">
    <classes>
                    <class 
            name="com.amazon.tahoe.service.a4kservice.testcases.BaseA4kServiceTestCase"/>
        <class
            name="com.amazon.tahoe.service.a4kservice.testcases.ComputeCorAndPfmInternalTest" />

    </classes>
</test>  

And my method in the abstract class (BaseA4KServiceTestCase) looks like this:

@BeforeSuite(alwaysRun=true) 
@Parameters({"domain","realm"}) 
private void initialize(String domain, String realm){ 
...
}
4

1 回答 1

0

我发现抽象类中的方法必须是公共的,TestNG 才能调用它。谢谢。

于 2013-11-08T21:04:09.813 回答