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

Method test_open_close

tests/python/proton_tests/engine.py:332–377  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

330 assert not gc.garbage
331
332 def test_open_close(self):
333 assert self.ssn.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_UNINIT
334
335 self.ssn.open()
336
337 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT
338
339 self.pump()
340
341 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT
342
343 ssn = self.c2.session_head(Endpoint.REMOTE_ACTIVE | Endpoint.LOCAL_UNINIT)
344
345 assert ssn != None
346 assert ssn.state == Endpoint.LOCAL_UNINIT | Endpoint.REMOTE_ACTIVE
347 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT
348
349 ssn.open()
350
351 assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
352 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_UNINIT
353
354 self.pump()
355
356 assert ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
357 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
358
359 ssn.close()
360
361 assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE
362 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
363
364 self.pump()
365
366 assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE
367 assert self.ssn.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_CLOSED
368
369 self.ssn.close()
370
371 assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_ACTIVE
372 assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
373
374 self.pump()
375
376 assert ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
377 assert self.ssn.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
378
379 def test_simultaneous_close(self):
380 self.ssn.open()

Callers

nothing calls this directly

Calls 4

session_headMethod · 0.80
openMethod · 0.65
closeMethod · 0.65
pumpMethod · 0.45

Tested by

no test coverage detected