25
25
26
26
27
27
#@chaincodeImagesUpToDate
28
- Feature : SimpleSample Java example
28
+ Feature : Java chaincode example
29
29
30
30
Scenario : java SimpleSample chaincode example single peer
31
31
Given we compose "docker-compose-1.yml"
32
32
When requesting "/chain" from "vp0"
33
33
Then I should get a JSON response with "height" = "1"
34
- When I deploy lang chaincode "examples/chaincode/java/SimpleSample" of "JAVA" with ctor "init" to "vp0"
35
- | arg1 | arg2 | arg3 | arg4 |
36
- | a | 100 | b | 200 |
37
- Then I should have received a chaincode name
38
- Then I wait up to "300" seconds for transaction to be committed to all peers
34
+ When I deploy lang chaincode "examples/chaincode/java/SimpleSample" of "JAVA" with ctor "init" to "vp0"
35
+ | arg1 | arg2 | arg3 | arg4 |
36
+ | a | 100 | b | 200 |
37
+ Then I should have received a chaincode name
38
+ Then I wait up to "300" seconds for transaction to be committed to all peers
39
39
40
- When requesting "/chain" from "vp0"
41
- Then I should get a JSON response with "height" = "2"
40
+ When requesting "/chain" from "vp0"
41
+ Then I should get a JSON response with "height" = "2"
42
42
43
43
When I query chaincode "SimpleSample" function name "query" on "vp0" :
44
44
|arg1 |
45
45
| a |
46
- Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}"
46
+ Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}"
47
47
48
48
When I invoke chaincode "SimpleSample" function name "transfer" on "vp0"
49
- |arg1 |arg2 |arg3 |
50
- | a | b | 10 |
51
- Then I should have received a transactionID
52
- Then I wait up to "25" seconds for transaction to be committed to all peers
49
+ |arg1 |arg2 |arg3 |
50
+ | a | b | 10 |
51
+ Then I should have received a transactionID
52
+ Then I wait up to "25" seconds for transaction to be committed to all peers
53
53
54
- When requesting "/chain" from "vp0"
55
- Then I should get a JSON response with "height" = "3"
54
+ When requesting "/chain" from "vp0"
55
+ Then I should get a JSON response with "height" = "3"
56
56
57
57
When I query chaincode "SimpleSample" function name "query" on "vp0" :
58
58
|arg1 |
59
59
| a |
60
- Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}"
60
+ Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}"
61
61
62
62
When I query chaincode "SimpleSample" function name "query" on "vp0" :
63
63
|arg1 |
64
64
| b |
65
- Then I should get a JSON response with "result.message" = "{'Name':'b','Amount':'210'}"
65
+ Then I should get a JSON response with "result.message" = "{'Name':'b','Amount':'210'}"
66
66
67
67
Scenario : java RangeExample chaincode single peer
68
68
Given we compose "docker-compose-1.yml"
@@ -116,4 +116,60 @@ Scenario: java RangeExample chaincode single peer
116
116
When I query chaincode "RangeExample" function name "keys" on "vp0" :
117
117
||
118
118
||
119
- Then I should get a JSON response with "result.message" = "[a]"
119
+ Then I should get a JSON response with "result.message" = "[a]"
120
+
121
+ Scenario : Java TableExample chaincode single peer
122
+ Given we compose "docker-compose-1.yml"
123
+ When requesting "/chain" from "vp0"
124
+ Then I should get a JSON response with "height" = "1"
125
+ When I deploy lang chaincode "examples/chaincode/java/TableExample" of "JAVA" with ctor "init" to "vp0"
126
+ ||
127
+ ||
128
+ Then I should have received a chaincode name
129
+ Then I wait up to "30" seconds for transaction to be committed to all peers
130
+
131
+ When requesting "/chain" from "vp0"
132
+ Then I should get a JSON response with "height" = "2"
133
+ When I invoke chaincode "TableExample" function name "insert" on "vp0"
134
+ |arg1 |arg2 |
135
+ | 0 | Alice |
136
+ Then I should have received a transactionID
137
+ Then I wait up to "25" seconds for transaction to be committed to all peers
138
+ When I invoke chaincode "TableExample" function name "insert" on "vp0"
139
+ |arg1 |arg2 |
140
+ | 1 | Bob |
141
+ Then I should have received a transactionID
142
+ Then I wait up to "25" seconds for transaction to be committed to all peers
143
+ When I invoke chaincode "TableExample" function name "insert" on "vp0"
144
+ |arg1 |arg2 |
145
+ | 2 | Charlie |
146
+ Then I should have received a transactionID
147
+ Then I wait up to "25" seconds for transaction to be committed to all peers
148
+
149
+ When I query chaincode "TableExample" function name "get" on "vp0" :
150
+ |arg1 |
151
+ | 0 |
152
+ Then I should get a JSON response with "result.message" = "Alice"
153
+
154
+ When I query chaincode "TableExample" function name "get" on "vp0" :
155
+ |arg1 |
156
+ | 2 |
157
+ Then I should get a JSON response with "result.message" = "Charlie"
158
+ When I invoke chaincode "TableExample" function name "update" on "vp0"
159
+ |arg1 |arg2 |
160
+ | 2 | Chaitra |
161
+ Then I should have received a transactionID
162
+ Then I wait up to "25" seconds for transaction to be committed to all peers
163
+ When I query chaincode "TableExample" function name "get" on "vp0" :
164
+ |arg1 |
165
+ | 2 |
166
+ Then I should get a JSON response with "result.message" = "Chaitra"
167
+ When I invoke chaincode "TableExample" function name "delete" on "vp0"
168
+ |arg1 |
169
+ | 2 |
170
+ Then I should have received a transactionID
171
+ Then I wait up to "25" seconds for transaction to be committed to all peers
172
+ When I query chaincode "TableExample" function name "get" on "vp0" :
173
+ |arg1 |
174
+ | 2 |
175
+ Then I should get a JSON response with "result.message" = "No record found !"
0 commit comments