org.test4j.module.core.utility
类 ModulesManager

java.lang.Object
  继承者 org.test4j.module.core.utility.ModulesManager

public class ModulesManager
extends Object

test4j模块管理器
A class for holding and retrieving modules.


方法摘要
static
<T extends Module>
T
getModuleInstance(Class<T> type)
          返回module实例
Gets the modules that is of the given type or a sub-type.
static List<Module> getModules()
          Gets all modules.
static TestListener getTestListener(Module module)
          Gets the listener corresponding to the given module.
static List<TestListener> getTestListeners_Reverse()
          获得modules的所有测试监听器(顺序和module加载顺序相反)
Gets all listeners sequence.
static List<TestListener> getTestListeners()
          获得modules的所有测试监听器(顺序和module加载顺序一致)
Gets all listeners sequence.
static void initManager(List<Module> modules)
          初始化Modules的管理器
static ModulesManager instance()
           
static boolean isModuleEnabled(Class<? extends Module> moduleClass)
          Checks whether a module of a type exists.
 boolean isModuleEnabled(String fullyQualifiedClassName)
          Checks whether a module of a type with the given class name exists.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

initManager

public static final void initManager(List<Module> modules)
初始化Modules的管理器

参数:
modules -

instance

public static ModulesManager instance()

getModules

public static List<Module> getModules()
Gets all modules.

返回:
the modules, not null

getTestListener

public static TestListener getTestListener(Module module)
Gets the listener corresponding to the given module.

参数:
module - the module, not null
返回:
the listener, null if the module could not be found

getTestListeners

public static List<TestListener> getTestListeners()
获得modules的所有测试监听器(顺序和module加载顺序一致)
Gets all listeners sequence.

返回:
the listeners per module, not null

getTestListeners_Reverse

public static List<TestListener> getTestListeners_Reverse()
获得modules的所有测试监听器(顺序和module加载顺序相反)
Gets all listeners sequence.

返回:
the listeners per module, not null

getModuleInstance

public static <T extends Module> T getModuleInstance(Class<T> type)
返回module实例
Gets the modules that is of the given type or a sub-type.
A Test4JException is thrown when there is not exactly 1 possible match.

类型参数:
T - The module type
参数:
type - the module type, not null
返回:
the module, not null

isModuleEnabled

public boolean isModuleEnabled(String fullyQualifiedClassName)
Checks whether a module of a type with the given class name exists. The class name can also be the super-type of an existing module.

参数:
fullyQualifiedClassName - The class name, not null
返回:
True if the module exists and is enabled

isModuleEnabled

public static boolean isModuleEnabled(Class<? extends Module> moduleClass)
Checks whether a module of a type exists. The class an also be the super-type of an existing module.

参数:
moduleClass - The class, not null
返回:
True if the module exists and is enabled


Copyright © 2013. All rights reserved.