mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-02 14:03:41 +01:00
Enhance FileChannel purge setting.
This commit is contained in:
committed by
Guenter Obiltschnig
parent
13b34666d9
commit
3066e66f32
@@ -518,6 +518,34 @@ void FileChannelTest::testPurgeCount()
|
||||
}
|
||||
|
||||
|
||||
void FileChannelTest::testWrongPurgeOption()
|
||||
{
|
||||
std::string name = filename();
|
||||
AutoPtr<FileChannel> pChannel = new FileChannel(name);
|
||||
pChannel->setProperty(FileChannel::PROP_PURGEAGE, "5 seconds");
|
||||
|
||||
try
|
||||
{
|
||||
pChannel->setProperty(FileChannel::PROP_PURGEAGE, "peace");
|
||||
fail("must fail");
|
||||
} catch (InvalidArgumentException)
|
||||
{
|
||||
assert(pChannel->getProperty(FileChannel::PROP_PURGEAGE) == "5 seconds");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
pChannel->setProperty(FileChannel::PROP_PURGECOUNT, "peace");
|
||||
fail("must fail");
|
||||
} catch (InvalidArgumentException)
|
||||
{
|
||||
assert(pChannel->getProperty(FileChannel::PROP_PURGEAGE) == "5 seconds");
|
||||
}
|
||||
|
||||
remove(name);
|
||||
}
|
||||
|
||||
|
||||
void FileChannelTest::setUp()
|
||||
{
|
||||
}
|
||||
@@ -620,6 +648,7 @@ CppUnit::Test* FileChannelTest::suite()
|
||||
CppUnit_addTest(pSuite, FileChannelTest, testCompress);
|
||||
CppUnit_addTest(pSuite, FileChannelTest, testPurgeAge);
|
||||
CppUnit_addTest(pSuite, FileChannelTest, testPurgeCount);
|
||||
CppUnit_addTest(pSuite, FileChannelTest, testWrongPurgeOption);
|
||||
|
||||
return pSuite;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
void testCompress();
|
||||
void testPurgeAge();
|
||||
void testPurgeCount();
|
||||
void testWrongPurgeOption();
|
||||
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
Reference in New Issue
Block a user