12 #include <utl/AugerException.h>
13 #include <utl/AugerUnits.h>
14 #include <utl/ErrorLogger.h>
16 #include <fwk/CentralConfig.h>
17 #include <utl/Reader.h>
18 #include <fwk/RunController.h>
20 #include <cppunit/extensions/HelperMacros.h>
21 #include <tst/Verify.h>
33 CPPUNIT_TEST(testCreation);
34 CPPUNIT_TEST(testGetSomeData);
35 CPPUNIT_TEST(testConfigLinkOverride);
36 CPPUNIT_TEST(testGetConfig);
37 CPPUNIT_TEST(testParameterOverride);
38 CPPUNIT_TEST(testLog);
39 CPPUNIT_TEST(testSeverity);
40 CPPUNIT_TEST_SUITE_END();
51 CentralConfig::GetInstance();
57 CentralConfig* theCC = CentralConfig::GetInstance(BOOTSTRAPFILE);
60 CPPUNIT_ASSERT(Verify<Equal>(theCC, theCCAgain));
62 RunController::GetInstance().Init();
63 RunController::GetInstance().Run();
64 RunController::GetInstance().Finish();
66 theCC->
WriteConfig(
"./CentralConfig/testLogModules.xml");
78 CPPUNIT_ASSERT(Verify<Equal>(!topOfModule1,
false));
82 CPPUNIT_ASSERT(Verify<Equal>(someData, 6.1));
90 CPPUNIT_ASSERT(Verify<Equal>(topOfOverrideModule.
GetName(),
94 CPPUNIT_ASSERT(Verify<Equal>(topOfOverrideModule2.
GetName(),
95 string(
"another-override")));
102 string configString =
123 CPPUNIT_ASSERT(override1);
125 CPPUNIT_ASSERT(override2);
131 CPPUNIT_ASSERT(Verify<CloseTo>(data1, 3.2));
135 atts[
"att"] =
"override_me";
137 CPPUNIT_ASSERT(Verify<Equal>(data2, 22));
139 CPPUNIT_ASSERT(Verify<Equal>(data2, 22));
145 CPPUNIT_ASSERT(Verify<CloseTo>(dataUnit1, 100.*
kilometer));
147 CPPUNIT_ASSERT(Verify<CloseTo>(dataUnit1, 100.*
kilometer));
152 CPPUNIT_ASSERT(Verify<CloseTo>(dataUnit2, 3.0*
meter/
second));
154 CPPUNIT_ASSERT(Verify<CloseTo>(dataUnit2, 3.0*
meter/
second));
159 atts3[
"attribute"] =
"cow";
163 GetChild(
"branch5", atts3).
GetData(data3);
164 CPPUNIT_ASSERT(Verify<Equal>(data3,
string(
"woof! wooooof!")));
168 GetChild(
"branch5",
"attribute=cow").
GetData(data3);
169 CPPUNIT_ASSERT(Verify<Equal>(data3,
string(
"woof! wooooof!")));
173 CPPUNIT_ASSERT(Verify<CloseTo>(data4, 3.0));\
const std::string & GetInstallPath() const
Base class for all exceptions used in the auger offline code.
std::map< std::string, std::string > AttributeMap
std::string GetConfig()
Get configuration in a string.
void testConfigLinkOverride()
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
void testCreationException()
Utility for parsing XML files.
Class representing a document branch.
void GetData(bool &b) const
Overloads of the GetData member template function.
std::string GetName() const
function to get the Branch name
void testParameterOverride()
const utl::Reader * GetReader(const std::string &id)
Get the Reader for moduleConfigLink with given id (XML files)
constexpr double kilometer
static ErrorLogger & GetInstance()
Main configuration utility.
void WriteConfig(const std::string &fileName="")
Get the link name for moduleConfigLink with given id (any)
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)