org.ops4j.pax.exam.junit.internal
Class AppliesToConfigMethod

java.lang.Object
  extended by org.ops4j.pax.exam.junit.internal.AppliesToConfigMethod
All Implemented Interfaces:
JUnit4ConfigMethod

public class AppliesToConfigMethod
extends java.lang.Object
implements JUnit4ConfigMethod

Configuration method marked with Configuration and AppliesTo annotations.

Since:
0.3.0, December 16, 2008
Author:
Alin Dreghiciu (adreghiciu@gmail.com), Toni Menzel (toni@okidokiteam.com)

Constructor Summary
AppliesToConfigMethod(java.lang.reflect.Method configMethod, java.lang.Object configInstance)
          Constructor.
 
Method Summary
 Option[] getOptions()
          Returns the configuration options for this configuration method.
 boolean matches(java.lang.reflect.Method method)
          Matches a test method name against this configuration method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppliesToConfigMethod

public AppliesToConfigMethod(java.lang.reflect.Method configMethod,
                             java.lang.Object configInstance)
Constructor.

Parameters:
configMethod - configuration method (cannot be null)
configInstance - instance of the class containing the test method. If null then the method is supposed to be static.
Throws:
java.lang.IllegalArgumentException - - If method is null
Method Detail

matches

public boolean matches(java.lang.reflect.Method method)
Matches a test method name against this configuration method.

Specified by:
matches in interface JUnit4ConfigMethod
Parameters:
method - test method name (cannot be null or empty)
Returns:
true if the test method name matches the configuration method, false otherwise
Throws:
java.lang.IllegalArgumentException - - If method name is null or empty

getOptions

public Option[] getOptions()
                    throws java.lang.IllegalAccessException,
                           java.lang.reflect.InvocationTargetException,
                           java.lang.InstantiationException
Returns the configuration options for this configuration method.

Specified by:
getOptions in interface JUnit4ConfigMethod
Returns:
array of configuration options
Throws:
java.lang.IllegalAccessException - - Re-thrown, from invoking the configuration method via reflection
java.lang.reflect.InvocationTargetException - - Re-thrown, from invoking the configuration method via reflection
java.lang.InstantiationException - - Re-thrown, from invoking the configuration method via reflection


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.