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
18using Poco::Util::AbstractConfiguration;
19using Poco::Util::MapConfiguration;
20using Poco::AutoPtr;
21
22
23MapConfigurationTest::MapConfigurationTest(const std::string& name): AbstractConfigurationTest(name)
24{
25}
26
27
28MapConfigurationTest::~MapConfigurationTest()
29{
30}
31
32
33void 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
45AbstractConfiguration::Ptr MapConfigurationTest::allocConfiguration() const
46{
47 return new MapConfiguration;
48}
49
50
51void MapConfigurationTest::setUp()
52{
53}
54
55
56void MapConfigurationTest::tearDown()
57{
58}
59
60
61CppUnit::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