// Add criteria for looking up already created and available test units
$searchInstance->addCriteria(CruncherUnitDatabaseWrapper::DB_COLUMN_UNIT_TYPE , BaseUnitProducer::UNIT_TYPE_TEST_UNIT);
$searchInstance->addCriteria(CruncherUnitDatabaseWrapper::DB_COLUMN_UNIT_STATUS, BaseUnitProducer::UNIT_STATUS_AVAILABLE);
- $searchInstance->setLimit($this->getConfigInstance()->getConfigEntry('cruncher_test_unit_max_count'));
+ $searchInstance->setConfiguredLimit('cruncher_test_unit_max_count');
// Search for our units
$resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance);
} else {
// Get an encrypted, random message from our source
$encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
- die($encryptedMessage."\n");
+
+ // Debug message
+ $this->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...');
+
+ // Set the encrypted message in the template instance
+ $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage);
+
+ /*
+ * Now we need to create an iterator, just as for the work units,
+ * to create new keys from the encrypted message. The iterator will
+ * not iterate over an object or collection. It will instead
+ * encapsulate "key production" into a class and not in a simple
+ * for() loop. These keys then needs to be bundled into test units
+ * and stored to database for later re-usage.
+ */
}
}
}