Task #2803
closed
Nlsr class should create and maintain Scheduler and Face instances
Added by Vince Lehman over 9 years ago.
Updated almost 8 years ago.
Description
Currently, the Scheduler and Face are created in the main method and Nlsr's constructor takes them as parameters.
Since the Scheduler and Face are not used in the main method, Nlsr should create and maintain them.
- Remove member variables m_ioService, m_scheduler, and m_face from NlsrRunner class
- Change member variables m_nlsrFace and m_scheduler in the Nlsr class to concrete objects
- Target version set to v0.3.0
- Assignee set to Muktadir Chowdhury
- Assignee changed from Muktadir Chowdhury to Ashlesh Gawande
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Status changed from New to In Progress
- Target version changed from v0.3.0 to v0.4.0
- Status changed from In Progress to Abandoned
This breaks the tests, would need major re-factor.
Moving Face
into a class is generally a bad idea, because you won't be able to unit test the class with DummyClientFace
.
Similarly, KeyChain
should also be a constructor argument (rather than created within the class), so that a test suite can replace the keychain instead of relying on default keychain.
Junxiao Shi wrote:
Moving Face
into a class is generally a bad idea, because you won't be able to unit test the class with DummyClientFace
.
Similarly, KeyChain
should also be a constructor argument (rather than created within the class), so that a test suite can replace the keychain instead of relying on default keychain.
Hi Junxiao, I am working on the redmine issue#3742, and added keyChain as the parameter to nlsr constructor, but unit test cannot be passed, I am not sure how to modify the test codes. Could you give me some suggestions? https://gerrit.named-data.net/#/c/3532/4
Alex Afanasyev wrote:
You should check at the error: http://jenkins.named-data.net/job/NLSR/876/label=FreeBSD10/console
The code doesn't compile at least on FreeBSD platform (I canceled other builds to save time, as they will be the same). Also, take a look at my comment on gerrit, as more changes are needed.
Thanks, I changed the variable order in the header file(nlsr.hpp) and also updated the corresponding test files,it works now.
Also available in: Atom
PDF