QRODS Test Suite
testfilecontentclient.h
1 
2 #ifndef TESTFILECONTENTCLIENT_H
3 #define TESTFILECONTENTCLIENT_H
4 
5 #include <QObject>
6 #include <QtTest/QTest>
7 #include "qrods.h"
8 
9 class TestFileContentClient : public QObject
10 {
11  Q_OBJECT
12 public:
13  explicit TestFileContentClient(QString &newHost, QString &newport, QString &newUser, QString &newPassword, bool isSecureHttps, QString & _testFile, QVector<QString> _testFileNames,QString deployRootPathTest);
14 private slots:
15 
16  void initTestCase();
17  void cleanupTestCase();
18  void init();
19  void cleanup();
20 
21  void testGetFile();
22  void testUploadFilesWithLargeNames();
23 
24  void testUploadOnlyOneSmallFile();
25  void testUpload_10000Files_10MB();
26  void testUpload_1000Files_100MB();
27  void testUpload_100Files_1GB();
28  void testUpload_10File_10GB();
29  void testUpload_1File_100GB();
30  void testUploadDifferentSizeFiles();
31 
32 
33 private:
34  void forceFileRemoval(QRODS *qrods, bool force);
35 
36  int getCurrentListSize();
37  void uploadFileAux(QString dir, QString collectionPath, QString file);
38  bool fileExistsLocal(QString &localFilePath);
39  bool fileExistsRemote(QString & collection, QString &fileName);
40  void deleteLocalFile(QString & localFilePath);
41  QString getRandomString(int length);
42  bool createSingleTextFiles(QString &baseFileName);
43  void createMultipleLargeFiles(QString subDir, QString fileNameInitials, int size, int number);
44  void createSingleFiles();
45  bool createTextFiles(QString &baseFileName);
46  QString getFormatedTime(int milliseconds);
47  void fillTestFileNamesAndSizes();
48  void createTestFolders();
49  bool createTextFiles(QString baseFileName, int size);
50  bool createLargeFilesByDownload(QString &testFileMediumSize,QString &address);
51  bool deleteFiles(QString &fileName);
52  bool removeDirectory( QDir dir );
53  void createFolder(QString folder);
54  void removeDir(QString foldername);
55  void uploadAndAssertLargeFilesAux(int number, QString dirTest, int size, QString fileNameInitials, QString pathTestCollection);
56 
57  QString testFile;
58  QString testFileMediumSize;
59  QVector<QString> testFileNames;
60  QString host;
61  QString hostFull;
62  QString port;
63  QString user;
64  QString password;
65  bool secureHttps;
66  int objectsBefore;
67  int objectsAfter;
68  //QString collecUrl;
69  QString fileContUrl;
70  QString dataObjUrl;
71  QString path;
72  QRODS *model ;
73  QString pathToTheFile;
74  QString anotherPathToTheFile;
75  QString localPath;
76 
77 
78 };
79 
80 #endif // TESTFILECONTENTCLIENT_H
Definition: testfilecontentclient.h:9