6
6
#
7
7
# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!!
8
8
9
+ #
10
+ #Copyright DTCC 2016 All Rights Reserved.
11
+ #
12
+ #Licensed under the Apache License, Version 2.0 (the "License");
13
+ #you may not use this file except in compliance with the License.
14
+ #You may obtain a copy of the License at
15
+ #
16
+ # http://www.apache.org/licenses/LICENSE-2.0
17
+ #
18
+ #Unless required by applicable law or agreed to in writing, software
19
+ #distributed under the License is distributed on an "AS IS" BASIS,
20
+ #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ #See the License for the specific language governing permissions and
22
+ #limitations under the License.
23
+ #
24
+ #
25
+
26
+
9
27
#@chaincodeImagesUpToDate
10
28
Feature : SimpleSample Java example
11
29
12
- #@doNotDecompose
13
- # @wip
14
30
Scenario : java SimpleSample chaincode example single peer
15
31
Given we compose "docker-compose-1.yml"
16
32
When requesting "/chain" from "vp0"
17
33
Then I should get a JSON response with "height" = "1"
18
- When I deploy lang chaincode "core /chaincode/shim/ java" of "JAVA" with ctor "init" to "vp0"
34
+ When I deploy lang chaincode "examples /chaincode/java/SimpleSample " of "JAVA" with ctor "init" to "vp0"
19
35
| arg1 | arg2 | arg3 | arg4 |
20
36
| a | 100 | b | 200 |
21
37
Then I should have received a chaincode name
@@ -24,12 +40,12 @@ Feature: SimpleSample Java example
24
40
When requesting "/chain" from "vp0"
25
41
Then I should get a JSON response with "height" = "2"
26
42
27
- When I query chaincode "example2 " function name "query" on "vp0" :
43
+ When I query chaincode "SimpleSample " function name "query" on "vp0" :
28
44
|arg1 |
29
45
| a |
30
46
Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}"
31
47
32
- When I invoke chaincode "example2 " function name "transfer" on "vp0"
48
+ When I invoke chaincode "SimpleSample " function name "transfer" on "vp0"
33
49
|arg1 |arg2 |arg3 |
34
50
| a | b | 10 |
35
51
Then I should have received a transactionID
@@ -38,12 +54,66 @@ Feature: SimpleSample Java example
38
54
When requesting "/chain" from "vp0"
39
55
Then I should get a JSON response with "height" = "3"
40
56
41
- When I query chaincode "example2 " function name "query" on "vp0" :
57
+ When I query chaincode "SimpleSample " function name "query" on "vp0" :
42
58
|arg1 |
43
59
| a |
44
60
Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}"
45
61
46
- When I query chaincode "example2 " function name "query" on "vp0" :
62
+ When I query chaincode "SimpleSample " function name "query" on "vp0" :
47
63
|arg1 |
48
64
| b |
49
65
Then I should get a JSON response with "result.message" = "{'Name':'b','Amount':'210'}"
66
+
67
+ Scenario : java RangeExample chaincode single peer
68
+ Given we compose "docker-compose-1.yml"
69
+ When requesting "/chain" from "vp0"
70
+ Then I should get a JSON response with "height" = "1"
71
+ When I deploy lang chaincode "examples/chaincode/java/RangeExample" of "JAVA" with ctor "init" to "vp0"
72
+ ||
73
+ ||
74
+ Then I should have received a chaincode name
75
+ Then I wait up to "300" seconds for transaction to be committed to all peers
76
+
77
+ When requesting "/chain" from "vp0"
78
+ Then I should get a JSON response with "height" = "2"
79
+
80
+ When I invoke chaincode "RangeExample" function name "put" on "vp0"
81
+ |arg1 |arg2 |
82
+ | a | alice |
83
+ Then I should have received a transactionID
84
+ Then I wait up to "25" seconds for transaction to be committed to all peers
85
+
86
+ When requesting "/chain" from "vp0"
87
+ Then I should get a JSON response with "height" = "3"
88
+
89
+ When I invoke chaincode "RangeExample" function name "put" on "vp0"
90
+ |arg1 |arg2 |
91
+ | b | bob |
92
+ Then I should have received a transactionID
93
+ Then I wait up to "25" seconds for transaction to be committed to all peers
94
+
95
+
96
+ When I query chaincode "RangeExample" function name "get" on "vp0" :
97
+ |arg1 |
98
+ | a |
99
+ Then I should get a JSON response with "result.message" = "alice"
100
+
101
+ When I query chaincode "RangeExample" function name "get" on "vp0" :
102
+ |arg1 |
103
+ | b |
104
+ Then I should get a JSON response with "result.message" = "bob"
105
+
106
+
107
+ When I query chaincode "RangeExample" function name "keys" on "vp0" :
108
+ ||
109
+ ||
110
+ Then I should get a JSON response with "result.message" = "[a, b]"
111
+ When I invoke chaincode "RangeExample" function name "del" on "vp0"
112
+ |arg1 |
113
+ | b |
114
+ Then I should have received a transactionID
115
+ Then I wait up to "25" seconds for transaction to be committed to all peers
116
+ When I query chaincode "RangeExample" function name "keys" on "vp0" :
117
+ ||
118
+ ||
119
+ Then I should get a JSON response with "result.message" = "[a]"
0 commit comments