MCPcopy Create free account
hub / github.com/apache/qpid-proton-j / testDisposition

Method testDisposition

tests/python/proton_tests/engine.py:2175–2223  ·  view source on GitHub ↗
(self, count=1, tag="tag%i", type=Delivery.ACCEPTED, value=NoValue())

Source from the content-addressed store, hash-verified

2173 self.cleanup()
2174
2175 def testDisposition(self, count=1, tag="tag%i", type=Delivery.ACCEPTED, value=NoValue()):
2176 snd, rcv = self.link("test-link")
2177 snd.open()
2178 rcv.open()
2179
2180 snd_deliveries = []
2181 for i in range(count):
2182 d = snd.delivery(tag % i)
2183 snd_deliveries.append(d)
2184 snd.advance()
2185
2186 rcv.flow(count)
2187 self.pump()
2188
2189 rcv_deliveries = []
2190 for i in range(count):
2191 d = rcv.current
2192 assert d.tag == (tag % i)
2193 rcv_deliveries.append(d)
2194 rcv.advance()
2195
2196 for d in rcv_deliveries:
2197 value.apply(d.local)
2198 d.update(type)
2199
2200 self.pump()
2201
2202 for d in snd_deliveries:
2203 assert d.remote_state == type
2204 assert d.remote.type == type
2205 value.check(d.remote)
2206 value.apply(d.local)
2207 d.update(type)
2208
2209 self.pump()
2210
2211 for d in rcv_deliveries:
2212 assert d.remote_state == type
2213 assert d.remote.type == type
2214 value.check(d.remote)
2215
2216 for d in snd_deliveries:
2217 d.settle()
2218
2219 self.pump()
2220
2221 for d in rcv_deliveries:
2222 assert d.settled, d.settled
2223 d.settle()
2224
2225 def testReceived(self):
2226 self.testDisposition(type=Disposition.RECEIVED, value=ReceivedValue(1, 2))

Callers 4

testReceivedMethod · 0.95
testRejectedMethod · 0.95
testReleasedMethod · 0.95
testModifiedMethod · 0.95

Calls 12

NoValueClass · 0.85
openMethod · 0.65
deliveryMethod · 0.65
appendMethod · 0.65
advanceMethod · 0.65
flowMethod · 0.65
updateMethod · 0.65
settleMethod · 0.65
linkMethod · 0.45
pumpMethod · 0.45
applyMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected