github.com/adnan-c/fabric_e2e_couchdb@v0.6.1-preview.0.20170228180935-21ce6b23cf91/bddtests/java_shim.feature (about) 1 # Test Hyperledger Peers 2 # 3 # Tags that can be used and will affect test internals: 4 # 5 # @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario. 6 # 7 # @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!! 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 27 #@chaincodeImagesUpToDate 28 @preV1 29 Feature: Java chaincode example 30 Scenario: java SimpleSample chaincode example single peer 31 Given we compose "docker-compose-1.yml" 32 When requesting "/chain" from "vp0" 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 39 40 When requesting "/chain" from "vp0" 41 Then I should get a JSON response with "height" = "2" 42 43 When I query chaincode "SimpleSample" function name "query" on "vp0": 44 |arg1| 45 | a | 46 Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}" 47 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 53 54 When requesting "/chain" from "vp0" 55 Then I should get a JSON response with "height" = "3" 56 57 When I query chaincode "SimpleSample" function name "query" on "vp0": 58 |arg1| 59 | a | 60 Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}" 61 62 When I query chaincode "SimpleSample" function name "query" on "vp0": 63 |arg1| 64 | b | 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]" 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 "240" 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 !" 176 Scenario: Java chaincode example from remote git repository 177 Given we compose "docker-compose-1.yml" 178 When requesting "/chain" from "vp0" 179 Then I should get a JSON response with "height" = "1" 180 # TODO Needs to be replaced with an official test repo in the future. 181 When I deploy lang chaincode "http://github.com/hyperledger/fabric-test-resources/javachaincodemvn" of "JAVA" with ctor "init" to "vp0" 182 | arg1 | arg2 | arg3 | arg4 | 183 | a | 100 | b | 200 | 184 Then I should have received a chaincode name 185 Then I wait up to "300" seconds for transaction to be committed to all peers 186 187 When requesting "/chain" from "vp0" 188 Then I should get a JSON response with "height" = "2" 189 190 When I query chaincode "SimpleSample" function name "query" on "vp0": 191 |arg1| 192 | a | 193 Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'100'}" 194 195 When I invoke chaincode "SimpleSample" function name "transfer" on "vp0" 196 |arg1|arg2|arg3| 197 | a | b | 10 | 198 Then I should have received a transactionID 199 Then I wait up to "25" seconds for transaction to be committed to all peers 200 201 When requesting "/chain" from "vp0" 202 Then I should get a JSON response with "height" = "3" 203 204 When I query chaincode "SimpleSample" function name "query" on "vp0": 205 |arg1| 206 | a | 207 Then I should get a JSON response with "result.message" = "{'Name':'a','Amount':'90'}" 208 209 When I query chaincode "SimpleSample" function name "query" on "vp0": 210 |arg1| 211 | b | 212 Then I should get a JSON response with "result.message" = "{'Name':'b','Amount':'210'}"