24 #include "cheetah/exporters/test/DataExportConfigTest.h" 25 #include "cheetah/exporters/DataExportConfig.h" 26 #include <boost/property_tree/xml_parser.hpp> 34 DataExportConfigTest::DataExportConfigTest()
39 DataExportConfigTest::~DataExportConfigTest()
43 void DataExportConfigTest::SetUp()
47 void DataExportConfigTest::TearDown()
55 void add_options(OptionsDescriptionEasyInit& )
override {}
66 void add_options(OptionsDescriptionEasyInit& )
override {};
75 boost::property_tree::ptree pt_root;
76 boost::property_tree::ptree pt_exporter_1;
77 boost::property_tree::ptree pt_exporter_2_a;
78 boost::property_tree::ptree pt_exporter_2_b;
80 pt_root.put_child(
"exporter_1", pt_exporter_1);
81 pt_root.add_child(
"exporter_2", pt_exporter_2_a);
82 pt_root.add_child(
"exporter_2", pt_exporter_2_b);
85 boost::program_options::variables_map vm;
86 c.parse_property_tree(pt_root, vm);
87 boost::program_options::notify(vm);
95 boost::property_tree::ptree pt_root;
96 boost::property_tree::ptree pt_channels;
98 boost::property_tree::ptree pt_sink_configs;
100 boost::property_tree::ptree pt_channel_1;
101 boost::property_tree::ptree pt_channel_2;
102 boost::property_tree::ptree sink_1;
103 sink_1.put<std::string>(
"id",
"sink_1_id");
104 boost::property_tree::ptree sink_2;
105 sink_2.put<std::string>(
"id",
"sink_2_id");
106 boost::property_tree::ptree sink_3;
107 sink_3.put<std::string>(
"id",
"sink_3_id");
108 boost::property_tree::ptree sink_4;
110 pt_channel_1.put<std::string>(
"active",
"true");
111 pt_channel_1.add_child(
"sink", sink_1);
112 pt_channel_1.add_child(
"sink", sink_2);
113 pt_channel_2.add_child(
"sink", sink_3);
114 pt_channel_2.add_child(
"sink", sink_4);
115 pt_channels.add_child(
"channel_1", pt_channel_1);
116 pt_channels.add_child(
"channel_2", pt_channel_2);
117 pt_root.put_child(
"channels", pt_channels);
120 boost::property_tree::ptree sink_1_config;
121 boost::property_tree::ptree sink_1_with_id_config;
122 sink_1_with_id_config.put<std::string>(
"id",
"sink_1_id");
123 boost::property_tree::ptree sink_2_config;
124 boost::property_tree::ptree sink_2_with_id_config;
125 sink_2_with_id_config.put<std::string>(
"id",
"sink_2_id");
129 pt_sink_configs.add_child(
"sink_1", sink_1_config);
130 pt_sink_configs.add_child(
"sink_1", sink_1_with_id_config);
131 pt_sink_configs.add_child(
"sink_2", sink_2_config);
132 pt_sink_configs.add_child(
"sink_2", sink_2_with_id_config);
133 pt_root.put_child(
"sink_configs", pt_sink_configs);
135 boost::property_tree::xml_parser::write_xml(std::cout, pt_root);
141 boost::program_options::variables_map vm;
142 c.parse_property_tree(pt_root, vm);
143 boost::program_options::notify(vm);
148 ASSERT_EQ(
"sink_1",c1.name());
150 ASSERT_EQ(
"sink_2",c2.name());
Configuration Object for DataExport module.
std::vector< DataExportStreamConfig > const & exporters() const
return a list of configured export streamer configurations
Base class for module configuration.
Some limits and constants for FLDO.