Merge lp:~marcustomlinson/unity-scopes-api/smartscopesproxy_fixes into lp:unity-scopes-api/devel

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 177
Merged at revision: 181
Proposed branch: lp:~marcustomlinson/unity-scopes-api/smartscopesproxy_fixes
Merge into: lp:unity-scopes-api/devel
Diff against target: 126 lines (+17/-13)
5 files modified
src/scopes/internal/smartscopes/SmartScopesClient.cpp (+10/-6)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/CMakeLists.txt (+1/-1)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/Runtime.ini.in (+2/-2)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in (+2/-2)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp (+2/-2)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/smartscopesproxy_fixes
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+204827@code.launchpad.net

Commit message

Added some debug output to SmartScopesClient methods.
"render_template" returned from SSS, not "renderer_template".
Renamed SSRegistry to SSRegistryTest in smartscopesproxy_test (avoid clash with actual SSRegistry).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/internal/smartscopes/SmartScopesClient.cpp'
2--- src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-01-30 06:07:44 +0000
3+++ src/scopes/internal/smartscopes/SmartScopesClient.cpp 2014-02-05 06:53:44 +0000
4@@ -115,10 +115,12 @@
5 }
6
7 std::string response_str;
8+ std::cout << "SmartScopesClient: GET " << remote_scopes_uri.str() << std::endl;
9 HttpResponseHandle::SPtr response = http_client_->get(remote_scopes_uri.str(), port_);
10 response->wait();
11
12 response_str = response->get();
13+ std::cout << "SmartScopesClient: Remote scopes:" << std::endl << response_str << std::endl;
14
15 std::vector<RemoteScope> remote_scopes;
16 JsonNodeInterface::SPtr root_node;
17@@ -150,12 +152,12 @@
18 remote_scopes.push_back(scope);
19 }
20
21- std::cout << "Retrieved remote scopes from uri: " << url_ << c_remote_scopes_resource << std::endl;
22+ std::cout << "SmartScopesClient: Retrieved remote scopes from uri: " << url_ << c_remote_scopes_resource << std::endl;
23 return remote_scopes;
24 }
25 catch (unity::Exception const& e)
26 {
27- std::cout << "Failed to retrieve remote scopes from uri: " << url_ << c_remote_scopes_resource << std::endl;
28+ std::cout << "SmartScopesClient: Failed to retrieve remote scopes from uri: " << url_ << c_remote_scopes_resource << std::endl;
29 throw;
30 }
31 }
32@@ -207,6 +209,7 @@
33 cancel_search(session_id);
34
35 std::lock_guard<std::mutex> lock(search_results_mutex_);
36+ std::cout << "SmartScopesClient: GET " << search_uri.str() << std::endl;
37 search_results_[session_id] = http_client_->get(search_uri.str(), port_);
38
39 return SearchHandle::UPtr(new SearchHandle(session_id, shared_from_this()));
40@@ -230,6 +233,7 @@
41 search_results_[session_id]->wait();
42
43 response_str = search_results_[session_id]->get();
44+ std::cout << "SmartScopesClient: Search:" << std::endl << response_str << std::endl;
45 search_results_.erase(it);
46 }
47
48@@ -256,8 +260,8 @@
49
50 category->icon = child_node->has_node("icon") ? child_node->get_node("icon")->as_string() : "";
51 category->id = child_node->has_node("id") ? child_node->get_node("id")->as_string() : "";
52- category->renderer_template = child_node->has_node("renderer_template") ?
53- child_node->get_node("renderer_template")->as_string() :
54+ category->renderer_template = child_node->has_node("render_template") ?
55+ child_node->get_node("render_template")->as_string() :
56 "";
57 category->title = child_node->has_node("title") ? child_node->get_node("title")->as_string() : "";
58 categories[category->id] = category;
59@@ -281,12 +285,12 @@
60 }
61 }
62
63- std::cout << "Retrieved search results for session: " << session_id << std::endl;
64+ std::cout << "SmartScopesClient: Retrieved search results for session: " << session_id << std::endl;
65 return results;
66 }
67 catch (unity::Exception const& e)
68 {
69- std::cout << "Failed to retrieve search results for session: " << session_id << std::endl;
70+ std::cout << "SmartScopesClient: Failed to retrieve search results for session: " << session_id << std::endl;
71 throw;
72 }
73 }
74
75=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/CMakeLists.txt'
76--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/CMakeLists.txt 2014-01-28 03:31:55 +0000
77+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/CMakeLists.txt 2014-02-05 06:53:44 +0000
78@@ -1,4 +1,4 @@
79-configure_file(SSRegistry.ini.in ${CMAKE_CURRENT_BINARY_DIR}/SSRegistry.ini)
80+configure_file(SSRegistryTest.ini.in ${CMAKE_CURRENT_BINARY_DIR}/SSRegistryTest.ini)
81 configure_file(Runtime.ini.in ${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini)
82 configure_file(Zmq.ini.in ${CMAKE_CURRENT_BINARY_DIR}/Zmq.ini)
83
84
85=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/Runtime.ini.in'
86--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/Runtime.ini.in 2014-01-17 09:59:38 +0000
87+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/Runtime.ini.in 2014-02-05 06:53:44 +0000
88@@ -1,5 +1,5 @@
89 [Runtime]
90-Registry.Identity = SSRegistry
91-Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/SSRegistry.ini
92+Registry.Identity = SSRegistryTest
93+Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/SSRegistryTest.ini
94 Default.Middleware = Zmq
95 Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini
96
97=== renamed file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistry.ini.in' => 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in'
98--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistry.ini.in 2014-01-17 09:59:38 +0000
99+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-02-05 06:53:44 +0000
100@@ -1,9 +1,9 @@
101 [Runtime]
102-Registry.Identity = SSRegistry
103+Registry.Identity = SSRegistryTest
104
105 [Registry]
106 Middleware = Zmq
107-Zmq.Endpoint = ipc:///tmp/SSRegistry
108+Zmq.Endpoint = ipc:///tmp/SSRegistryTest
109 Zmq.EndpointDir = /tmp
110 Zmq.ConfigFile = Zmq.ini
111 Scope.InstallDir = /tmp
112
113=== modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp'
114--- test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-02-03 11:29:47 +0000
115+++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-02-05 06:53:44 +0000
116@@ -49,8 +49,8 @@
117 public:
118 smartscopesproxytest()
119 : server_(FAKE_SSS_PATH)
120- , reg_id_("SSRegistry")
121- , scope_id_("SmartScope")
122+ , reg_id_("SSRegistryTest")
123+ , scope_id_("SmartScopeTest")
124 {
125 // Instantiate SS registry and scopes runtimes
126 reg_rt_ = RuntimeImpl::create(reg_id_, SS_RUNTIME_PATH);

Subscribers

People subscribed via source and target branches

to all changes: