]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php
Swapped code, moved/renamed classes and interfaces:
[hub.git] / application / hub / main / producer / cruncher / work_units / class_CruncherTestUnitProducer.php
index f735b6be66e66314c536b7bbc1a637430a73a7db..0f2b55b732969ae872defde13b0c5abee8f1cd0b 100644 (file)
@@ -41,11 +41,11 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                // Get new instance
                $producerInstance = new CruncherTestUnitProducer();
 
-               // Test units have a 'test' source
-               $sourceInstance = UnitSourceFactory::createUnitSourceInstance('test');
+               // Test units have a helper class that wraps the source
+               $helperInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class', array('test'));
 
                // So set it in the producer
-               $producerInstance->setSourceInstance($sourceInstance);
+               $producerInstance->setHelperInstance($helperInstance);
 
                // Return the prepared instance
                return $producerInstance;
@@ -99,7 +99,7 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                        $this->debugInstance();
                } else {
                        // Get an encrypted, random message from our source
-                       $encryptedMessage = $this->getSourceInstance()->generateMessageFromSource();
+                       $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
                        die($encryptedMessage."\n");
                }
        }