application/hub/main/tasks/class_BaseTask.php -text svneol=unset#text/plain
application/hub/main/tasks/cruncher/.htaccess svneol=native#text/plain
application/hub/main/tasks/cruncher/class_ -text
+application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php svneol=native#text/plain
application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php svneol=native#text/plain
application/hub/main/tasks/hub/.htaccess -text svneol=unset#text/plain
application/hub/main/tasks/hub/announcement/.htaccess -text svneol=unset#text/plain
// CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS
$cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask');
+// CFG: CRUNCHER-TEST-UNIT-PRODUCER-TASK-CLASS
+$cfg->setConfigEntry('cruncher_test_unit_producer_task_class', 'CruncherTestUnitProducerTask');
+
// CFG: TASK-NETWORK-PACKAGE-WRITER-STARTUP-DELAY
$cfg->setConfigEntry('task_network_package_writer_startup_delay', 2500);
// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-MAX-RUNS
$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_max_runs', 0);
+// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-STARTUP-DELAY
+$cfg->setConfigEntry('task_cruncher_test_unit_producer_startup_delay', 500);
+
+// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-INTERVAL-DELAY
+$cfg->setConfigEntry('task_cruncher_test_unit_producer_interval_delay', 1000*60*60);
+
+// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-MAX-RUNS
+$cfg->setConfigEntry('task_cruncher_test_unit_producer_max_runs', 0);
+
// CFG: TASK-LIST-CLASS
$cfg->setConfigEntry('task_list_class', 'TaskList');
$handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
// Register all tasks:
- // 1) A task for fetching WUs (work units)
+ // 1) A task for fetching WUs (work units) or test units
$taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_work_unit_fetcher_task_class');
$handlerInstance->registerTask('cruncher_work_unit_fetcher', $taskInstance);
+ /*
+ * 2) A task for generating test units, a if() block could be placed
+ * around this but that would make this method look a little ugly and
+ * even more when more "temporary" tasks should be registered.
+ */
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_producer_task_class');
+ $handlerInstance->registerTask('cruncher_test_unit_producer', $taskInstance);
+
// Put the task handler in registry
Registry::getRegistry()->addInstance('task', $handlerInstance);
}
--- /dev/null
+<?php
+/**
+ * A TestUnitProducer task for crunchers
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $taskInstance An instance of a Visitable class
+ */
+ public final static function createCruncherTestUnitProducerTask () {
+ // Get new instance
+ $taskInstance = new CruncherTestUnitProducerTask();
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to process the visit "request"
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ * @todo Maybe visit some sub-objects
+ */
+ public function accept (Visitor $visitorInstance) {
+ // Visit this task
+ $visitorInstance->visitTask($this);
+ }
+
+ /**
+ * Executes the task
+ *
+ * @return void
+ * @todo 0%
+ */
+ public function executeTask () {
+ $this->partialStub('Unimplemented task.');
+ }
+}
+
+// [EOF]
+?>