From 76a3ef86c15e6ca7f2e25851127465fa89a70d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Fri, 19 Jul 2013 11:32:36 +0200 Subject: [PATCH] Fix QueryAdapter and SlidingWithBorderTest, remove --strict QueryAdapter and SlidingWithBorder used the statusdat backend and must therefore be modified. The --strict parameter stores controller tests because of the 1s timeout and offers now advantages for us at this time. refs #4417 --- .../Paginator/Adapter/QueryAdapterTest.php | 37 ++++++++++--------- .../ScrollingStyle/SlidingWithBorderTest.php | 33 ++++++++--------- test/php/runtests | 2 +- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/test/php/library/Icinga/Web/Paginator/Adapter/QueryAdapterTest.php b/test/php/library/Icinga/Web/Paginator/Adapter/QueryAdapterTest.php index 06ed34b13..5fb173b5b 100644 --- a/test/php/library/Icinga/Web/Paginator/Adapter/QueryAdapterTest.php +++ b/test/php/library/Icinga/Web/Paginator/Adapter/QueryAdapterTest.php @@ -2,29 +2,30 @@ namespace Tests\Icinga\Web\Paginator\Adapter; -use Icinga\Backend\Statusdat; +use Monitoring\Backend\Statusdat; use Icinga\Protocol\Statusdat\Reader; use Icinga\Web\Paginator\Adapter\QueryAdapter; +use Tests\Icinga\Protocol\Statusdat\StatusdatTestLoader; require_once 'Zend/Paginator/Adapter/Interface.php'; -require_once 'Zend/Config.php'; -require_once 'Zend/Cache.php'; require_once '../../library/Icinga/Web/Paginator/Adapter/QueryAdapter.php'; -require_once '../../library/Icinga/Backend/Criteria/Order.php'; -require_once '../../library/Icinga/Backend/AbstractBackend.php'; -require_once '../../library/Icinga/Backend/Query.php'; -require_once '../../library/Icinga/Backend/Statusdat/Query.php'; -require_once '../../library/Icinga/Backend/Statusdat.php'; -require_once '../../library/Icinga/Backend/MonitoringObjectList.php'; -require_once '../../library/Icinga/Backend/Statusdat/HostlistQuery.php'; -require_once '../../library/Icinga/Backend/DataView/AbstractAccessorStrategy.php'; -require_once '../../library/Icinga/Backend/DataView/ObjectRemappingView.php'; -require_once '../../library/Icinga/Backend/Statusdat/DataView/StatusdatHostView.php'; + +require_once 'library/Icinga/Protocol/Statusdat/StatusdatTestLoader.php'; +StatusdatTestLoader::requireLibrary(); + +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Criteria/Order.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/AbstractBackend.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/Query.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/DataView/StatusdatHostView.php'; +require_once '../../modules/monitoring/library/Monitoring/View/MonitoringView.php'; +require_once '../../modules/monitoring/library/Monitoring/View/StatusView.php'; + require_once '../../library/Icinga/Protocol/AbstractQuery.php'; -require_once '../../library/Icinga/Protocol/Statusdat/IReader.php'; -require_once '../../library/Icinga/Protocol/Statusdat/Reader.php'; -require_once '../../library/Icinga/Protocol/Statusdat/Query.php'; + + class QueryAdapterTest extends \PHPUnit_Framework_TestCase { @@ -54,7 +55,7 @@ class QueryAdapterTest extends \PHPUnit_Framework_TestCase public function testLimit1() { $backend = new Statusdat($this->config); - $query = $backend->select()->from('hostlist'); + $query = $backend->select()->from('status'); $adapter = new QueryAdapter($query); @@ -71,7 +72,7 @@ class QueryAdapterTest extends \PHPUnit_Framework_TestCase public function testLimit2() { $backend = new Statusdat($this->config); - $query = $backend->select()->from('hostlist'); + $query = $backend->select()->from('status'); $adapter = new QueryAdapter($query); $this->assertEquals(30, $adapter->count()); diff --git a/test/php/library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorderTest.php b/test/php/library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorderTest.php index b68438644..c2d43ff07 100755 --- a/test/php/library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorderTest.php +++ b/test/php/library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorderTest.php @@ -2,9 +2,11 @@ namespace Tests\Icinga\Web\Paginator\ScrollingStyle; -use Icinga\Backend\Statusdat; +use Monitoring\Backend\Statusdat; use Icinga\Protocol\Statusdat\Reader; use Icinga\Web\Paginator\Adapter\QueryAdapter; +use Tests\Icinga\Protocol\Statusdat\StatusdatTestLoader; + require_once 'Zend/Paginator/Adapter/Interface.php'; require_once 'Zend/Paginator/ScrollingStyle/Interface.php'; @@ -13,23 +15,18 @@ require_once 'Zend/Config.php'; require_once 'Zend/Cache.php'; require_once '../../library/Icinga/Web/Paginator/Adapter/QueryAdapter.php'; -require_once '../../library/Icinga/Backend/Criteria/Order.php'; -require_once '../../library/Icinga/Backend/AbstractBackend.php'; -require_once '../../library/Icinga/Backend/Query.php'; -require_once '../../library/Icinga/Backend/Statusdat/Query.php'; -require_once '../../library/Icinga/Backend/Statusdat.php'; -require_once '../../library/Icinga/Backend/MonitoringObjectList.php'; -require_once '../../library/Icinga/Backend/Statusdat/HostlistQuery.php'; -require_once '../../library/Icinga/Backend/DataView/AbstractAccessorStrategy.php'; -require_once '../../library/Icinga/Backend/DataView/ObjectRemappingView.php'; -require_once '../../library/Icinga/Backend/Statusdat/DataView/StatusdatHostView.php'; -require_once '../../library/Icinga/Protocol/AbstractQuery.php'; -require_once '../../library/Icinga/Protocol/Statusdat/IReader.php'; -require_once '../../library/Icinga/Protocol/Statusdat/Reader.php'; -require_once '../../library/Icinga/Protocol/Statusdat/Query.php'; -require_once '../../library/Icinga/Protocol/Statusdat/Parser.php'; -require_once '../../library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php'; +require_once 'library/Icinga/Protocol/Statusdat/StatusdatTestLoader.php'; +StatusdatTestLoader::requireLibrary(); + +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Criteria/Order.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/AbstractBackend.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/Query.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/Query/StatusQuery.php'; +require_once '../../modules/monitoring/library/Monitoring/Backend/Statusdat/DataView/StatusdatHostView.php'; +require_once '../../modules/monitoring/library/Monitoring/View/MonitoringView.php'; +require_once '../../modules/monitoring/library/Monitoring/View/StatusView.php'; require_once '../../library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorder.php'; class TestPaginatorAdapter implements \Zend_Paginator_Adapter_Interface @@ -109,7 +106,7 @@ class SlidingwithborderTest extends \PHPUnit_Framework_TestCase public function testGetPages1() { $backend = new Statusdat($this->config); - $query = $backend->select()->from('hostlist'); + $query = $backend->select()->from('status'); $adapter = new QueryAdapter($query); diff --git a/test/php/runtests b/test/php/runtests index e63ed897c..d9f507899 100755 --- a/test/php/runtests +++ b/test/php/runtests @@ -9,7 +9,7 @@ from optparse import OptionParser, BadOptionError, AmbiguousOptionError APPLICATION = 'phpunit' -DEFAULT_ARGS = ['--strict', '--static-backup'] +DEFAULT_ARGS = ['--static-backup'] VAGRANT_SCRIPT = '/vagrant/test/php/runtests' REPORT_DIRECTORY = '../../build/log'