Tests - operation in Hive - recurrent transfer with {extension}
Test case - The {extension} is used.
Tests 1 - 10 have the same Preconditions and the Two Steps.
Tests 1 - 10
Preconditions:
- {recurrence1}, {recurrence2}, {recurrence3} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {recurrence1} > {recurrence2}, {recurrence1} = 2 * {recurrence2}, {recurrence3}= {recurrence1} (f.e. two days, one day), {recurrence}= {recurrence2}
- Recurrent transfer definition 1 (RTD1): {executions1} = 2 times, {recurrence1}, pair_id =1, {amount1}.
- Recurrent transfer definition 2 (RTD2): {executions2} = 3 times, {recurrence2}, , pair_id =2, {amount2}.
- Recurrent transfer definition 3 (RTD3): {executions3} = 2 times, {recurrence3}, , pair_id =3, {amount3}.
- There is enough funds for all recurrent transfers.
Steps:
Step 1: User A defines a recurrent transfer RTD1 to user B.
Expected results:
- (RTD1) After operation: {from} account balance is reduced by transferred {amount1}.
- (RTD1) After operation: {to} account balance is increased by transferred {amount1}.
- (RTD1) After operation: RC is reduced.
- (RTD1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
Steps:
Step 2: After {recurrence2}: User A defines a recurrent transfer RTD2 and RTD3 to user B.
Expected results:
After operation:
- (RTD2) {from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) RC is reduced.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) RC is reduced.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
Test cases (general):
-
1. User A creates three recurrent transfers in HIVE to user B. -
2. User A creates three recurrent transfers in HBD to user B.
After 2 * {recurrence}:
- (RTD1) After operation: {from} account balance is reduced by transferred {amount1}.
- (RTD1) After operation: {to} account balance is increased by transferred {amount1}.
- (RTD1) After operation: RC is not reduced.
- (RTD1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2){from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) RC is not reduced.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3){from} account balance is not reduced by transferred {amount3}.
- (RTD3) {to} account balance is not increased by transferred {amount3}
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 3 * {recurrence}:
- (RTD1) After operation: {from} account balance is not reduced by transferred {amount1}.
- (RTD1) After operation: {to} account balance is not increased by transferred {amount1}.
- (RTD1) After operation: the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD2){from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3){from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
After 4 * {recurrence}:
- (RTD1) After operation: {from} account balance is not reduced by transferred {amount1}.
- (RTD1) After operation: {to} account balance is not increased by transferred {amount1}.
- (RTD1) After operation: the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD2){from} account balance is not reduced by transferred {amount2}.
- (RTD2) {to} account balance is not increased by transferred {amount2}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD3){from} account balance is not reduced by transferred {amount3}.
- (RTD3) {to} account balance is not increased by transferred {amount3}
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 5 * {recurrence}:
- (RTD3){from} account balance is not reduced by transferred {amount3}.
- (RTD3) {to} account balance is not increased by transferred {amount3}
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
Test cases (remove):
-
3. User A creates three recurrent transfers in HIVE to user B and removes two of them. -
4. User A creates three recurrent transfers in HBD to user B and removes two of them.
Steps:
Step 3: After X: User A updates a recurrent transfer RTD1 and RTD2 to user B - sets amount to 0.
Expected results:
After operation:
- (RTD1) RC is reduced.
- (RTD2) RC is reduced.
- (RTD1), (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 2 * {recurrence}:
- (RTD1), (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 3 * {recurrence}:
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD1), (RTD2) the virtual operation: fill_recurrent_transfer_operation is not generated.
Test cases (update amount):
-
5. User A creates three recurrent transfers in HIVE to user B and updates their amounts. -
6. User A creates three recurrent transfers in HBD to user B and updates their amounts.
Steps:
Step 3: After X: User A updates a recurrent transfer RTD1 and RTD2 to user B - increases {amount1} and decreases {amount2}.
Expected results:
After operation:
- (RTD1) RC is reduced.
- (RTD2) RC is reduced.
- (RTD1), (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 2 * {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) RC is not reduced.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2) {from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) RC is not reduced.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
After 3 * {recurrence}:
- (RTD2) {from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 4 * {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2) {from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
Test cases (update a number of defined transfer):
-
7. User updates a number of defined recurrent transfer in Hive. -
8. User updates a number of defined recurrent transfer in HBD.
Steps:
Step 3: After X: User A updates a recurrent transfer RTD1 and RTD2 to user B - increases {executions1} to 3 times and decreases {executions2} to 2 time.
Expected results:
After operation:
- (RTD1) RC is reduced.
- (RTD2) RC is reduced.
- (RTD1), (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 2 * {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) RC is not reduced.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2) {from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) RC is not reduced.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
After 3 * {recurrence}:
- (RTD2) {from} account balance is reduced by transferred {amount2}.
- (RTD2) {to} account balance is increased by transferred {amount2}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 4 * {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 6 * {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
Test cases (update a frequency):
-
9. User updates a frequency of defined recurrent transfers in Hive. -
10. User updates a frequency of defined recurrent transfers in HBD.
Steps:
Step 3: After X: User A updates a recurrent transfer RTD1 and RTD2 to user B - decreases {recurrence1} to (to f.e. one day) and increases {recurrence2} (to f.e. two days).
Expected results:
After operation:
- (RTD1) RC is reduced.
- (RTD2) RC is reduced.
- (RTD1), (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 2 * {recurrence}:
- (RTD1), (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After X + {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) RC is not reduced.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2), (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After 3 * {recurrence}:
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD1), (RTD2) the virtual operation: fill_recurrent_transfer_operation is not generated.
After X + 2 * {recurrence}:
- (RTD1) {from} account balance is reduced by transferred {amount1}.
- (RTD1) {to} account balance is increased by transferred {amount1}.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD2) {from} account balance is reduced by transferred {amount1}.
- (RTD2) {to} account balance is increased by transferred {amount1}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After X + 4 * {recurrence}:
- (RTD2) {from} account balance is reduced by transferred {amount1}.
- (RTD2) {to} account balance is increased by transferred {amount1}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
After X + 6 * {recurrence}:
- (RTD2) {from} account balance is reduced by transferred {amount1}.
- (RTD2) {to} account balance is increased by transferred {amount1}.
- (RTD2) the virtual operation: fill_recurrent_transfer_operation is generated.
- (RTD1) the virtual operation: fill_recurrent_transfer_operation is not generated.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is not generated.
Test cases (lack of funds):
-
11. User A creates three recurrent transfers in HIVE, but there is not enough funds for one to be started and for second to be executed second time. -
12. User A creates three recurrent transfers in HBD, but there is not enough funds for one to be started and for second to be executed second time.
Preconditions (test 5 and 6):
- {recurrence1}, {recurrence2}, {recurrence3} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {recurrence1} > {recurrence2}, {recurrence1} = 2 * {recurrence2}, {recurrence3}= {recurrence1} (f.e. two days, one day)
- Recurrent transfer definition 1 (RTD1): {executions1} = 2 times, {recurrence1}, pair_id =1, {amount1}= 1000 Hive/HBD.
- Recurrent transfer definition 2 (RTD2): {executions2} = 2 times, {recurrence2}, pair_id =2, {amount2} = 100 Hive/HBD.
- Recurrent transfer definition 3 (RTD3): {executions3} = 2 times, {recurrence3}, pair_id =2, {amount3} = 10 Hive/HBD.
- The balanse is 1020 Hive/HBD.
Steps:
Step 1: User A defines a recurrent transfer RTD1 to user B.
Expected results:
- (RTD1) After operation: {from} account balance is reduced by transferred {amount1}.
- (RTD1) After operation: {to} account balance is increased by transferred {amount1}.
- (RTD1) After operation: RC is reduced.
- (RTD1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
Steps:
Step 2: After {recurrence}: User A defines a recurrent transfer RTD2 and RTD3 to user B.
Expected results:
After operation:
- (RTD2) The error occurs - the operation is not executed because of the lack of funds.
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) RC is reduced.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
After 2 * {recurrence}:
- (RTD1) The operation is not executed because of the lack of funds.
- (RTD1) The virtual operation: failed_recurrent_transfer_operation is generated.
After 3 * {recurrence}:
- (RTD3) {from} account balance is reduced by transferred {amount3}.
- (RTD3) {to} account balance is increased by transferred {amount3}.
- (RTD3) the virtual operation: fill_recurrent_transfer_operation is generated.
Edited by Aleksandra Grabowska