This content has been marked as final.
Show 1 reply
-
1. Re: TestEnricher.teardown()
aslak Apr 16, 2010 5:38 AM (in response to alrubinger)See: http://community.jboss.org/message/537913#537913
With the new core, a possible solution could be to let the TestEnricher have access to the TestContext. With this it can register it self for a callback in the @After lifecycle.
{code:java}
public class InstallTestCase implements TestEnricher{@Overridepublic void enrich(final TestContext context, final Object testCase){MCServer server = context.get(MCServer.class);server.install(testCase);context.register(After.class, new UninstallTestCase());}public static class UninstallTestCase implements EventHandler<TestContext, TestEvent>{@Overridepublic void callback(TestContext context, TestEvent event) throws Exception{MCServer server = context.get(MCServer.class);server.uninstall(event.getTestInstance());}}}{code}