com.mycila.testing.core
Class MycilaTesting

java.lang.Object
  extended by com.mycila.testing.core.MycilaTesting

public final class MycilaTesting
extends Object

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

Field Summary
static String DEFAULT_PLUGIN_DESCRIPTOR
           
 
Method Summary
 MycilaTesting configure(Object testInstance)
          Configure the Plugin manager of this MycilaTesting from the given class.
 TestNotifier createNotifier(Object testInstance)
           
static void debug()
           
static MycilaTesting from(Class<?> c)
          Get a MycilaTesting instance using the strategy defined for this class potentially annotated by MycilaPlugins.
static MycilaTesting from(MycilaPlugins mycilaPlugins)
          Get a MycilaTesting instance using the strategy defined in the provided annotation.
static MycilaTesting newCustomSetup()
          Creates a new custom TestSetup with an empty PluginManager.
static MycilaTesting newDefaultSetup()
          Creates a new TestSetup the default plugin descriptor which is DEFAULT_PLUGIN_DESCRIPTOR
static MycilaTesting newSetup(String pluginDescriptor)
          Creates a new TestSetup instance using a specific plugin descriptor to loads plugins.
 com.mycila.plugin.spi.PluginManager<TestPlugin> pluginManager()
           
static MycilaTesting staticCustomSetup()
          Get a static custom TestSetup instance with an empty PluginManager.
static MycilaTesting staticDefaultSetup()
          Get a static TestSetup with the default plugin descriptor which is DEFAULT_PLUGIN_DESCRIPTOR
static MycilaTesting staticSetup(String pluginDescriptor)
          Get a static TestSetup instance using a specific plugin descriptor to loads plugins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PLUGIN_DESCRIPTOR

public static final String DEFAULT_PLUGIN_DESCRIPTOR
See Also:
Constant Field Values
Method Detail

pluginManager

public com.mycila.plugin.spi.PluginManager<TestPlugin> pluginManager()

createNotifier

public TestNotifier createNotifier(Object testInstance)

configure

public MycilaTesting configure(Object testInstance)
Configure the Plugin manager of this MycilaTesting from the given class. It will search for all methods annotated by ConfigureMycilaPluginss and call those having the PluginManager as a parameter: @ConfigureMycilaPlugins void configure(PluginManager<TestPlugin> pluginManager) {...}

Parameters:
testInstance - The object having configure methods
Returns:
this

staticDefaultSetup

public static MycilaTesting staticDefaultSetup()
Get a static TestSetup with the default plugin descriptor which is DEFAULT_PLUGIN_DESCRIPTOR

Returns:
a TestSetup instance which can be used to prepare a test with plugins. This instance is registered statically to avoid reloading plugins each time

newDefaultSetup

public static MycilaTesting newDefaultSetup()
Creates a new TestSetup the default plugin descriptor which is DEFAULT_PLUGIN_DESCRIPTOR

Returns:
a TestSetup instance which can be used to prepare a test with plugins

staticSetup

public static MycilaTesting staticSetup(String pluginDescriptor)
Get a static TestSetup instance using a specific plugin descriptor to loads plugins. Default plugin descriptor is DEFAULT_PLUGIN_DESCRIPTOR

Parameters:
pluginDescriptor - The plugin descriptort to use. It is a property files containing a list of plugins to load. Default plugin descriptor is DEFAULT_PLUGIN_DESCRIPTOR
Returns:
a TestSetup instance which can be used to prepare a test with plugins. This instance is registered statically to avoid reloading plugins each time

newSetup

public static MycilaTesting newSetup(String pluginDescriptor)
Creates a new TestSetup instance using a specific plugin descriptor to loads plugins. Default plugin descriptor is DEFAULT_PLUGIN_DESCRIPTOR

Parameters:
pluginDescriptor - The plugin descriptort to use. It is a property files containing a list of plugins to load. Default plugin descriptor is DEFAULT_PLUGIN_DESCRIPTOR
Returns:
a TestSetup instance which can be used to prepare a test with plugins

staticCustomSetup

public static MycilaTesting staticCustomSetup()
Get a static custom TestSetup instance with an empty PluginManager. It will be up to you to add your own plugins at runtime

Returns:
a TestSetup instance which can be used to prepare a test with plugins. This instance is registered statically to avoid reloading and recreating plugins each time.

newCustomSetup

public static MycilaTesting newCustomSetup()
Creates a new custom TestSetup with an empty PluginManager. It will be up to you to add your own plugins at runtime

Returns:
a TestSetup instance which can be used to prepare a test with plugins

from

public static MycilaTesting from(Class<?> c)
Get a MycilaTesting instance using the strategy defined for this class potentially annotated by MycilaPlugins.

Parameters:
c - test class
Returns:
a TestSetup instance which can be used to prepare a test with plugins

from

public static MycilaTesting from(MycilaPlugins mycilaPlugins)
Get a MycilaTesting instance using the strategy defined in the provided annotation.

Parameters:
mycilaPlugins - the annotation
Returns:
a TestSetup instance which can be used to prepare a test with plugins

debug

public static void debug()


Copyright © 2008-2011 Mycila. All Rights Reserved.