com.mycila.testing.core.plugin
Interface TestPlugin

All Superinterfaces:
com.mycila.plugin.api.Plugin
All Known Implementing Classes:
AnnotationTestPlugin, DefaultTestPlugin

public interface TestPlugin
extends com.mycila.plugin.api.Plugin

This interface should be implemented by all plugins. It is strongly adviced that plugins extends DefaultTestPlugin instead of implementing directly TestPlugin interface, to avoid any code break when changing or enhancing the API.

Author:
Mathieu Carbou (mathieu.carbou@gmail.com)

Method Summary
 void afterClass(TestContext context)
          This method will be called on each plugin in order of dependency after all test method of a test instance have finished.
 void afterTest(TestExecution testExecution)
          This method will be called on each plugin in order of dependency after each test method has finished, even if the method failed.
 void beforeTest(TestExecution testExecution)
          This method will be called on each plugin in order of dependency to execute code required before a test method can run.
 void prepareTestInstance(TestContext context)
          This method will be called on each plugin in order of dependency to prepare the test instance before all tests begin to be executed.
 void shutdown(TestContext context)
          This method will be called at JVM shutdown if the plugin needs to close some resources cleanly.
 
Methods inherited from interface com.mycila.plugin.api.Plugin
getAfter, getBefore
 

Method Detail

prepareTestInstance

void prepareTestInstance(TestContext context)
                         throws Exception
This method will be called on each plugin in order of dependency to prepare the test instance before all tests begin to be executed.

Parameters:
context - The test context, relative to one test instance
Throws:
Exception - If anything wrong occurs in plugin execution. Exception will be catched by the testing API.

beforeTest

void beforeTest(TestExecution testExecution)
                throws Exception
This method will be called on each plugin in order of dependency to execute code required before a test method can run.

Parameters:
testExecution - The test execution context of this test method. The text execution enables plugins to control whethere the test method should be skipped or not
Throws:
Exception - If anything wrong occurs in plugin execution. Exception will be catched by the testing API.

afterTest

void afterTest(TestExecution testExecution)
               throws Exception
This method will be called on each plugin in order of dependency after each test method has finished, even if the method failed.

Parameters:
testExecution - The test execution context of this test method. The test execution context enables the plugins to handle what to do in case of a failed test, with the provided exception in the context
Throws:
Exception - If anything wrong occurs in plugin execution. Exception will be catched by the testing API.

afterClass

void afterClass(TestContext context)
                throws Exception
This method will be called on each plugin in order of dependency after all test method of a test instance have finished.

Parameters:
context - The context of this test
Throws:
Exception - If anything wrong occurs in plugin execution. Exception will be catched by the testing API.

shutdown

void shutdown(TestContext context)
              throws Exception
This method will be called at JVM shutdown if the plugin needs to close some resources cleanly.

Parameters:
context - The context of this test
Throws:
Exception - If anything wrong occurs in plugin execution. Exception will be catched by the testing API.


Copyright © 2008-2011 Mycila. All Rights Reserved.