org.apache.activemq.apollo.util
Class Combinator

java.lang.Object
  extended by org.apache.activemq.apollo.util.Combinator

public class Combinator
extends java.lang.Object

Combinator objects are used to compute all the possible combinations given a set of combination options. This class is generally use in conjunction with TestNG test cases generate the @Factory and @DataProvider results.

Author:
Hiram Chirino

Nested Class Summary
static interface Combinator.BeanFactory<T>
           
static interface Combinator.CombinationAware
           
 
Constructor Summary
Combinator()
           
Combinator(Combinator parent)
           
 
Method Summary
 Combinator add(java.lang.Object... options)
           
 java.util.ArrayList<Combinator> all()
           
 Combinator and()
           
<T> T[]
asBeans(Combinator.BeanFactory<T> factory)
          Creates a bean for each combination of the type specified by clazz argument and uses setter/field injection to initialize the Bean with the combination values.
 java.util.Set<java.util.Map<java.lang.String,java.lang.Object>> combinations()
           
<T> java.lang.Object[]
combinationsAsBeans(java.lang.Class<T> clazz)
          Creates a bean for each combination of the type specified by clazz arguement and uses setter/field injection to initialize the Bean with the combination values.
<T> java.lang.Object[][]
combinationsAsParameterArgBeans(java.lang.Class<T> clazz)
           
<T> java.lang.Object[][]
combinationsAsParameterArgBeans(Combinator.BeanFactory<T> factory)
           
 java.lang.Object[][] combinationsAsParameterArgs()
           
static Combinator combinator()
           
 Combinator put(java.lang.String attribute, java.lang.Object... options)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combinator

public Combinator()

Combinator

public Combinator(Combinator parent)
Method Detail

combinator

public static Combinator combinator()

all

public java.util.ArrayList<Combinator> all()

put

public Combinator put(java.lang.String attribute,
                      java.lang.Object... options)

and

public Combinator and()

add

public Combinator add(java.lang.Object... options)

combinations

public java.util.Set<java.util.Map<java.lang.String,java.lang.Object>> combinations()

combinationsAsBeans

public <T> java.lang.Object[] combinationsAsBeans(java.lang.Class<T> clazz)
                                       throws java.lang.Exception
Creates a bean for each combination of the type specified by clazz arguement and uses setter/field injection to initialize the Bean with the combination values.

Type Parameters:
T -
Parameters:
clazz -
Returns:
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.Exception

combinationsAsParameterArgBeans

public <T> java.lang.Object[][] combinationsAsParameterArgBeans(java.lang.Class<T> clazz)
                                                     throws java.lang.Exception
Throws:
java.lang.Exception

asBeans

public <T> T[] asBeans(Combinator.BeanFactory<T> factory)
            throws java.lang.Exception
Creates a bean for each combination of the type specified by clazz argument and uses setter/field injection to initialize the Bean with the combination values.

Parameters:
clazz -
Returns:
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.Exception

combinationsAsParameterArgBeans

public <T> java.lang.Object[][] combinationsAsParameterArgBeans(Combinator.BeanFactory<T> factory)
                                                     throws java.lang.Exception
Throws:
java.lang.Exception

combinationsAsParameterArgs

public java.lang.Object[][] combinationsAsParameterArgs()


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.