Dashboard > GreenPepper Seeds > ... > GreenPepper Intepreters > Collection Interpreters
  GreenPepper Seeds Log In View a printable version of the current page.  
  Collection Interpreters
Added by frochambeau, last edited by Laurent Cobos on Jul 16, 2007  (view change)
Labels: 
(None)

Import
GreenPepper.Interpreters
com.greenpepper.interpreter
Begin Info
End Info

Rules for all the collection interpreters

The following rules applies to all the collection interpreters (list of, set of...)

Retrieving the collection of value from the fixture

A collection interpreters needs a collection of values from the fixture. The interpreters can access these values by different means.

To retrieve these values the interpreter follow the following rules.

Begin Info

1 A method in the class can be annotated or have the attribute CollectionProvider
2 The fixture itself can be an Array or an implementation of a Collection/ICollection
3 The fixture can have a query/Query method

End Info

The CollectionProvider annotation/attributes

ex: .JAVA

   import com.greenpepper.reflect.CollectionProvider;

   @CollectionProvider()
   public Collection employees() 
   {
        return employees;
   }

ex: .NET

   using GreenPepper.Reflect;

   [CollectionProvider]
   public ICollection Employees() 
   {
        return employees;
   }

The fixture is a collection

If the fixture itself is a collection or an array then it will be directly by the interpreter.

The query method

public Collection query(); for java

or

ICollection Query(); in .Net

Rules of resolution

Begin Info

1 First, verifying if there is a CollectionProvider annotation or attribute on the fixture class.
2 If not, verify if the fixture itself is an Array or an implementation of a Collection/ICollection
3 Third, look for a query/Query method
4 throws an exception

End Info
rule for Collection Resolution
fixture query values ?
Fixture with a collection provider annotation collection
Fixture that implements collection collection
Fixture with a query method collection
Fixture without collection error
List of Interpreter (GreenPepper Seeds)
Set of Interpreter (GreenPepper Seeds)

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators