2
0

ActivemqTest.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Queue
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /*
  23. * The adapter test class provides a universal test class for all of the
  24. * abstract methods.
  25. *
  26. * All methods marked not supported are explictly checked for for throwing
  27. * an exception.
  28. */
  29. /** PHPUnit Test Case */
  30. require_once 'PHPUnit/Framework/TestCase.php';
  31. /** TestHelp.php */
  32. require_once dirname(__FILE__) . '/../../../TestHelper.php';
  33. require_once 'Zend/Queue/Adapter/AdapterTest.php';
  34. /**
  35. * @category Zend
  36. * @package Zend_Queue
  37. * @subpackage UnitTests
  38. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  39. * @license http://framework.zend.com/license/new-bsd New BSD License
  40. * @group Zend_Queue
  41. */
  42. class Zend_Queue_Adapter_ActivemqTest extends Zend_Queue_Adapter_AdapterTest
  43. {
  44. /**
  45. * getAdapterName() is an method to help make AdapterTest work with any
  46. * new adapters
  47. *
  48. * You must overload this method
  49. *
  50. * @return string
  51. */
  52. public function getAdapterName()
  53. {
  54. return 'Activemq';
  55. }
  56. public function getTestConfig()
  57. {
  58. $driverOptions = array();
  59. if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_HOST')) {
  60. $driverOptions['host'] = TESTS_ZEND_QUEUE_APACHEMQ_HOST;
  61. }
  62. if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_PORT')) {
  63. $driverOptions['port'] = TESTS_ZEND_QUEUE_APACHEMQ_PORT;
  64. }
  65. if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_SCHEME')) {
  66. $driverOptions['scheme'] = TESTS_ZEND_QUEUE_APACHEMQ_SCHEME;
  67. }
  68. return array('driverOptions' => $driverOptions);
  69. }
  70. /**
  71. * Stomped requires specific name types
  72. */
  73. public function createQueueName($name)
  74. {
  75. return '/temp-queue/' . $name;
  76. }
  77. public function testConst()
  78. {
  79. /**
  80. * @see Zend_Queue_Adapter_Activemq
  81. */
  82. require_once 'Zend/Queue/Adapter/Activemq.php';
  83. $this->assertTrue(is_string(Zend_Queue_Adapter_Activemq::DEFAULT_SCHEME));
  84. $this->assertTrue(is_string(Zend_Queue_Adapter_Activemq::DEFAULT_HOST));
  85. $this->assertTrue(is_integer(Zend_Queue_Adapter_Activemq::DEFAULT_PORT));
  86. }
  87. }