Skip to content
Snippets Groups Projects
Commit 8ca79646 authored by kaloyane's avatar kaloyane
Browse files

minor: restore test version which works on Hudson

SVN: 20878
parent 3bdab59e
No related branches found
No related tags found
No related merge requests found
......@@ -16,10 +16,11 @@
package ch.systemsx.cisd.openbis.generic.server.business.bo;
import java.lang.reflect.Method;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.testng.AssertJUnit;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
......@@ -194,19 +195,15 @@ public abstract class AbstractBOTest extends AssertJUnit
}
@AfterMethod
public void afterMethod(ITestResult result)
public void afterMethod(Method m)
{
// verify mock expectations only when the test has not failed
if (result.isSuccess())
try
{
try
{
context.assertIsSatisfied();
} catch (Throwable t)
{
// assert expectations were met, including the name of the failed method
throw new Error(result.getMethod().getMethodName() + "() : ", t);
}
context.assertIsSatisfied();
} catch (Throwable t)
{
// assert expectations were met, including the name of the failed method
throw new Error(m.getName() + "() : ", t);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment