示例#1
0
 public function testAbortTransaction()
 {
     $this->assertTrue($this->Stomp->connect());
     $this->assertTrue($this->simpleStomp->begin('my-id'));
     $this->assertTrue($this->Stomp->send('/queue/test', 'test t-id', ['transaction' => 'my-id']));
     $this->assertTrue($this->simpleStomp->abort('my-id'));
     $this->assertTrue($this->simpleStomp->subscribe('/queue/test', 'mysubid'));
     $this->Stomp->getConnection()->setReadTimeout(0, 500000);
     $frame = $this->Stomp->readFrame();
     $this->assertFalse($frame);
 }
示例#2
0
 /**
  * Tests Stomp->abort()
  */
 public function testAbort()
 {
     $this->stomp->getConnection()->setReadTimeout(0, 750000);
     $this->stomp->connect();
     $this->simpleStomp->begin('tx1');
     $this->assertTrue($this->stomp->send('/queue/abort', 'testSend', ['transaction' => 'tx1']));
     $this->simpleStomp->abort('tx1');
     $this->simpleStomp->subscribe('/queue/abort');
     $frame = $this->stomp->readFrame();
     $this->assertFalse($frame);
     $this->simpleStomp->unsubscribe('/queue/abort');
 }
示例#3
0
 /**
  * Tests Stomp->abort()
  */
 public function testAbort()
 {
     $this->Stomp->getConnection()->setReadTimeout(3);
     if (!$this->Stomp->isConnected()) {
         $this->Stomp->connect();
     }
     $this->simpleStomp->begin("tx1");
     $this->assertTrue($this->Stomp->send($this->queue, 'testSend', ["transaction" => "tx1"]));
     $this->simpleStomp->abort("tx1");
     $this->simpleStomp->subscribe($this->queue, 'mysubid');
     $frame = $this->Stomp->readFrame();
     $this->assertFalse($frame);
     $this->simpleStomp->unsubscribe($this->queue, 'mysubid');
     $this->Stomp->disconnect();
 }
示例#4
0
 public function testGetConnectionReturnsUsedConnection()
 {
     $connection = new Connection('tcp://myhost');
     $stomp = new Client($connection);
     $this->assertSame($connection, $stomp->getConnection(), 'getConnection must return passed connection instance.');
 }