Commit faaac3b8 authored by Steven Murray's avatar Steven Murray
Browse files

Renamed the method tapeserver::drive::DriveFactory() to createDrive()

parent 6cf6a342
......@@ -49,7 +49,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// Instantiate the drive object
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(
castor::tape::tapeserver::drive::DriveFactory(driveInfo, m_sysWrapper));
castor::tape::tapeserver::drive::createDrive(driveInfo, m_sysWrapper));
if(NULL == drive.get()) {
castor::exception::Exception ex;
......
......@@ -444,7 +444,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::findDrive(const utils::Dr
}
try {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive;
drive.reset(castor::tape::tapeserver::drive::DriveFactory(driveInfo, m_sysWrapper));
drive.reset(castor::tape::tapeserver::drive::createDrive(driveInfo, m_sysWrapper));
if (drive.get()) drive->librarySlot = driveConfig.librarySlot;
return drive.release();
} catch (castor::exception::Exception & e) {
......
......@@ -106,7 +106,7 @@ std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface>
// Instantiate the drive object
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(
castor::tape::tapeserver::drive::DriveFactory(driveInfo, m_sysWrapper));
castor::tape::tapeserver::drive::createDrive(driveInfo, m_sysWrapper));
if(NULL == drive.get()) {
castor::exception::Exception ex;
......
......@@ -29,7 +29,7 @@ namespace castor {
namespace tape {
namespace tapeserver {
drive::DriveInterface * drive::DriveFactory(SCSI::DeviceInfo di,
drive::DriveInterface * drive::createDrive(SCSI::DeviceInfo di,
System::virtualWrapper& sw) {
if (std::string::npos != di.product.find("T10000")) {
return new DriveT10000(di, sw);
......
......@@ -201,7 +201,7 @@ namespace drive {
* @return pointer to the newly allocated drive object
*/
DriveInterface * DriveFactory(SCSI::DeviceInfo di,
DriveInterface * createDrive(SCSI::DeviceInfo di,
System::virtualWrapper & sw);
} // namespace drive
......
......@@ -71,7 +71,7 @@ TEST(castor_tape_drive_Drive, OpensCorrectly) {
if (castor::tape::SCSI::Types::tape == i->type) {
std::string expected_classid (typeid(castor::tape::tapeserver::drive::DriveT10000).name());
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface>drive(
castor::tape::tapeserver::drive::DriveFactory(*i, sysWrapper));
castor::tape::tapeserver::drive::createDrive(*i, sysWrapper));
std::string found_classid (typeid(*drive).name());
ASSERT_EQ(expected_classid, found_classid);
}
......@@ -103,7 +103,7 @@ TEST(castor_tape_drive_Drive, getPositionInfoAndPositionToLogicalObject) {
i != dl.end(); i++) {
if (castor::tape::SCSI::Types::tape == i->type) {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive (
castor::tape::tapeserver::drive::DriveFactory(*i, sysWrapper));
castor::tape::tapeserver::drive::createDrive(*i, sysWrapper));
castor::tape::tapeserver::drive::positionInfo posInfo;
EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(1);
......@@ -152,7 +152,7 @@ TEST(castor_tape_drive_Drive, setDensityAndCompression) {
i != dl.end(); i++) {
if (castor::tape::SCSI::Types::tape == i->type) {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive (
castor::tape::tapeserver::drive::DriveFactory(*i, sysWrapper));
castor::tape::tapeserver::drive::createDrive(*i, sysWrapper));
EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);
drive->setDensityAndCompression();
......@@ -196,7 +196,7 @@ TEST(castor_tape_drive_Drive, setStDriverOptions) {
for (std::vector<castor::tape::SCSI::DeviceInfo>::iterator i = dl.begin(); i != dl.end(); i++) {
if (castor::tape::SCSI::Types::tape == i->type) {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive (
castor::tape::tapeserver::drive::DriveFactory(*i, sysWrapper));
castor::tape::tapeserver::drive::createDrive(*i, sysWrapper));
EXPECT_CALL(sysWrapper, ioctl(_,_,An<struct mtop *>())).Times(1);
drive->setSTBufferWrite(true);
......@@ -232,7 +232,7 @@ TEST(castor_tape_drive_Drive, getDeviceInfo) {
i != dl.end(); i++) {
if (castor::tape::SCSI::Types::tape == i->type) {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive (
castor::tape::tapeserver::drive::DriveFactory(*i, sysWrapper));
castor::tape::tapeserver::drive::createDrive(*i, sysWrapper));
castor::tape::tapeserver::drive::deviceInfo devInfo;
EXPECT_CALL(sysWrapper, ioctl(_,_,An<sg_io_hdr_t*>())).Times(2);
......@@ -370,7 +370,7 @@ TEST(castor_tape_drive_Drive, getTapeAlerts) {
i != dl.end(); i++) {
if (castor::tape::SCSI::Types::tape == i->type) {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive (
castor::tape::tapeserver::drive::DriveFactory(*i, sysWrapper));
castor::tape::tapeserver::drive::createDrive(*i, sysWrapper));
EXPECT_CALL(sysWrapper, ioctl(_, _, An<sg_io_hdr_t*>())).Times(1);
std::vector<std::string> alerts = drive->getTapeAlerts();
ASSERT_EQ(3U, alerts.size());
......
......@@ -71,7 +71,7 @@ int main ()
<< dev.sg_dev << " (" << dev.nst_dev << ")" << std::endl;
if (dev.type == castor::tape::SCSI::Types::tape) {
std::auto_ptr<castor::tape::tapeserver::drive::DriveInterface> drive(
castor::tape::tapeserver::drive::DriveFactory(dev, sWrapper));
castor::tape::tapeserver::drive::createDrive(dev, sWrapper));
castor::tape::tapeserver::drive::deviceInfo devInfo;
try {
devInfo = drive->getDeviceInfo();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment