org.easetech.easytest.internal
Class EasyAssignments

java.lang.Object
  extended by org.easetech.easytest.internal.EasyAssignments

public class EasyAssignments
extends Object

A internal util class for working with the parameters of a test method. This class provides EasyTest the facility to identify the method arguments, identify the DataSupplier associated with the Test Framework and more.

Author:
Anuj Kumar

Constructor Summary
EasyAssignments(List<org.junit.experimental.theories.PotentialAssignment> assigned, List<EasyParamSignature> unassigned, org.junit.runners.model.TestClass testClass)
          Construct a new EasyAssignments
 
Method Summary
static EasyAssignments allUnassigned(Method testMethod, org.junit.runners.model.TestClass testClass)
          Returns a new assignment list for testMethod, with no params assigned.
 EasyAssignments assignNext(org.junit.experimental.theories.PotentialAssignment source)
           
 Object[] getActualValues(int start, int stop, boolean nullsOk)
           
 Object[] getAllArguments(boolean nullsOk)
           
 Object[] getArgumentStrings(boolean nullsOk)
           
 Object[] getConstructorArguments(boolean nullsOk)
           
 Object[] getMethodArguments(boolean nullsOk)
           
 Param.DataSupplier getSupplier(EasyParamSignature unassigned)
          Get the instance of class that provides the functionality to provide Data.
 boolean isComplete()
           
 EasyParamSignature nextUnassigned()
           
 List<org.junit.experimental.theories.PotentialAssignment> potentialsForNextUnassigned()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EasyAssignments

public EasyAssignments(List<org.junit.experimental.theories.PotentialAssignment> assigned,
                       List<EasyParamSignature> unassigned,
                       org.junit.runners.model.TestClass testClass)
Construct a new EasyAssignments

Parameters:
assigned -
unassigned -
testClass -
Method Detail

allUnassigned

public static EasyAssignments allUnassigned(Method testMethod,
                                            org.junit.runners.model.TestClass testClass)
                                     throws Exception
Returns a new assignment list for testMethod, with no params assigned.

Parameters:
testMethod -
testClass -
Returns:
EasyAssignments
Throws:
Exception

isComplete

public boolean isComplete()

nextUnassigned

public EasyParamSignature nextUnassigned()

assignNext

public EasyAssignments assignNext(org.junit.experimental.theories.PotentialAssignment source)

getActualValues

public Object[] getActualValues(int start,
                                int stop,
                                boolean nullsOk)
                         throws org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException
Throws:
org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException

potentialsForNextUnassigned

public List<org.junit.experimental.theories.PotentialAssignment> potentialsForNextUnassigned()
                                                                                      throws InstantiationException,
                                                                                             IllegalAccessException
Throws:
InstantiationException
IllegalAccessException

getSupplier

public Param.DataSupplier getSupplier(EasyParamSignature unassigned)
                               throws InstantiationException,
                                      IllegalAccessException
Get the instance of class that provides the functionality to provide Data. In our case, its always Param.DataSupplier

Parameters:
unassigned -
Returns:
Param.DataSupplier
Throws:
InstantiationException
IllegalAccessException

getConstructorArguments

public Object[] getConstructorArguments(boolean nullsOk)
                                 throws org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException
Throws:
org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException

getMethodArguments

public Object[] getMethodArguments(boolean nullsOk)
                            throws org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException
Throws:
org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException

getAllArguments

public Object[] getAllArguments(boolean nullsOk)
                         throws org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException
Throws:
org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException

getArgumentStrings

public Object[] getArgumentStrings(boolean nullsOk)
                            throws org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException
Throws:
org.junit.experimental.theories.PotentialAssignment.CouldNotGenerateValueException


Copyright © 2013. All Rights Reserved.