1 | // |
---|---|
2 | // MapConfigurationTest.cpp |
3 | // |
4 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
5 | // and Contributors. |
6 | // |
7 | // SPDX-License-Identifier: BSL-1.0 |
8 | // |
9 | |
10 | |
11 | #include "MapConfigurationTest.h" |
12 | #include "Poco/CppUnit/TestCaller.h" |
13 | #include "Poco/CppUnit/TestSuite.h" |
14 | #include "Poco/Util/MapConfiguration.h" |
15 | #include "Poco/AutoPtr.h" |
16 | |
17 | |
18 | using Poco::Util::AbstractConfiguration; |
19 | using Poco::Util::MapConfiguration; |
20 | using Poco::AutoPtr; |
21 | |
22 | |
23 | MapConfigurationTest::MapConfigurationTest(const std::string& name): AbstractConfigurationTest(name) |
24 | { |
25 | } |
26 | |
27 | |
28 | MapConfigurationTest::~MapConfigurationTest() |
29 | { |
30 | } |
31 | |
32 | |
33 | void MapConfigurationTest::testClear() |
34 | { |
35 | AutoPtr<MapConfiguration> pConf = new MapConfiguration; |
36 | |
37 | pConf->setString("foo", "bar"); |
38 | assertTrue (pConf->hasProperty("foo")); |
39 | |
40 | pConf->clear(); |
41 | assertTrue (!pConf->hasProperty("foo")); |
42 | } |
43 | |
44 | |
45 | AbstractConfiguration::Ptr MapConfigurationTest::allocConfiguration() const |
46 | { |
47 | return new MapConfiguration; |
48 | } |
49 | |
50 | |
51 | void MapConfigurationTest::setUp() |
52 | { |
53 | } |
54 | |
55 | |
56 | void MapConfigurationTest::tearDown() |
57 | { |
58 | } |
59 | |
60 | |
61 | CppUnit::Test* MapConfigurationTest::suite() |
62 | { |
63 | CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MapConfigurationTest"); |
64 | |
65 | AbstractConfigurationTest_addTests(pSuite, MapConfigurationTest); |
66 | CppUnit_addTest(pSuite, MapConfigurationTest, testClear); |
67 | |
68 | return pSuite; |
69 | } |
70 |