ActivemqTest.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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: AllTests.php 13626 2009-01-14 18:24:57Z matthew $
  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. class Zend_Queue_Adapter_ActivemqTest extends Zend_Queue_Adapter_AdapterTest
  34. {
  35. /**
  36. * getAdapterName() is an method to help make AdapterTest work with any
  37. * new adapters
  38. *
  39. * You must overload this method
  40. *
  41. * @return string
  42. */
  43. public function getAdapterName()
  44. {
  45. return 'Activemq';
  46. }
  47. public function getTestConfig()
  48. {
  49. $driverOptions = array();
  50. if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_HOST')) {
  51. $driverOptions['host'] = TESTS_ZEND_QUEUE_APACHEMQ_HOST;
  52. }
  53. if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_PORT')) {
  54. $driverOptions['port'] = TESTS_ZEND_QUEUE_APACHEMQ_PORT;
  55. }
  56. if (defined('TESTS_ZEND_QUEUE_ACTIVEMQ_SCHEME')) {
  57. $driverOptions['scheme'] = TESTS_ZEND_QUEUE_APACHEMQ_SCHEME;
  58. }
  59. return array('driverOptions' => $driverOptions);
  60. }
  61. /**
  62. * Stomped requires specific name types
  63. */
  64. public function createQueueName($name)
  65. {
  66. return '/temp-queue/' . $name;
  67. }
  68. public function testConst()
  69. {
  70. /**
  71. * @see Zend_Queue_Adapter_Activemq
  72. */
  73. require_once 'Zend/Queue/Adapter/Activemq.php';
  74. $this->assertTrue(is_string(Zend_Queue_Adapter_Activemq::DEFAULT_SCHEME));
  75. $this->assertTrue(is_string(Zend_Queue_Adapter_Activemq::DEFAULT_HOST));
  76. $this->assertTrue(is_integer(Zend_Queue_Adapter_Activemq::DEFAULT_PORT));
  77. }
  78. }