先从最简单的Choice数据模型开始看peach下的Choice到底是怎么执行的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<DataModel name="ChoiceSample"> <Choice name="Choice1" > <Block name="Type1"> <String value="[String in Type1]" /> </Block> <Block name="Type2"> <String value="[String in Type2]" /> </Block> <Block name="Type3"> <String value="[String in Type3]" /> </Block> <Block name="Type4"> <String value="[String in Type4]" /> </Block> <Block name="Type5"> <String value="[String in Type5]" /> </Block> </Choice> </DataModel> |
1 2 3 4 5 6 7 8 9 |
<StateModel name="State" initialState="State1" > <State name="State1" > <Action type="output" > <DataModel ref="ChoiceSample" /> </Action> </State> </StateModel> |
默认的情况下,直接引用Choice类型,peach运行总是选择Choice模块中第一个出现的数据,这里是Type1:
1 2 3 4 5 6 7 8 9 10 11 |
[*] Test 'Default' starting with random seed 37190. [R1,-,-] Performing iteration [String in Type1] [1,2,0:00:00.078] Performing iteration [String in Type1] [2,2,0:00:00.041] Performing iteration [String in Type1] [*] Test 'Default' finished. |
[…]