]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php
Introduced a test-unit producer task (unfinished work)
[hub.git] / application / hub / main / filter / task / cruncher / class_CruncherTaskHandlerInitializerFilter.php
index 15152b2e7eeedd127853ddce6919a041771bd147..9091574d6675c481ca02917b48c28a44b90aadfa 100644 (file)
@@ -62,10 +62,18 @@ class CruncherTaskHandlerInitializerFilter extends BaseFilter implements Filtera
                $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);
        }