|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StepPatternBuilder
Builds a regex pattern from a template step, as provided in the annotations, which will in turn match real steps conforming to the template. Eg: "I give $money to $name" becomes "I give (.*) to (.*)", which matches "I give £10 to Fred". The captured arguments will be "£10" and "Fred".
To create your own pattern builder, the text in the annotation should be converted to a pattern that matches a real step in the scenario with any precursor words removed. The arguments in the real step should be the only captured groups.
| Method Summary | |
|---|---|
java.util.regex.Pattern |
buildPattern(java.lang.String matchThis)
Builds a regexp pattern from a template step. |
java.lang.String[] |
extractGroupNames(java.lang.String string)
Extract the parameter names from a template step |
| Method Detail |
|---|
java.util.regex.Pattern buildPattern(java.lang.String matchThis)
matchThis - the template step
java.lang.String[] extractGroupNames(java.lang.String string)
step - the template step
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||