diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-13 17:22:28 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-13 17:22:28 +0800 |
commit | 96f5f40dd82807540b23b243a498f6e9f33acc0a (patch) | |
tree | 48e8af94f5f0151c9242397d1f742c00abca92ff /jsonrpc.cpp | |
parent | 8472a0f06f89298ba4ab828291784673ae7bc31c (diff) | |
download | dexon-solidity-96f5f40dd82807540b23b243a498f6e9f33acc0a.tar.gz dexon-solidity-96f5f40dd82807540b23b243a498f6e9f33acc0a.tar.zst dexon-solidity-96f5f40dd82807540b23b243a498f6e9f33acc0a.zip |
preparing for tests
Diffstat (limited to 'jsonrpc.cpp')
-rw-r--r-- | jsonrpc.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/jsonrpc.cpp b/jsonrpc.cpp new file mode 100644 index 00000000..751539c6 --- /dev/null +++ b/jsonrpc.cpp @@ -0,0 +1,69 @@ + + +#if ETH_JSONRPC && 1 + +#include <boost/test/unit_test.hpp> +#include <libdevcore/Log.h> +#include <libdevcore/CommonIO.h> +#include <libwebthree/WebThree.h> +#include <eth/EthStubServer.h> +#include <jsonrpc/connectors/httpserver.h> +#include "JsonSpiritHeaders.h" +#include "ethstubclient.h" + +using namespace std; +using namespace dev; +using namespace dev::eth; +namespace js = json_spirit; + + + + +namespace jsonrpc_tests { + +auto_ptr<EthStubServer> jsonrpcServer; + + +struct JsonrpcFixture { + JsonrpcFixture() + { + cnote << "setup jsonrpc"; + string name = "Ethereum(++) tests"; + string dbPath; + dev::WebThreeDirect web3(name, dbPath); + web3.setIdealPeerCount(5); + jsonrpcServer = auto_ptr<EthStubServer>(new EthStubServer(new jsonrpc::HttpServer(8080), web3)); + } + ~JsonrpcFixture() + { + cnote << "teardown jsonrpc"; + } +}; + +//BOOST_AUTO_TEST_CASE(jsonrpc_test) +//{ +// cnote << "testing jsonrpc"; +// js::mValue v; +// string s = asString(contents("../../jsonrpc.json")); +// BOOST_REQUIRE_MESSAGE(s.length() > 0, "Content from 'jsonrpc.json' is empty. Have you cloned the 'tests' repo branch develop?"); +// js::read_string(s, v); +//} + +BOOST_GLOBAL_FIXTURE(JsonrpcFixture) + +BOOST_AUTO_TEST_CASE( test_case1 ) +{ +// BOOST_CHECK( i == 1 ); +} + +BOOST_AUTO_TEST_CASE( test_case2 ) +{ +// BOOST_CHECK_EQUAL( i, 0 ); +} + +} + +#endif + + + |