#include "RpcMethod.h" #include #include "DownloadEngine.h" #include "SelectEventPoll.h" #include "Option.h" #include "RequestGroupMan.h" #include "RequestGroup.h" #include "RpcMethodImpl.h" #include "OptionParser.h" #include "OptionHandler.h" #include "RpcRequest.h" #include "RpcResponse.h" #include "prefs.h" #include "TestUtil.h" #include "DownloadContext.h" #include "FeatureConfig.h" #include "util.h" #include "array_fun.h" #include "download_helper.h" #include "FileEntry.h" #include "RpcMethodFactory.h" #ifdef ENABLE_BITTORRENT #include "BtRegistry.h" #include "BtRuntime.h" #include "bittorrent_helper.h" #endif // ENABLE_BITTORRENT namespace aria2 { namespace rpc { class RpcMethodTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(RpcMethodTest); CPPUNIT_TEST(testAuthorize); CPPUNIT_TEST(testAddUri); CPPUNIT_TEST(testAddUri_withoutUri); CPPUNIT_TEST(testAddUri_notUri); CPPUNIT_TEST(testAddUri_withBadOption); CPPUNIT_TEST(testAddUri_withPosition); CPPUNIT_TEST(testAddUri_withBadPosition); #ifdef ENABLE_BITTORRENT CPPUNIT_TEST(testAddTorrent); CPPUNIT_TEST(testAddTorrent_withoutTorrent); CPPUNIT_TEST(testAddTorrent_notBase64Torrent); CPPUNIT_TEST(testAddTorrent_withPosition); #endif // ENABLE_BITTORRENT #ifdef ENABLE_METALINK CPPUNIT_TEST(testAddMetalink); CPPUNIT_TEST(testAddMetalink_withoutMetalink); CPPUNIT_TEST(testAddMetalink_notBase64Metalink); CPPUNIT_TEST(testAddMetalink_withPosition); #endif // ENABLE_METALINK CPPUNIT_TEST(testGetOption); CPPUNIT_TEST(testChangeOption); CPPUNIT_TEST(testChangeOption_withBadOption); CPPUNIT_TEST(testChangeOption_withNotAllowedOption); CPPUNIT_TEST(testChangeOption_withoutGid); CPPUNIT_TEST(testChangeGlobalOption); CPPUNIT_TEST(testChangeGlobalOption_withBadOption); CPPUNIT_TEST(testChangeGlobalOption_withNotAllowedOption); CPPUNIT_TEST(testTellStatus_withoutGid); CPPUNIT_TEST(testTellWaiting); CPPUNIT_TEST(testTellWaiting_fail); CPPUNIT_TEST(testGetVersion); CPPUNIT_TEST(testNoSuchMethod); CPPUNIT_TEST(testGatherStoppedDownload); #ifdef ENABLE_BITTORRENT CPPUNIT_TEST(testGatherStoppedDownload_bt); #endif // ENABLE_BITTORRENT CPPUNIT_TEST(testGatherProgressCommon); #ifdef ENABLE_BITTORRENT CPPUNIT_TEST(testGatherBitTorrentMetadata); #endif // ENABLE_BITTORRENT CPPUNIT_TEST(testChangePosition); CPPUNIT_TEST(testChangePosition_fail); CPPUNIT_TEST(testGetSessionInfo); CPPUNIT_TEST(testChangeUri); CPPUNIT_TEST(testChangeUri_fail); CPPUNIT_TEST(testPause); CPPUNIT_TEST(testSystemMulticall); CPPUNIT_TEST(testSystemMulticall_fail); CPPUNIT_TEST(testSystemListMethods); CPPUNIT_TEST(testSystemListNotifications); CPPUNIT_TEST_SUITE_END(); private: std::shared_ptr e_; std::shared_ptr