| 1 | // |
|---|---|
| 2 | // FileChannelTest.h |
| 3 | // |
| 4 | // Definition of the FileChannelTest class. |
| 5 | // |
| 6 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
| 7 | // and Contributors. |
| 8 | // |
| 9 | // SPDX-License-Identifier: BSL-1.0 |
| 10 | // |
| 11 | |
| 12 | |
| 13 | #ifndef FileChannelTest_INCLUDED |
| 14 | #define FileChannelTest_INCLUDED |
| 15 | |
| 16 | |
| 17 | #include "Poco/Foundation.h" |
| 18 | #include "Poco/CppUnit/TestCase.h" |
| 19 | |
| 20 | |
| 21 | class FileChannelTest: public CppUnit::TestCase |
| 22 | { |
| 23 | public: |
| 24 | enum TimeRotation |
| 25 | { |
| 26 | DAY_HOUR_MIN = 0, |
| 27 | HOUR_MIN, |
| 28 | MIN |
| 29 | }; |
| 30 | |
| 31 | FileChannelTest(const std::string& name); |
| 32 | ~FileChannelTest(); |
| 33 | |
| 34 | void testRotateBySize(); |
| 35 | void testRotateByAge(); |
| 36 | void testRotateAtTimeDayUTC(); |
| 37 | void testRotateAtTimeDayLocal(); |
| 38 | void testRotateAtTimeHourUTC(); |
| 39 | void testRotateAtTimeHourLocal(); |
| 40 | void testRotateAtTimeMinUTC(); |
| 41 | void testRotateAtTimeMinLocal(); |
| 42 | void testArchive(); |
| 43 | void testCompress(); |
| 44 | void testPurgeAge(); |
| 45 | void testPurgeCount(); |
| 46 | void testWrongPurgeOption(); |
| 47 | |
| 48 | void setUp(); |
| 49 | void tearDown(); |
| 50 | |
| 51 | static CppUnit::Test* suite(); |
| 52 | |
| 53 | private: |
| 54 | template <class D> std::string rotation(TimeRotation rtype) const; |
| 55 | void remove(const std::string& baseName); |
| 56 | std::string filename() const; |
| 57 | |
| 58 | void purgeAge(const std::string& purgeAge); |
| 59 | void noPurgeAge(const std::string& purgeAge); |
| 60 | void purgeCount(const std::string& pc); |
| 61 | void noPurgeCount(const std::string& pc); |
| 62 | }; |
| 63 | |
| 64 | |
| 65 | #endif // FileChannelTest_INCLUDED |
| 66 |