org.junitext.runners.parameters.factory
Interface ParameterFactory

All Known Implementing Classes:
DigesterParameterFactory

public interface ParameterFactory

Interface for creating JavaBean test parameters from an XML File.

Implementors of this interface can be passed as the bean factor to the XMLParameters annotation. Implementors have the complete freedom of defining the XML format that is used. This allows for different XML-->Java object mappers to be used at the discretion of the user.

NOTE: It is possible to receive an invalid or null xml file. It is the responsibility of implementors of the ParameterFactory to decide how to handle not found or missing XML files.


Method Summary
 java.util.List<ParameterSet> createParameters(java.lang.Class<?> testClass, java.io.File xmlFile)
          Creates sets of test parameters from a given XML File.
 

Method Detail

createParameters

java.util.List<ParameterSet> createParameters(java.lang.Class<?> testClass,
                                              java.io.File xmlFile)
                                              throws java.lang.Exception
Creates sets of test parameters from a given XML File. In addition to the XML File File object, the test class is also passed. This allows implementors to use properties of the test class to create the test parameters.

NOTE: It is possible to receive an invalid or null xmlFile. It is the responsibility of implementors of the ParameterFactory to decide how to handle not found or missing XML files.

Parameters:
testClass - the test class
xmlFile - the XML File to parse and generate parameters from
Returns:
a collection of sets of JavaBeans that are used as test parameters
Throws:
java.lang.Exception - if there is a problem parsing the XML file