Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Why ?

The system under development is a bridge between your Fixtures and the system your testing.
If you want to change the way GreenPepper is finding/instanciating your fixtures, or if you need to hook the document execution then you can define a Custom System Under Development.

...

so an example that look likes

rule forSomeFixturewith parameter100$
colorsomeBoolanswer
255,55,10yes14%
235,5,0no21%

Will match a class with the following method

...

Rules of conversion 

From example to fixture

...

Info

Before version 4.0.1, the order was the oposite.

  1. First GreenPepper  will look for a registered TypeConverter that can handles the type.
  2. Second GreenPepper will verify if the type is can self convert (ie public static T parse(String) or public static T ValueOf(string))

...

...

  1. An UnsupportedOperationException will be thrown

From fixture return value to String

...

This could be useful when you are using for example an IOC, like Spring (see Spring Example) or just when you want to add locations (packages in java, namespaces in .Net) for GreenPepper can resolve your fixtures.

To change the system under development :

Only for specifying location to resolve fixtures (packages in java, namespaces in .Net)

 

Code Block
langjava
titleAuto import SUD
collapsetrue
public static class CustomSystemUnderDevelopment extends DefaultSystemUnderDevelopment  {
        public CustomSystemUnderDevelopment( String... params )
        {
           super.addImport("com.mycompany.fixtures");
           super.addImport("com.mycompany.specials.fixtures");
        }
}

By this custom system under development you tell  GreenPepper to look in "com.mycompany.fixtures" and "com.mycompany.specials.fixtures" to resolve fixtures in specfications that your are running.

...