Browse Source

Tests: PityTest - PityNode add inbox dir

master
heck 4 years ago
parent
commit
45685a204d
  1. 13
      src/PityNode.cc
  2. 2
      src/PityNode.hh

13
src/PityNode.cc

@ -29,23 +29,23 @@ namespace pEp {
void PityNode::_init(const PityUnit<PityModel>& unit) void PityNode::_init(const PityUnit<PityModel>& unit)
{ {
unit.log("INIT - " + getName()); unit.log("NODE INIT - " + getName());
unit.getModel()->own_node = this; unit.getModel()->own_node = this;
unit.getModel()->setName("Copy for:" + getName()); unit.getModel()->setName("Copy for:" + getName());
unit.log("INIT DONE"); unit.log("NODE INIT DONE");
} }
std::string PityNode::getName() const std::string PityNode::getName() const
{ {
std::string ret{}; std::string ret{};
ret += "node_" + std::to_string(_node_nr); ret += "node_" + std::to_string(_node_nr) + "@peptest.org";
return ret; return ret;
} }
std::string PityNode::to_string() const std::string PityNode::to_string() const
{ {
std::string ret{}; std::string ret{};
ret += "node_" + std::to_string(_node_nr); ret += "name: " +getName();
return ret; return ret;
} }
@ -53,5 +53,10 @@ namespace pEp {
{ {
return _process_unit; return _process_unit;
} }
std::string PityNode::inboxDir() const {
return getProcessUnit()->processDir() + "inbox/";
}
} // namespace PityTest11 } // namespace PityTest11
} // namespace pEp } // namespace pEp

2
src/PityNode.hh

@ -18,7 +18,7 @@ namespace pEp {
std::string getName() const; std::string getName() const;
std::string to_string() const; std::string to_string() const;
const std::shared_ptr<PityUnit<PityModel>>& getProcessUnit() const; const std::shared_ptr<PityUnit<PityModel>>& getProcessUnit() const;
std::string inboxDir() const;
//internal logging //internal logging
static bool debug_log_enabled; static bool debug_log_enabled;
Adapter::pEpLog::pEpLogger logger_debug{ "PityNode", debug_log_enabled }; Adapter::pEpLog::pEpLogger logger_debug{ "PityNode", debug_log_enabled };

Loading…
Cancel
Save