26
26
27
27
#@chaincodeImagesUpToDate
28
28
@preV1
29
- Feature : SimpleSample Java example
30
-
29
+ Feature : Java chaincode example
31
30
Scenario : java SimpleSample chaincode example single peer
32
31
Given we compose "docker-compose-1.yml"
33
32
When requesting "/chain" from "vp0"
34
33
Then I should get a JSON response with "height" = "1"
35
- When I deploy lang chaincode "examples/chaincode/java/SimpleSample" of "JAVA" with ctor "init" to "vp0"
36
- | arg1 | arg2 | arg3 | arg4 |
37
- | a | 100 | b | 200 |
38
- Then I should have received a chaincode name
39
- 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
40
39
41
- When requesting "/chain" from "vp0"
42
- 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"
43
42
44
43
When I query chaincode "SimpleSample" function name "query" on "vp0" :
45
44
|arg1 |
46
45
| a |
47
- 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'}"
48
47
49
48
When I invoke chaincode "SimpleSample" function name "transfer" on "vp0"
50
- |arg1 |arg2 |arg3 |
51
- | a | b | 10 |
52
- Then I should have received a transactionID
53
- 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
54
53
55
- When requesting "/chain" from "vp0"
56
- 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"
57
56
58
57
When I query chaincode "SimpleSample" function name "query" on "vp0" :
59
58
|arg1 |
60
59
| a |
61
- 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'}"
62
61
63
62
When I query chaincode "SimpleSample" function name "query" on "vp0" :
64
63
|arg1 |
65
64
| b |
66
- 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'}"
67
66
68
67
Scenario : java RangeExample chaincode single peer
69
68
Given we compose "docker-compose-1.yml"
@@ -117,4 +116,60 @@ Scenario: java RangeExample chaincode single peer
117
116
When I query chaincode "RangeExample" function name "keys" on "vp0" :
118
117
||
119
118
||
120
- 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