diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-17 04:14:31 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-17 04:14:31 +0000 |
commit | 00438314438f3dde00b532ac5d8d28ccc35c7096 (patch) | |
tree | 80dbbb010c5125455a164c77670b8694231f123f /sca-cpp/trunk/components/cache/mcache-test.cpp | |
parent | 50063bc212e8e93d014519ef0e4d4cabef0b6be2 (diff) |
Working queue and chat components. Added a few useful start/stop scripts. Fixed lifecycle code to call start/stop/restart functions before APR pools are cleaned up in both parent and child processes. Minor build script improvements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@910819 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/components/cache/mcache-test.cpp')
-rw-r--r-- | sca-cpp/trunk/components/cache/mcache-test.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sca-cpp/trunk/components/cache/mcache-test.cpp b/sca-cpp/trunk/components/cache/mcache-test.cpp index 90f17ffd48..316372c5be 100644 --- a/sca-cpp/trunk/components/cache/mcache-test.cpp +++ b/sca-cpp/trunk/components/cache/mcache-test.cpp @@ -33,33 +33,36 @@ namespace tuscany { namespace cache { bool testMemCached() { - MemCached ch; + MemCached ch("127.0.0.1", 11211); + const value k = mklist<value>("a"); - assert(hasContent(post("a", string("AAA"), ch))); - assert((get("a", ch)) == value(string("AAA"))); - assert(hasContent(put("a", string("aaa"), ch))); - assert((get("a", ch)) == value(string("aaa"))); - assert(hasContent(del("a", ch))); - assert(!hasContent(get("a", ch))); + assert(hasContent(post(k, string("AAA"), ch))); + assert((get(k, ch)) == value(string("AAA"))); + assert(hasContent(put(k, string("aaa"), ch))); + assert((get(k, ch)) == value(string("aaa"))); + assert(hasContent(del(k, ch))); + assert(!hasContent(get(k, ch))); return true; } struct getLoop { + const value k; MemCached& ch; - getLoop(MemCached& ch) : ch(ch) { + getLoop(const value& k, MemCached& ch) : k(k), ch(ch) { } const bool operator()() const { - assert((get("c", ch)) == value(string("CCC"))); + assert((get(k, ch)) == value(string("CCC"))); return true; } }; bool testGetPerf() { - MemCached ch; - assert(hasContent(post("c", string("CCC"), ch))); + const value k = mklist<value>("c"); + MemCached ch("127.0.0.1", 11211); + assert(hasContent(post(k, string("CCC"), ch))); - const lambda<bool()> gl = getLoop(ch); + const lambda<bool()> gl = getLoop(k, ch); cout << "Memcached get test " << time(gl, 5, 200) << " ms" << endl; return true; } |