TestPlan Default and optional function parameters
Document

Default and optional function parameters

by Group Public on Tuesday April 14 2009 @ 14:36:23 (1/1 Points)

API ↪Reference ✑ Reply ✓ Stick It ✗ Ditch It ⚐ Tag It

Many functions in the API, at the dotTest level, have optional parameters. These may be explicitly marked as optional, or noted to have a default in the Java source code.

Optional Arguments

It is important to note that if you do not specify an optional argument there is no guarantee that you will always get the same value. The code is free to find the most logical value for that optional argument based on system settings or other parameters.

This can often happen with encoding, or character set parameters. Many of these use utf-8 as a default value, for example in SendEmail. If however you need to guarantee that you send utf-8 emails, then you must specify this parameter.

The reason for this requirement, on all functions, not just this one, is to allow the backend a great deal of flexibility. For example, in this case the backend may decide your text can be encoded easily in some other smaller character set.

Marking

For clarity documentation will attempt to mark optional arguments as optional, whereas defaults will be noted as a default.

A default is thus one that will have a guarantee of value if not specified. Other than an empty-set, or empty-string case, true defaults will be used sparingly.

© 2008-2010 edA-qa mort-ora-y
Using Persephone and TestPlan
Tag: