java - Powermock tests pass when run seperate but fail in suite -
i using powermock + easymock + testng
<!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="my module" suite-preserve-order="true" verbose="10" object-factory="org.powermock.modules.testng.powermockobjectfactory"> <test verbose="2" name="module1" annotations="jdk"> <classes> <class name="com.mymodule.testclass1" /> <class name="com.mymodule.testclass2" /> <class name="com.mymodule.testclass3" /> </classes> </test> </suite>
test1 & 2 works together. when added test3, started failing sorts of errors java.lang.illegalstateexception: no last call on mock available
i fixed test1 adding annotation @prepareeverythingfortest
but not able fix test 2 & 3 has started failing. test 3 works fine individually. worth mentioning these classes share mocked classes , have been mocked in each other test case. default using annotation
@prepareonlythisfortest({testclass2.class,sharedclass.class})
how can fix these. looks mockings shared across tests. how stop it.
please reply
Comments
Post a Comment