Package org.testng.internal
Class DefaultListenerFactory
- java.lang.Object
-
- org.testng.internal.DefaultListenerFactory
-
- All Implemented Interfaces:
ITestNGListenerFactory
public final class DefaultListenerFactory extends java.lang.Object implements ITestNGListenerFactory
When noITestNGListenerFactory
implementations are available, TestNG defaults to this implementation for instantiating listeners.
-
-
Field Summary
Fields Modifier and Type Field Description private ITestContext
context
private ITestObjectFactory
m_objectFactory
-
Constructor Summary
Constructors Constructor Description DefaultListenerFactory(ITestObjectFactory objectFactory, ITestContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITestNGListener
createListener(java.lang.Class<? extends ITestNGListener> listenerClass)
Create and return an instance of the listener class passed in parameter.
-
-
-
Field Detail
-
m_objectFactory
private final ITestObjectFactory m_objectFactory
-
context
private final ITestContext context
-
-
Constructor Detail
-
DefaultListenerFactory
public DefaultListenerFactory(ITestObjectFactory objectFactory, ITestContext context)
-
-
Method Detail
-
createListener
public ITestNGListener createListener(java.lang.Class<? extends ITestNGListener> listenerClass)
Description copied from interface:ITestNGListenerFactory
Create and return an instance of the listener class passed in parameter. Return null if you want to use the default factory.- Specified by:
createListener
in interfaceITestNGListenerFactory
- Parameters:
listenerClass
- The class of listener to create- Returns:
- The created listener
-
-