Task #2803
closedNlsr class should create and maintain Scheduler and Face instances
0%
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
Updated by Vince Lehman almost 9 years ago
- Assignee changed from Muktadir Chowdhury to Ashlesh Gawande
Updated by Ashlesh Gawande almost 9 years ago
- Status changed from New to In Progress
Updated by Nicholas Gordon over 8 years ago
- Target version changed from v0.3.0 to v0.4.0
Updated by Ashlesh Gawande over 8 years ago
- Status changed from In Progress to Abandoned
This breaks the tests, would need major re-factor.
Updated by Junxiao Shi over 8 years ago
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.
Updated by Laqin Fan almost 8 years ago
Junxiao Shi wrote:
Moving
Face
into a class is generally a bad idea, because you won't be able to unit test the class withDummyClientFace
.
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
Updated by Alex Afanasyev almost 8 years ago
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.
Updated by Laqin Fan almost 8 years ago
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.