2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Added test 'testDoReceivedAction' for DHTQueryMessage 
subclasses.
	* test/DHTPingMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTAnnouncePeerMessageTest.cc
	* test/MockDHTMessage.h
	* test/MockDHTMessageFactory.h
	* test/MockDHTMessageDispatcher.h: New class.
This commit is contained in:
Tatsuhiro Tsujikawa 2008-02-11 12:32:46 +00:00
parent e9f980afc7
commit bebb7e1976
8 changed files with 360 additions and 7 deletions

View file

@ -2,19 +2,29 @@
#define _D_MOCK_DHT_MESSAGE_H_
#include "DHTMessage.h"
#include "DHTNode.h"
#include "Peer.h"
#include <deque>
namespace aria2 {
class MockDHTMessage:public DHTMessage {
private:
public:
bool _isReply;
std::string _messageType;
std::deque<SharedHandle<DHTNode> > _nodes;
std::deque<SharedHandle<Peer> > _peers;
std::string _token;
public:
MockDHTMessage(const SharedHandle<DHTNode>& localNode,
const SharedHandle<DHTNode>& remoteNode,
const std::string& messageType = "mock",
const std::string& transactionID = ""):
DHTMessage(localNode, remoteNode, transactionID), _isReply(false), _messageType("mock") {}
DHTMessage(localNode, remoteNode, transactionID), _isReply(false), _messageType(messageType) {}
virtual ~MockDHTMessage() {}