Merge lp:~michihenning/unity-scopes-api/config-fixes into lp:unity-scopes-api/devel
- config-fixes
- Merge into devel
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Marcus Tomlinson | ||||||||
Approved revision: | 319 | ||||||||
Merged at revision: | 323 | ||||||||
Proposed branch: | lp:~michihenning/unity-scopes-api/config-fixes | ||||||||
Merge into: | lp:unity-scopes-api/devel | ||||||||
Diff against target: |
3858 lines (+1129/-643) 103 files modified
CMakeLists.txt (+13/-14) CONFIGFILES (+208/-0) RELEASE_NOTES.md (+13/-2) data/CMakeLists.txt (+2/-10) data/Registry.ini.in (+0/-10) data/Runtime.ini.in (+0/-5) data/SSRegistry.ini.in (+0/-7) data/SSRuntime.ini.in (+0/-5) data/Zmq.ini.in (+0/-3) data/libunity-scopes.pc.in (+3/-1) data/scope-registry.conf.in (+1/-1) data/smart-scopes-proxy.conf.in (+1/-1) debian/changelog (+24/-3) debian/libunity-scopes-doc.install (+1/-1) debian/libunity-scopes1.install (+3/-4) debian/libunity-scopes1.symbols (+15/-12) demo/CMakeLists.txt (+0/-1) demo/README (+1/-1) demo/Registry.ini.in (+0/-5) demo/Runtime.ini.in (+0/-2) demo/Zmq.ini.in (+0/-3) demo/click/scope-click/CMakeLists.txt (+1/-1) demo/stand-alone/CMakeLists.txt (+0/-1) demo/stand-alone/Runtime.ini.in (+0/-2) demo/stand-alone/Zmq.ini.in (+0/-3) doc/Doxyfile-devel.in (+1/-1) doc/Doxyfile.in (+1/-1) doc/index.html (+3/-3) include/CMakeLists.txt (+4/-4) include/unity/scopes/Runtime.h (+9/-0) include/unity/scopes/internal/ConfigBase.h (+13/-3) include/unity/scopes/internal/DfltConfig.h.in (+17/-3) include/unity/scopes/internal/MiddlewareBase.h (+3/-1) include/unity/scopes/internal/RegistryConfig.h (+0/-10) include/unity/scopes/internal/RegistryObject.h (+3/-2) include/unity/scopes/internal/RuntimeConfig.h (+4/-2) include/unity/scopes/internal/RuntimeImpl.h (+6/-7) include/unity/scopes/internal/ScopeConfig.h (+2/-4) include/unity/scopes/internal/smartscopes/SSConfig.h (+62/-0) include/unity/scopes/internal/smartscopes/SSRegistryObject.h (+6/-2) include/unity/scopes/internal/zmq_middleware/ZmqConfig.h (+0/-2) include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h (+6/-2) scoperegistry/CMakeLists.txt (+1/-1) scoperegistry/scoperegistry.cpp (+6/-24) scoperunner/CMakeLists.txt (+1/-1) smartscopesproxy/CMakeLists.txt (+1/-1) smartscopesproxy/smartscopesproxy.cpp (+9/-9) src/scopes/Runtime.cpp (+6/-1) src/scopes/internal/ConfigBase.cpp (+89/-7) src/scopes/internal/MiddlewareFactory.cpp (+1/-1) src/scopes/internal/RegistryConfig.cpp (+33/-33) src/scopes/internal/RegistryObject.cpp (+59/-27) src/scopes/internal/RuntimeConfig.cpp (+45/-20) src/scopes/internal/RuntimeImpl.cpp (+30/-41) src/scopes/internal/ScopeConfig.cpp (+57/-35) src/scopes/internal/smartscopes/CMakeLists.txt (+1/-0) src/scopes/internal/smartscopes/SSConfig.cpp (+129/-0) src/scopes/internal/smartscopes/SSRegistryObject.cpp (+7/-8) src/scopes/internal/zmq_middleware/ZmqConfig.cpp (+36/-15) src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp (+64/-66) src/scopes/internal/zmq_middleware/ZmqObject.cpp (+6/-33) test/gtest/scopes/Activation/Activation_test.cpp (+1/-1) test/gtest/scopes/Activation/Registry.ini.in (+0/-2) test/gtest/scopes/Activation/Zmq.ini.in (+1/-2) test/gtest/scopes/Filters/Filters_test.cpp (+1/-1) test/gtest/scopes/Filters/Registry.ini.in (+0/-2) test/gtest/scopes/Filters/Zmq.ini.in (+1/-2) test/gtest/scopes/Invocation/Invocation_test.cpp (+3/-3) test/gtest/scopes/Invocation/Registry.ini.in (+0/-2) test/gtest/scopes/Invocation/Zmq.ini.in (+1/-2) test/gtest/scopes/Registry/RegistryTest.ini.in (+0/-2) test/gtest/scopes/Registry/Registry_test.cpp (+3/-0) test/gtest/scopes/Registry/Runtime.ini.in (+1/-0) test/gtest/scopes/Registry/Zmq.ini.in (+1/-2) test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp (+1/-1) test/gtest/scopes/Runtime/Registry.ini.in (+0/-2) test/gtest/scopes/Runtime/Runtime_test.cpp (+9/-9) test/gtest/scopes/Runtime/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp (+31/-15) test/gtest/scopes/internal/RegistryConfig/Registry.ini.in (+0/-2) test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp (+0/-1) test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in (+0/-1) test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in (+0/-2) test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp (+0/-29) test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in (+1/-3) test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp (+4/-4) test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in (+0/-5) test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp (+4/-2) test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp (+33/-32) test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp (+3/-8) test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in (+0/-5) test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp (+6/-6) test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in (+1/-2) test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp (+6/-8) test/whitespace/check_whitespace.py (+1/-1) unity-scopes.map (+1/-0) |
||||||||
To merge this branch: | bzr merge lp:~michihenning/unity-scopes-api/config-fixes | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Marcus Tomlinson (community) | Approve | ||
Michal Hruby (community) | Approve | ||
Review via email:
|
Commit message
Phase 1 of the config clean-up.
Summary of changes:
- The Zmq sockets now live in /run/user/<uid>/zmq
- The config files now provide sensible defaults. It's possible to run without any config whatsoever, in which case default values are used for everything.
- scoperegistry, scoperunner, and smartscopesproxy are now installed in /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).
- Many minor clean-ups in the code for better naming, readability, typos, etc.
- Added documentation in CONFIGFILES for the various config parameters. Next step will be to integrate this into the doxygen doc and get rid of this file.
- Added a check to see whether unknown config parameters are present in a config file. That avoids problems due to silly typos, when someone mis-spells a config parameter name and then wonders why it doesn't have any effect.
- Lots of clean-up in the messages produced by the demo scopes, for consistency.
Description of the change
Phase 1 of the config clean-up.
Summary of changes:
- The Zmq sockets now live in /run/user/<uid>/zmq
- The config files now provide sensible defaults. It's possible to run without any config whatsoever, in which case default values are used for everything.
- scoperegistry, scoperunner, and smartscopesproxy are now installed in /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).
- Many minor clean-ups in the code for better naming, readability, typos, etc.
- Added documentation in CONFIGFILES for the various config parameters. Next step will be to integrate this into the doxygen doc and get rid of this file.
- Added a check to see whether unknown config parameters are present in a config file. That avoids problems due to silly typos, when someone mis-spells a config parameter name and then wonders why it doesn't have any effect.
- Lots of clean-up in the messages produced by the demo scopes, for consistency.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
Test are failing under CI because XDG_RUNTIME_DIR is not set. The code falls back to /run/user/<euid>, but /run/user doesn't exist, so the Zmq sockets can't be created.
Not sure why there is no /run/user when building under CI. I was under the impression that it should aways be there? It certainly exists on the phone and the desktop without me having to do anything special.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:304
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:306
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michal Hruby (mhr3) wrote : | # |
- scoperegistry, scoperunner, and smartscopesproxy are now installed in /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).
Why this change? There is loads of stuff in the /usr/lib/arch/, we should keep some namespacing - at least a ../arch/
77 + The default value is "$XDG_RUNTIME_
78 + set, "/run/user/
The fallback note seems out-of-date, plus $XDG_RUNTIME_DIR already includes UID.
80 +- EndpointDir.Private (string)
Can you remind you why do we even have this? Scopes will only have access to their own endpoint directory and aggregating scopes (+registry, +dash) need to access them all, so isn't this option obsolete?
111 + The default value is "@CMAKE_
116 + The default value is "@CMAKE_
Arch-specific binaries can't go into /usr/share/ (and SCOPES_
121 + by OEMs. The default value is "@CMAKE_
Shouldn't this be without the CMAKE_INSTALL_
126 + The defaul value is "$HOME/
Typos - "defaul", "sahre".
I also noticed Registry.ini's endpoint option disappeared, is it now just Zmq.ini's EndpointDir.Public + "Registry"?
422 - void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file);
423 + void run_scope(ScopeBase *const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file);
:/ Break in public API. How about overload instead?
477 +static constexpr char const* DFLT_SCOPERUNNE
478..484
Please keep in sync with the default config files.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
Thanks heaps for the thorough review!
> - scoperegistry, scoperunner, and smartscopesproxy are now installed in
> /usr/lib/<arch> (instead of a subdir of /usr/lib/arch).
>
> Why this change? There is loads of stuff in the /usr/lib/arch/, we should keep
> some namespacing - at least a ../arch/
I agree. It's /usr/lib/
> 77 + The default value is "$XDG_RUNTIME_
> XDG_RUNTIME_DIR is not
> 78 + set, "/run/user/
>
> The fallback note seems out-of-date, plus $XDG_RUNTIME_DIR already includes
> UID.
Fixed, thanks!
> 80 +- EndpointDir.Private (string)
>
> Can you remind you why do we even have this? Scopes will only have access to
> their own endpoint directory and aggregating scopes (+registry, +dash) need to
> access them all, so isn't this option obsolete?
That's a hangover from the days where I wasn't sure how we would secure access to the endpoints. I agree, we can hardwire the priv subdir.
Basically, public endpoints go into $XDG_RUNTIME_
Fixed.
> 111 + The default value is
> "@CMAKE_
> 116 + The default value is
> "@CMAKE_
That's a doc bug, thanks for that! The actual install location is under /usr/lib/<arch>
> Arch-specific binaries can't go into /usr/share/ (and SCOPES_
> == /usr/share/
> to @CMAKE_
> @CMAKE_
>
> 121 + by OEMs. The default value is
> "@CMAKE_
>
> Shouldn't this be without the CMAKE_INSTALL_
>
> 126 + The defaul value is "$HOME/
>
> Typos - "defaul", "sahre".
Fixed.
> I also noticed Registry.ini's endpoint option disappeared, is it now just
> Zmq.ini's EndpointDir.Public + "Registry"?
Yes. There is no point in having a separate config item for this.
> 422 - void run_scope(ScopeBase *const scope_base, std::string const&
> scope_ini_file);
> 423 + void run_scope(ScopeBase *const scope_base, std::string const&
> runtime_ini_file, std::string const& scope_ini_file);
>
> :/ Break in public API. How about overload instead?
Yes, that's better! Fixed, thanks!
> 477 +static constexpr char const* DFLT_SCOPERUNNE
> "@CMAKE_
> 478..484
>
> Please keep in sync with the default config files.
Yes! :-)
There is no need to install any config files now. Everything defaults to something sensible, so I've removed the installation of the config files.
I also removed an inconsistency: we used unity-scopes as a subdir for /usr/lib/<arch>, but unity-scopes-api as a subddir for /usr/share. They are both unity-scopes subdirs now.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michal Hruby (mhr3) wrote : | # |
> I also removed an inconsistency: we used unity-scopes as a subdir for
> /usr/lib/<arch>, but unity-scopes-api as a subddir for /usr/share. They are
> both unity-scopes subdirs now.
The unity-scopes directory was used as a scopes install directory though, does that mean it's now both scopes install dir AND location for our internal binaries (registries, runner)? I don't think that's a good idea.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
No, all it means is that we now have /usr/share/
The scopes are installed in /usr/lib/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:310
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:311
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michal Hruby (mhr3) wrote : | # |
> No, all it means is that we now have /usr/share/
> /usr/share/
> which is consistent with the /usr/share naming.
>
> The scopes are installed in /usr/lib/
> subdirectory for them.
In that case I have to NACK that, all the scopes are already installing in /usr/lib/
Otherwise the rest is looking good to me.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
> In that case I have to NACK that, all the scopes are already installing in
> /usr/lib/
> one of them (again!) and change their install location. (same for scopes in
> /custom).
Yes, fair enough, I've changed that.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:312
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:313
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marcus Tomlinson (marcustomlinson) wrote : | # |
Together with the few changes made to RegistryObject, I'm happy to approve.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michal Hruby (mhr3) wrote : | # |
Alright, gave this a spin on an actual device, first of all, please merge lp:~mhr3/unity-scopes-api/fix-paths so upstart is actually able to run the registries. Next, smart-scopes-proxy doesn't start and is complaining that it can't find its SSRuntime.ini.
It's also odd that we still have the DFLT_RUNTIME_INI, DFLT_REGISTRY_INI etc consts even though they don't point to real files.
Last thing is that we're putting the binaries in .../unity-scopes - imo that dir should be reserved only for scopes. Although it will only ever contain scopes that are controlled by us (and packaged as .debs), so not a big deal.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michal Hruby (mhr3) : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
> Alright, gave this a spin on an actual device, first of all, please merge
> lp:~mhr3/unity-scopes-api/fix-paths so upstart is actually able to run the
> registries
Thanks for that! One change:
- boost::
- if (path.extension() != ".ini")
+ if (configfile.
This isn't the same. The new version tests whether configfile *contains* ".ini", not whether it *ends with* ".ini". I've reverted this for the moment because avoiding boost here and doing a suffix test with std::string only is rather messy. (C++ has pretty much the most dysfunctional and unusable string class I've ever come acros...)
> . Next, smart-scopes-proxy doesn't start and is complaining that it
> can't find its SSRuntime.ini.
My apologies for missing that! I was going to do that as part of stage 2, but it looks like that's not possible, so I've added proper config for smartscopesproxy.
> It's also odd that we still have the DFLT_RUNTIME_INI, DFLT_REGISTRY_INI etc
> consts even though they don't point to real files.
The semantics are:
- if an explicit path is provided, use it.
- if no explicit path is provided, try the DFLT path.
- If that default path exists, use it, otherwise use the hard-wired default values for attributes
That way, we can run without any config files, but can still drop a config file in place if we want to change something.
> Last thing is that we're putting the binaries in .../unity-scopes - imo that
> dir should be reserved only for scopes. Although it will only ever contain
> scopes that are controlled by us (and packaged as .debs), so not a big deal.
Well, I hear you :-) I wasn't happy about the weird path we had: /usr/lib/
I don't think it matters that the three binaries are in the same directory as the scopes. We could make a bin subdirectory or some such, though. Would that improve things? (I'm open to either approach.)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:315
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marcus Tomlinson (marcustomlinson) wrote : | # |
Ok, I will re-review the latest changes. (Setting to "Needs Fixing" to remove the "Approve")
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:316
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marcus Tomlinson (marcustomlinson) wrote : | # |
1447 +// For example, if a config file contains "Smartscopes.
1448 +// of "SS.Registry.
This should read: '"Smartscopes.
1298 - RuntimeImpl::UPtr reg_rt = RuntimeImpl:
1299 + RuntimeImpl::UPtr reg_rt = RuntimeImpl:
This change breaks the smart scopes proxy. As reg_rt-
To fix this, smartscopesprox
from: "reg_mw-
to: "reg_mw-
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:317
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
> This should read: '"Smartscopes.
> "Smartscopes.
>
> [...]
>
> To fix this, smartscopesprox
> from: "reg_mw-
> to: "reg_mw-
Thanks heaps for that! I just pushed those changes.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michal Hruby (mhr3) wrote : | # |
> > Last thing is that we're putting the binaries in .../unity-scopes - imo that
> > dir should be reserved only for scopes. Although it will only ever contain
> > scopes that are controlled by us (and packaged as .debs), so not a big deal.
>
> Well, I hear you :-) I wasn't happy about the weird path we had:
> /usr/lib/
>
> I don't think it matters that the three binaries are in the same directory as
> the scopes. We could make a bin subdirectory or some such, though. Would that
> improve things? (I'm open to either approach.)
Meh, let's keep it the way it is, as I said, no biggie.
Thanks for the other fixes, looks merge-able to me now :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
> > Thanks for the other fixes, looks merge-able to me now :)
Phew, me wiping big beads of sweat off my forehead… ;-)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:318
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marcus Tomlinson (marcustomlinson) wrote : | # |
> Thanks heaps for that! I just pushed those changes.
Ah cool, thanks! Looks good to me too :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marcus Tomlinson (marcustomlinson) wrote : | # |
> FAILED: Autolanding.
ahhhh...
- 319. By Michi Henning
-
Merged devel and resolved conflict.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
> ahhhh...
There always is something…
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:319
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michi Henning (michihenning) wrote : | # |
Another beer…
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-05-02 13:26:56 +0000 | |||
3 | +++ CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
4 | @@ -171,18 +171,18 @@ | |||
5 | 171 | add_definitions(-DENABLE_IPC_MONITOR) | 171 | add_definitions(-DENABLE_IPC_MONITOR) |
6 | 172 | endif() | 172 | endif() |
7 | 173 | 173 | ||
9 | 174 | set(SCOPES_DEFAULT_CONFIGDIR ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT}) | 174 | # Scopes library name. Also used as a prefix in various places, and as a subdirectory |
10 | 175 | # name for installed files. Changing this will also require corresponding changes | ||
11 | 176 | # to the debian files. | ||
12 | 177 | set(UNITY_SCOPES_LIB unity-scopes) | ||
13 | 175 | 178 | ||
14 | 176 | # API version | 179 | # API version |
15 | 177 | set(UNITY_SCOPES_MAJOR 0) | 180 | set(UNITY_SCOPES_MAJOR 0) |
16 | 178 | set(UNITY_SCOPES_MINOR 4) | 181 | set(UNITY_SCOPES_MINOR 4) |
17 | 179 | set(UNITY_SCOPES_MICRO 4) | 182 | set(UNITY_SCOPES_MICRO 4) |
18 | 180 | 183 | ||
19 | 181 | # Scopes library | ||
20 | 182 | set(UNITY_SCOPES_LIB unity-scopes) | ||
21 | 183 | |||
22 | 184 | # Version for testing, with all symbols visible | 184 | # Version for testing, with all symbols visible |
24 | 185 | set(UNITY_SCOPES_TEST_LIB unity-scopes-test) | 185 | set(UNITY_SCOPES_TEST_LIB ${UNITY_SCOPES_LIB}-test) |
25 | 186 | 186 | ||
26 | 187 | pkg_check_modules(JSONCPP jsoncpp REQUIRED) | 187 | pkg_check_modules(JSONCPP jsoncpp REQUIRED) |
27 | 188 | 188 | ||
28 | @@ -243,9 +243,10 @@ | |||
29 | 243 | 243 | ||
30 | 244 | # Library install prefix | 244 | # Library install prefix |
31 | 245 | set(LIB_INSTALL_PREFIX lib/${CMAKE_LIBRARY_ARCHITECTURE}) | 245 | set(LIB_INSTALL_PREFIX lib/${CMAKE_LIBRARY_ARCHITECTURE}) |
32 | 246 | |||
33 | 247 | set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) | 246 | set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) |
35 | 248 | set(HDR_INSTALL_DIR include/unity-scopes-${UNITY_SCOPES_MAJOR}) | 247 | |
36 | 248 | set(LIBSUBDIR ${LIBDIR}/${UNITY_SCOPES_LIB}}) | ||
37 | 249 | set(HDR_INSTALL_DIR include/${UNITY_SCOPES_LIB}-${UNITY_SCOPES_MAJOR}) | ||
38 | 249 | 250 | ||
39 | 250 | # Tests | 251 | # Tests |
40 | 251 | include(CTest) | 252 | include(CTest) |
41 | @@ -344,7 +345,7 @@ | |||
42 | 344 | # out all symbols that (recursively) are in the unity::scopes::internal namespace, | 345 | # out all symbols that (recursively) are in the unity::scopes::internal namespace, |
43 | 345 | # except for a few exceptions that are needed by the scoperegistry, scoperunner, | 346 | # except for a few exceptions that are needed by the scoperegistry, scoperunner, |
44 | 346 | # smartscopesproxy, and any other binaries that reach into the internal namespace. | 347 | # smartscopesproxy, and any other binaries that reach into the internal namespace. |
46 | 347 | set(symbol_map "${CMAKE_SOURCE_DIR}/unity-scopes.map") | 348 | set(symbol_map "${CMAKE_SOURCE_DIR}/${UNITY_SCOPES_LIB}.map") |
47 | 348 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES | 349 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES |
48 | 349 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}") | 350 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}") |
49 | 350 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES LINK_DEPENDS ${symbol_map}) | 351 | set_target_properties(${UNITY_SCOPES_LIB} PROPERTIES LINK_DEPENDS ${symbol_map}) |
50 | @@ -368,8 +369,6 @@ | |||
51 | 368 | 369 | ||
52 | 369 | option(DEVEL_DOCS "Enable detailed Doxygen documentation") | 370 | option(DEVEL_DOCS "Enable detailed Doxygen documentation") |
53 | 370 | 371 | ||
54 | 371 | set(CMAKE_INSTALL_DOCDIR doc) | ||
55 | 372 | |||
56 | 373 | find_package(Doxygen) | 372 | find_package(Doxygen) |
57 | 374 | find_program(DOT_EXECUTABLE dot /usr/bin) | 373 | find_program(DOT_EXECUTABLE dot /usr/bin) |
58 | 375 | if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE) | 374 | if (NOT DOXYGEN_FOUND OR NOT DOT_EXECUTABLE) |
59 | @@ -382,14 +381,14 @@ | |||
60 | 382 | configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE) | 381 | configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY IMMEDIATE) |
61 | 383 | endif() | 382 | endif() |
62 | 384 | configure_file(${PROJECT_SOURCE_DIR}/doc/index.html ${PROJECT_BINARY_DIR}/doc/index.html COPYONLY) | 383 | configure_file(${PROJECT_SOURCE_DIR}/doc/index.html ${PROJECT_BINARY_DIR}/doc/index.html COPYONLY) |
64 | 385 | add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${PROJECT}/index.html | 384 | add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html |
65 | 386 | COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile | 385 | COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Doxyfile |
66 | 387 | DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile | 386 | DEPENDS ${PROJECT_BINARY_DIR}/doc/Doxyfile |
67 | 388 | ${PROJECT_SOURCE_DIR}/doc/tutorial.dox | 387 | ${PROJECT_SOURCE_DIR}/doc/tutorial.dox |
68 | 389 | ${UNITY_SCOPES_LIB_SRC} | 388 | ${UNITY_SCOPES_LIB_SRC} |
69 | 390 | ${UNITY_SCOPES_LIB_HDRS}) | 389 | ${UNITY_SCOPES_LIB_HDRS}) |
70 | 391 | add_custom_target(doc ALL | 390 | add_custom_target(doc ALL |
74 | 392 | DEPENDS ${PROJECT_BINARY_DIR}/doc/${PROJECT}/index.html) | 391 | DEPENDS ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB}/index.html) |
75 | 393 | install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${PROJECT} | 392 | install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/${UNITY_SCOPES_LIB} |
76 | 394 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_INSTALL_DOCDIR}) | 393 | DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/doc) |
77 | 395 | endif() | 394 | endif() |
78 | 396 | 395 | ||
79 | === added file 'CONFIGFILES' | |||
80 | --- CONFIGFILES 1970-01-01 00:00:00 +0000 | |||
81 | +++ CONFIGFILES 2014-05-08 12:06:13 +0000 | |||
82 | @@ -0,0 +1,208 @@ | |||
83 | 1 | This document outlines how the scopes run time is configured. | ||
84 | 2 | In general, if a recognized key is not set in a configuration | ||
85 | 3 | file, a default value applies as detailed below. | ||
86 | 4 | |||
87 | 5 | The following configuration files are used by the scopes run time: | ||
88 | 6 | |||
89 | 7 | |||
90 | 8 | Runtime.ini | ||
91 | 9 | ----------- | ||
92 | 10 | |||
93 | 11 | If no specific file is provided to the scopes run time, the default path is | ||
94 | 12 | "/usr/lib/<arch>/unity-scopes/Runtime.ini". | ||
95 | 13 | |||
96 | 14 | If that file does not exist, the default values apply. | ||
97 | 15 | |||
98 | 16 | The only recognized group in this file is [Runtime]. | ||
99 | 17 | |||
100 | 18 | The following keys are recognized: | ||
101 | 19 | |||
102 | 20 | - Registry.Identity (string) | ||
103 | 21 | |||
104 | 22 | The identity of the local registry. If not set, the default value is "Registry". | ||
105 | 23 | To run a scope without a registry, for example, using the scoperunner for testing, the identity | ||
106 | 24 | can be the empty string. | ||
107 | 25 | |||
108 | 26 | - Registry.ConfigFile (string) | ||
109 | 27 | |||
110 | 28 | The path to the registry configuration file. The default value is | ||
111 | 29 | "/usr/lib/<arch>/unity-scopes/Registry.ini". | ||
112 | 30 | |||
113 | 31 | - Smartscopes.Registry.Identity (string) | ||
114 | 32 | |||
115 | 33 | The identity of the remote registry. If not set, the default value is "SSRegistry". | ||
116 | 34 | Setting this value explicitly to the empty string disables use of the remote registry. | ||
117 | 35 | |||
118 | 36 | - Smartscopes.ConfigFile (string) | ||
119 | 37 | |||
120 | 38 | The path to the smartscopes configuration file. The default value is | ||
121 | 39 | "/usr/lib/<arch>/unity-scopes/Smartscopes.ini". | ||
122 | 40 | |||
123 | 41 | - Default.Middleware (string) | ||
124 | 42 | |||
125 | 43 | The middleware to be used by default. The default value is "Zmq". | ||
126 | 44 | |||
127 | 45 | - <middleware>.ConfigFile | ||
128 | 46 | |||
129 | 47 | The path to the configuration file for the middleware, with the value of | ||
130 | 48 | Default.Middleware substituted for <middleware>, For example, | ||
131 | 49 | |||
132 | 50 | Zmq.ConfigFile = <path> | ||
133 | 51 | |||
134 | 52 | The default value is "/usr/lib/<arch>/unity-scopes/Zmq.ini". | ||
135 | 53 | |||
136 | 54 | |||
137 | 55 | Zmq.ini | ||
138 | 56 | ------- | ||
139 | 57 | |||
140 | 58 | If no specific file is provided to the scopes run time, the default path is | ||
141 | 59 | "/usr/lib/<arch>/unity-scopes/Zmq.ini". | ||
142 | 60 | |||
143 | 61 | If that file does not exist, the default values for keys apply. | ||
144 | 62 | |||
145 | 63 | The only recognized group in this file is [Zmq]. | ||
146 | 64 | |||
147 | 65 | The following keys are recognized: | ||
148 | 66 | |||
149 | 67 | - EndpointDir (string) | ||
150 | 68 | |||
151 | 69 | The directory in which the public endpoint of a scope (or the registry) is created. | ||
152 | 70 | This endpoint must be accessible to any process. | ||
153 | 71 | |||
154 | 72 | The default value is "$XDG_RUNTIME_DIR/zmq". If XDG_RUNTIME_DIR is not | ||
155 | 73 | set, initialization fails. | ||
156 | 74 | |||
157 | 75 | Private endpoints are created in "<EndpointDir.Public>/priv". | ||
158 | 76 | |||
159 | 77 | |||
160 | 78 | Registry.ini | ||
161 | 79 | ------------ | ||
162 | 80 | |||
163 | 81 | If no specific file is provided to the scopes run time, the default path is | ||
164 | 82 | "/usr/lib/<arch>/unity-scopes/Registry.ini". | ||
165 | 83 | |||
166 | 84 | If that file does not exist, the default values for keys apply. | ||
167 | 85 | |||
168 | 86 | The only recognized group in this file is [Registry]. | ||
169 | 87 | |||
170 | 88 | The following keys are recognized: | ||
171 | 89 | |||
172 | 90 | - Middleware | ||
173 | 91 | |||
174 | 92 | The middleware used by the registry, such as "Zmq". The default value is "Zmq". | ||
175 | 93 | |||
176 | 94 | - <Middleware>.ConfigFile | ||
177 | 95 | |||
178 | 96 | <Middleware> must match the value of the Middleware key, for example: | ||
179 | 97 | |||
180 | 98 | Zmq.Middleware = path/to/SomeFile.ini | ||
181 | 99 | |||
182 | 100 | - Scoperunner.Path | ||
183 | 101 | |||
184 | 102 | The path to the scoperunner executable. The path must be an absolute path. | ||
185 | 103 | The default value is "/usr/lib/<arch>/scoperunner". | ||
186 | 104 | |||
187 | 105 | - Scope.InstallDir | ||
188 | 106 | |||
189 | 107 | The directory in which to look for subdirectories containing scope .so and .ini files. | ||
190 | 108 | The default value is "/usr/lib/<arch>/unity-scopes". | ||
191 | 109 | |||
192 | 110 | - OEM.InstallDir | ||
193 | 111 | |||
194 | 112 | The directory in which to look for subdirectories containing scope .so and .ini files added | ||
195 | 113 | by OEMs. The default value is "/custom/usr/lib/<arch>/unity-scopes". | ||
196 | 114 | |||
197 | 115 | - Click.InstallDir | ||
198 | 116 | |||
199 | 117 | The directory in which to look for subdirectories containing scopes installed from click packages. | ||
200 | 118 | The default value is "$HOME/.local/share/unity-scopes". | ||
201 | 119 | |||
202 | 120 | |||
203 | 121 | Smartscopes.ini | ||
204 | 122 | -------------- | ||
205 | 123 | |||
206 | 124 | If no specific file is provided to the scopes run time, the default path is | ||
207 | 125 | "/usr/lib/<arch>/unity-scopes/Smartscopes.ini". | ||
208 | 126 | |||
209 | 127 | If that file does not exist, the default values for keys apply. | ||
210 | 128 | |||
211 | 129 | The only recognized group in this file is [Smartscopes]. | ||
212 | 130 | |||
213 | 131 | The following keys are recognized: | ||
214 | 132 | |||
215 | 133 | - Http.Reply.Timeout | ||
216 | 134 | |||
217 | 135 | The amount of time (in seconds) to wait for a reply from the smartscopes server. | ||
218 | 136 | |||
219 | 137 | - Registry.Refresh.Rate | ||
220 | 138 | |||
221 | 139 | The amount of time (in seconds) between a metadata refresh from the smartscopes server. | ||
222 | 140 | |||
223 | 141 | - Registry.Refresh.Fail.Timeout | ||
224 | 142 | |||
225 | 143 | The amount of time (in seconds) in between retry attempts if a metadata refresh from | ||
226 | 144 | the smartscopes server fails. | ||
227 | 145 | |||
228 | 146 | - Scope.Identity | ||
229 | 147 | |||
230 | 148 | The identity for proxy scope provided by smartscopesproxy. | ||
231 | 149 | The default value is "SmartScope". | ||
232 | 150 | |||
233 | 151 | |||
234 | 152 | <scope_id>.ini | ||
235 | 153 | -------------- | ||
236 | 154 | |||
237 | 155 | The recognized groups in this file are: | ||
238 | 156 | |||
239 | 157 | - ScopeConfig | ||
240 | 158 | - Appearance | ||
241 | 159 | |||
242 | 160 | The following keys are recognized in the ScopeConfig group: | ||
243 | 161 | |||
244 | 162 | - Override | ||
245 | 163 | |||
246 | 164 | Determines whether an OEM scope is allowed to override a Canonical scope. This key is used only by Canonical | ||
247 | 165 | scopes. If true, the Canonical scope can be replaced by an OEM scope with the same ID. The default value | ||
248 | 166 | is false. | ||
249 | 167 | |||
250 | 168 | For OEM scopes and click scopes, the setting of this key is ignored. | ||
251 | 169 | |||
252 | 170 | - DisplayName | ||
253 | 171 | |||
254 | 172 | The display name of a scope (mandatory, localizable). | ||
255 | 173 | |||
256 | 174 | - Description | ||
257 | 175 | |||
258 | 176 | The description of a scope (mandatory, localizable). | ||
259 | 177 | |||
260 | 178 | - Author | ||
261 | 179 | |||
262 | 180 | The author of the scope (mandatory). | ||
263 | 181 | |||
264 | 182 | - Art | ||
265 | 183 | |||
266 | 184 | Artwork to be shown for the scope. The default value is the empty string. | ||
267 | 185 | |||
268 | 186 | - Icon | ||
269 | 187 | |||
270 | 188 | The icon to be shown for the scope. The default value is the empty string. | ||
271 | 189 | |||
272 | 190 | - SearchHint | ||
273 | 191 | |||
274 | 192 | A search hint for on-screen display (localizable). The default value is the empty string. | ||
275 | 193 | |||
276 | 194 | - HotKey | ||
277 | 195 | |||
278 | 196 | The hot key for the scope. The default value is the empty string. | ||
279 | 197 | |||
280 | 198 | - Invisible | ||
281 | 199 | |||
282 | 200 | Whether the scope is hidden in the UI. The default value is false. | ||
283 | 201 | |||
284 | 202 | - ScopeRunner | ||
285 | 203 | |||
286 | 204 | The path to a custom scoperunner binary. If not set, the default scoperunner is used. | ||
287 | 205 | |||
288 | 206 | The following keys are recognized in the Appearance group: | ||
289 | 207 | |||
290 | 208 | - TODO: document this | ||
291 | 0 | 209 | ||
292 | === modified file 'RELEASE_NOTES.md' | |||
293 | --- RELEASE_NOTES.md 2014-05-06 11:32:05 +0000 | |||
294 | +++ RELEASE_NOTES.md 2014-05-08 12:06:13 +0000 | |||
295 | @@ -3,8 +3,19 @@ | |||
296 | 3 | 3 | ||
297 | 4 | Changes in version 0.4.4 | 4 | Changes in version 0.4.4 |
298 | 5 | ======================== | 5 | ======================== |
301 | 6 | * The register_annotation() method of SearchReply is now deprecated - push(Annotation const&) should be used instead. | 6 | - The register_annotation() method of SearchReply is now deprecated - push(Annotation const&) should |
302 | 7 | The display order of annotations with respect to results and categories got updated in the documentation of that method. | 7 | be used instead. The display order of annotations with respect to results and categories |
303 | 8 | got updated in the documentation of that method. | ||
304 | 9 | |||
305 | 10 | - Simplified configuration with sensible defaults for all values. | ||
306 | 11 | |||
307 | 12 | - scoperunner, scoperegistry, and smartscopesproxy are now install in /usr/lib/<arch> | ||
308 | 13 | (instead of in a subdirectory of <arch>). | ||
309 | 14 | |||
310 | 15 | - Runtime::run_scope() now has an overload to accept a path to Runtime.ini. If no file name is passed, | ||
311 | 16 | the system-wide Runtime.ini is used. | ||
312 | 17 | |||
313 | 18 | - UNIX domain sockets for Zmq are now placed under /user/run/<uid>/zmq by default. | ||
314 | 8 | 19 | ||
315 | 9 | Changes in version 0.4.2 | 20 | Changes in version 0.4.2 |
316 | 10 | ======================== | 21 | ======================== |
317 | 11 | 22 | ||
318 | === modified file 'data/CMakeLists.txt' | |||
319 | --- data/CMakeLists.txt 2014-03-06 10:55:17 +0000 | |||
320 | +++ data/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
321 | @@ -2,14 +2,6 @@ | |||
322 | 2 | configure_file(lib${UNITY_SCOPES_LIB}.pc.in lib${UNITY_SCOPES_LIB}.pc @ONLY) | 2 | configure_file(lib${UNITY_SCOPES_LIB}.pc.in lib${UNITY_SCOPES_LIB}.pc @ONLY) |
323 | 3 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${UNITY_SCOPES_LIB}.pc DESTINATION ${LIB_INSTALL_PREFIX}/pkgconfig) | 3 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${UNITY_SCOPES_LIB}.pc DESTINATION ${LIB_INSTALL_PREFIX}/pkgconfig) |
324 | 4 | 4 | ||
325 | 5 | # scope framework config files | ||
326 | 6 | configure_file(Runtime.ini.in Runtime.ini @ONLY) | ||
327 | 7 | configure_file(Registry.ini.in Registry.ini @ONLY) | ||
328 | 8 | configure_file(Zmq.ini.in Zmq.ini @ONLY) | ||
329 | 9 | configure_file(SSRuntime.ini.in SSRuntime.ini @ONLY) | ||
330 | 10 | configure_file(SSRegistry.ini.in SSRegistry.ini @ONLY) | ||
331 | 11 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini ${CMAKE_CURRENT_BINARY_DIR}/Registry.ini ${CMAKE_CURRENT_BINARY_DIR}/SSRuntime.ini ${CMAKE_CURRENT_BINARY_DIR}/SSRegistry.ini ${CMAKE_CURRENT_BINARY_DIR}/Zmq.ini DESTINATION ${SCOPES_DEFAULT_CONFIGDIR}) | ||
332 | 12 | |||
333 | 13 | # upstart job for smart scopes proxy | 5 | # upstart job for smart scopes proxy |
334 | 14 | configure_file(smart-scopes-proxy.conf.in smart-scopes-proxy.conf @ONLY) | 6 | configure_file(smart-scopes-proxy.conf.in smart-scopes-proxy.conf @ONLY) |
335 | 15 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart-scopes-proxy.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) | 7 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smart-scopes-proxy.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) |
336 | @@ -21,6 +13,6 @@ | |||
337 | 21 | # Empty directory for scopes to put their conf files into | 13 | # Empty directory for scopes to put their conf files into |
338 | 22 | # If we start install our own conf files here, this can be | 14 | # If we start install our own conf files here, this can be |
339 | 23 | # removed (installing files implicitly creates the subdirs) | 15 | # removed (installing files implicitly creates the subdirs) |
342 | 24 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes) | 16 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}) |
343 | 25 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes | 17 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB} |
344 | 26 | DESTINATION ${CMAKE_INSTALL_LIBDIR}) | 18 | DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
345 | 27 | 19 | ||
346 | === removed file 'data/Registry.ini.in' | |||
347 | --- data/Registry.ini.in 2014-03-06 10:55:17 +0000 | |||
348 | +++ data/Registry.ini.in 1970-01-01 00:00:00 +0000 | |||
349 | @@ -1,10 +0,0 @@ | |||
350 | 1 | [Registry] | ||
351 | 2 | Middleware = Zmq | ||
352 | 3 | Zmq.Endpoint = ipc:///tmp/Registry | ||
353 | 4 | Zmq.EndpointDir = /tmp | ||
354 | 5 | Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini | ||
355 | 6 | Scope.InstallDir = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes | ||
356 | 7 | OEM.InstallDir = /custom/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity-scopes | ||
357 | 8 | Scoperunner.Path = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner | ||
358 | 9 | SS.Registry.Identity = SSRegistry | ||
359 | 10 | SS.Registry.Endpoint = ipc:///tmp/SSRegistry | ||
360 | 11 | 0 | ||
361 | === removed file 'data/Runtime.ini.in' | |||
362 | --- data/Runtime.ini.in 2013-12-13 11:25:44 +0000 | |||
363 | +++ data/Runtime.ini.in 1970-01-01 00:00:00 +0000 | |||
364 | @@ -1,5 +0,0 @@ | |||
365 | 1 | [Runtime] | ||
366 | 2 | Registry.Identity = Registry | ||
367 | 3 | Registry.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Registry.ini | ||
368 | 4 | Default.Middleware = Zmq | ||
369 | 5 | Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini | ||
370 | 6 | 0 | ||
371 | === removed file 'data/SSRegistry.ini.in' | |||
372 | --- data/SSRegistry.ini.in 2014-03-06 10:55:17 +0000 | |||
373 | +++ data/SSRegistry.ini.in 1970-01-01 00:00:00 +0000 | |||
374 | @@ -1,7 +0,0 @@ | |||
375 | 1 | [Registry] | ||
376 | 2 | Middleware = Zmq | ||
377 | 3 | Zmq.Endpoint = ipc:///tmp/SSRegistry | ||
378 | 4 | Zmq.EndpointDir = /tmp | ||
379 | 5 | Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini | ||
380 | 6 | Scope.InstallDir = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/unity-scopes | ||
381 | 7 | Scoperunner.Path = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperunner/scoperunner | ||
382 | 8 | 0 | ||
383 | === removed file 'data/SSRuntime.ini.in' | |||
384 | --- data/SSRuntime.ini.in 2014-02-04 13:57:56 +0000 | |||
385 | +++ data/SSRuntime.ini.in 1970-01-01 00:00:00 +0000 | |||
386 | @@ -1,5 +0,0 @@ | |||
387 | 1 | [Runtime] | ||
388 | 2 | Registry.Identity = SSRegistry | ||
389 | 3 | Registry.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/SSRegistry.ini | ||
390 | 4 | Default.Middleware = Zmq | ||
391 | 5 | Zmq.ConfigFile = @CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Zmq.ini | ||
392 | 6 | 0 | ||
393 | === removed file 'data/Zmq.ini.in' | |||
394 | --- data/Zmq.ini.in 2013-11-29 12:20:25 +0000 | |||
395 | +++ data/Zmq.ini.in 1970-01-01 00:00:00 +0000 | |||
396 | @@ -1,3 +0,0 @@ | |||
397 | 1 | [Zmq] | ||
398 | 2 | EndpointDir.Public = /tmp | ||
399 | 3 | EndpointDir.Private = /tmp | ||
400 | 4 | 0 | ||
401 | === modified file 'data/libunity-scopes.pc.in' | |||
402 | --- data/libunity-scopes.pc.in 2014-03-06 10:58:11 +0000 | |||
403 | +++ data/libunity-scopes.pc.in 2014-05-08 12:06:13 +0000 | |||
404 | @@ -19,7 +19,9 @@ | |||
405 | 19 | prefix=@CMAKE_INSTALL_PREFIX@ | 19 | prefix=@CMAKE_INSTALL_PREFIX@ |
406 | 20 | includedir=${prefix}/@HDR_INSTALL_DIR@ | 20 | includedir=${prefix}/@HDR_INSTALL_DIR@ |
407 | 21 | libdir=${prefix}/@LIBDIR@ | 21 | libdir=${prefix}/@LIBDIR@ |
409 | 22 | scopesdir=${libdir}/unity-scopes | 22 | scopesdir=${libdir}/@UNITY_SCOPES_LIB@ |
410 | 23 | scoperegistry_bin=${libdir}/@UNITY_SCOPES_LIB@/scoperegistry | ||
411 | 24 | scoperunner_bin=${libdir}/@UNITY_SCOPES_LIB@/scoperunner | ||
412 | 23 | 25 | ||
413 | 24 | Name: lib@UNITY_SCOPES_LIB@ | 26 | Name: lib@UNITY_SCOPES_LIB@ |
414 | 25 | Description: Unity Scopes API library | 27 | Description: Unity Scopes API library |
415 | 26 | 28 | ||
416 | === modified file 'data/scope-registry.conf.in' | |||
417 | --- data/scope-registry.conf.in 2014-02-12 10:21:41 +0000 | |||
418 | +++ data/scope-registry.conf.in 2014-05-08 12:06:13 +0000 | |||
419 | @@ -7,4 +7,4 @@ | |||
420 | 7 | respawn | 7 | respawn |
421 | 8 | respawn limit 10 60 | 8 | respawn limit 10 60 |
422 | 9 | 9 | ||
424 | 10 | exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/scoperegistry/scoperegistry | 10 | exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@UNITY_SCOPES_LIB@/scoperegistry |
425 | 11 | 11 | ||
426 | === modified file 'data/smart-scopes-proxy.conf.in' | |||
427 | --- data/smart-scopes-proxy.conf.in 2014-03-06 14:05:06 +0000 | |||
428 | +++ data/smart-scopes-proxy.conf.in 2014-05-08 12:06:13 +0000 | |||
429 | @@ -9,4 +9,4 @@ | |||
430 | 9 | 9 | ||
431 | 10 | expect stop | 10 | expect stop |
432 | 11 | 11 | ||
434 | 12 | exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/smartscopesproxy/smartscopesproxy upstart | 12 | exec @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@UNITY_SCOPES_LIB@/smartscopesproxy upstart |
435 | 13 | 13 | ||
436 | === modified file 'debian/changelog' | |||
437 | --- debian/changelog 2014-05-02 13:26:56 +0000 | |||
438 | +++ debian/changelog 2014-05-08 12:06:13 +0000 | |||
439 | @@ -1,10 +1,31 @@ | |||
440 | 1 | unity-scopes-api (0.4.4-0ubuntu1) UNRELEASED; urgency=low | 1 | unity-scopes-api (0.4.4-0ubuntu1) UNRELEASED; urgency=low |
441 | 2 | 2 | ||
444 | 3 | * Implemented to_uri() and from_uri() conversions for CannedQuery. | 3 | [ Michi Henning ] |
445 | 4 | * Ship scopes-client in libunity-scopes-cli package. | 4 | * Simplified configuration files. |
446 | 5 | * Removed SS.Registry.Endpoint from Runtime.ini. | ||
447 | 6 | * Replaced SS.Registry.Identity with Smartscopes.Registry.Identity | ||
448 | 7 | * Added documentation for configuration parameters (see CONFIGFILES in | ||
449 | 8 | the root of the source tree) | ||
450 | 9 | * Runtime::run_scope() now has an overload to accept a path to Runtime.ini. | ||
451 | 10 | If no file name is passed, the system-wide Runtime.ini is used. | ||
452 | 11 | * UNIX domain sockets for Zmq are now placed under $XDG_RUNTIME_DIR/zmq. | ||
453 | 12 | * Install location for things under /usr/share is now unity-scopes instead | ||
454 | 13 | of unity-scopes-api. | ||
455 | 14 | |||
456 | 15 | [ Pawel Stolowski ] | ||
457 | 5 | * Renamed SearchReply::register_annotation() to push(). | 16 | * Renamed SearchReply::register_annotation() to push(). |
458 | 6 | 17 | ||
460 | 7 | -- Pawel Stolowski <pawel.stolowski@ubuntu.com> Tue, 29 Apr 2014 13:39:03 +0200 | 18 | -- Michi Henning <michi.henning@canonical.com> Thu, 01 May 2014 13:55:48 +1000 |
461 | 19 | |||
462 | 20 | unity-scopes-api (0.4.3+14.10.20140502.1-0ubuntu1) utopic; urgency=low | ||
463 | 21 | |||
464 | 22 | [ Tarmac ] | ||
465 | 23 | * Sync with devel branch. | ||
466 | 24 | |||
467 | 25 | [ Ubuntu daily release ] | ||
468 | 26 | * New rebuild forced | ||
469 | 27 | |||
470 | 28 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 02 May 2014 14:44:05 +0000 | ||
471 | 8 | 29 | ||
472 | 9 | unity-scopes-api (0.4.3+14.10.20140428-0ubuntu1) utopic; urgency=low | 30 | unity-scopes-api (0.4.3+14.10.20140428-0ubuntu1) utopic; urgency=low |
473 | 10 | 31 | ||
474 | 11 | 32 | ||
475 | === modified file 'debian/libunity-scopes-doc.install' | |||
476 | --- debian/libunity-scopes-doc.install 2014-02-04 09:50:11 +0000 | |||
477 | +++ debian/libunity-scopes-doc.install 2014-05-08 12:06:13 +0000 | |||
478 | @@ -1,1 +1,1 @@ | |||
480 | 1 | usr/share/doc/unity-scopes-api/* | 1 | usr/share/doc/unity-scopes/* |
481 | 2 | 2 | ||
482 | === modified file 'debian/libunity-scopes1.install' | |||
483 | --- debian/libunity-scopes1.install 2014-04-03 15:04:11 +0000 | |||
484 | +++ debian/libunity-scopes1.install 2014-05-08 12:06:13 +0000 | |||
485 | @@ -1,7 +1,6 @@ | |||
486 | 1 | usr/lib/*/libunity-scopes.so.* | 1 | usr/lib/*/libunity-scopes.so.* |
487 | 2 | usr/lib/*/unity-scopes | 2 | usr/lib/*/unity-scopes |
492 | 3 | usr/lib/*/scoperegistry/* | 3 | usr/lib/*/unity-scopes/scoperegistry |
493 | 4 | usr/lib/*/scoperunner/* | 4 | usr/lib/*/unity-scopes/scoperunner |
494 | 5 | usr/lib/*/smartscopesproxy/* | 5 | usr/lib/*/unity-scopes/smartscopesproxy |
491 | 6 | usr/share/unity-scopes-api/*.ini | ||
495 | 7 | usr/share/upstart/sessions/*.conf | 6 | usr/share/upstart/sessions/*.conf |
496 | 8 | 7 | ||
497 | === modified file 'debian/libunity-scopes1.symbols' | |||
498 | --- debian/libunity-scopes1.symbols 2014-05-06 11:25:36 +0000 | |||
499 | +++ debian/libunity-scopes1.symbols 2014-05-08 12:06:13 +0000 | |||
500 | @@ -283,7 +283,8 @@ | |||
501 | 283 | (c++)"unity::scopes::Runtime::create_scope_runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140324 | 283 | (c++)"unity::scopes::Runtime::create_scope_runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140324 |
502 | 284 | (c++)"unity::scopes::Runtime::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 284 | (c++)"unity::scopes::Runtime::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
503 | 285 | (c++)"unity::scopes::Runtime::destroy()@Base" 0.4.0+14.04.20140312.1 | 285 | (c++)"unity::scopes::Runtime::destroy()@Base" 0.4.0+14.04.20140312.1 |
505 | 286 | (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2 | 286 | (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
506 | 287 | (c++)"unity::scopes::Runtime::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme | ||
507 | 287 | (c++)"unity::scopes::Runtime::Runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 288 | (c++)"unity::scopes::Runtime::Runtime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
508 | 288 | (c++)"unity::scopes::Runtime::~Runtime()@Base" 0.4.0+14.04.20140312.1 | 289 | (c++)"unity::scopes::Runtime::~Runtime()@Base" 0.4.0+14.04.20140312.1 |
509 | 289 | (c++)"unity::scopes::Variant::deserialize_json(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.3+14.10.20140428 | 290 | (c++)"unity::scopes::Variant::deserialize_json(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.3+14.10.20140428 |
510 | @@ -366,7 +367,8 @@ | |||
511 | 366 | (c++)"unity::scopes::Registry::~Registry()@Base" 0.4.0+14.04.20140312.1 | 367 | (c++)"unity::scopes::Registry::~Registry()@Base" 0.4.0+14.04.20140312.1 |
512 | 367 | (c++)"unity::scopes::internal::RuntimeImpl::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 368 | (c++)"unity::scopes::internal::RuntimeImpl::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
513 | 368 | (c++)"unity::scopes::internal::RuntimeImpl::destroy()@Base" 0.4.0+14.04.20140312.1 | 369 | (c++)"unity::scopes::internal::RuntimeImpl::destroy()@Base" 0.4.0+14.04.20140312.1 |
515 | 369 | (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2 | 370 | (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
516 | 371 | (c++)"unity::scopes::internal::RuntimeImpl::run_scope(unity::scopes::ScopeBase*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme | ||
517 | 370 | (c++)"unity::scopes::internal::RuntimeImpl::RuntimeImpl(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 372 | (c++)"unity::scopes::internal::RuntimeImpl::RuntimeImpl(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
518 | 371 | (c++)"unity::scopes::internal::RuntimeImpl::~RuntimeImpl()@Base" 0.4.0+14.04.20140312.1 | 373 | (c++)"unity::scopes::internal::RuntimeImpl::~RuntimeImpl()@Base" 0.4.0+14.04.20140312.1 |
519 | 372 | (c++)"unity::scopes::internal::ScopeConfig::ScopeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 374 | (c++)"unity::scopes::internal::ScopeConfig::ScopeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
520 | @@ -395,14 +397,14 @@ | |||
521 | 395 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_remote_scopes()@Base" 0.4.0+14.04.20140312.1 | 397 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_remote_scopes()@Base" 0.4.0+14.04.20140312.1 |
522 | 396 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::add(unity::scopes::internal::smartscopes::RemoteScope const&, unity::scopes::ScopeMetadata const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unity::scopes::ScopeMetadata, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unity::scopes::ScopeMetadata> > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&)@Base" 0.4.0+14.04.20140324 | 398 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::add(unity::scopes::internal::smartscopes::RemoteScope const&, unity::scopes::ScopeMetadata const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unity::scopes::ScopeMetadata, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unity::scopes::ScopeMetadata> > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&)@Base" 0.4.0+14.04.20140324 |
523 | 397 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::locate(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 399 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::locate(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
525 | 398 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::SSRegistryObject(std::shared_ptr<unity::scopes::internal::MiddlewareBase>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0.4.0+14.04.20140312.1 | 400 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::SSRegistryObject(std::shared_ptr<unity::scopes::internal::MiddlewareBase>, unity::scopes::internal::smartscopes::SSConfig const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0replaceme |
526 | 399 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::~SSRegistryObject()@Base" 0.4.0+14.04.20140312.1 | 401 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::~SSRegistryObject()@Base" 0.4.0+14.04.20140312.1 |
528 | 400 | (c++)"unity::scopes::internal::RuntimeConfig::RUNTIME_CONFIG_GROUP@Base" 0.4.2+14.04.20140404.2 | 402 | (c++)"unity::scopes::internal::smartscopes::SSConfig::SSConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0replaceme |
529 | 403 | (c++)"unity::scopes::internal::smartscopes::SSConfig::~SSConfig()@Base" 0replaceme | ||
530 | 401 | (c++)"unity::scopes::internal::RuntimeConfig::RuntimeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2 | 404 | (c++)"unity::scopes::internal::RuntimeConfig::RuntimeConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.2+14.04.20140404.2 |
531 | 402 | (c++)"unity::scopes::internal::RuntimeConfig::~RuntimeConfig()@Base" 0.4.2+14.04.20140404.2 | 405 | (c++)"unity::scopes::internal::RuntimeConfig::~RuntimeConfig()@Base" 0.4.2+14.04.20140404.2 |
532 | 403 | (c++)"unity::scopes::internal::MiddlewareBase::MiddlewareBase(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1 | 406 | (c++)"unity::scopes::internal::MiddlewareBase::MiddlewareBase(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1 |
533 | 404 | (c++)"unity::scopes::internal::MiddlewareBase::~MiddlewareBase()@Base" 0.4.0+14.04.20140312.1 | 407 | (c++)"unity::scopes::internal::MiddlewareBase::~MiddlewareBase()@Base" 0.4.0+14.04.20140312.1 |
534 | 405 | (c++)"unity::scopes::internal::RegistryConfig::REGISTRY_CONFIG_GROUP@Base" 0.4.0+14.04.20140312.1 | ||
535 | 406 | (c++)"unity::scopes::internal::RegistryConfig::RegistryConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 | 408 | (c++)"unity::scopes::internal::RegistryConfig::RegistryConfig(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1 |
536 | 407 | (c++)"unity::scopes::internal::RegistryConfig::~RegistryConfig()@Base" 0.4.0+14.04.20140312.1 | 409 | (c++)"unity::scopes::internal::RegistryConfig::~RegistryConfig()@Base" 0.4.0+14.04.20140312.1 |
537 | 408 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::update_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState)@Base" 0.4.2+14.04.20140404.2 | 410 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::update_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState)@Base" 0.4.2+14.04.20140404.2 |
538 | @@ -605,16 +607,15 @@ | |||
539 | 605 | (c++)"unity::scopes::Category::title() const@Base" 0.4.0+14.04.20140312.1 | 607 | (c++)"unity::scopes::Category::title() const@Base" 0.4.0+14.04.20140312.1 |
540 | 606 | (c++)"unity::scopes::Category::serialize() const@Base" 0.4.0+14.04.20140312.1 | 608 | (c++)"unity::scopes::Category::serialize() const@Base" 0.4.0+14.04.20140312.1 |
541 | 607 | (c++)"unity::scopes::internal::RuntimeImpl::async_pool() const@Base" 0.4.3+14.10.20140428 | 609 | (c++)"unity::scopes::internal::RuntimeImpl::async_pool() const@Base" 0.4.3+14.10.20140428 |
542 | 608 | (c++)"unity::scopes::internal::RuntimeImpl::configfile() const@Base" 0.4.2+14.04.20140404.2 | ||
543 | 609 | (c++)"unity::scopes::internal::RuntimeImpl::future_queue() const@Base" 0.4.3+14.10.20140428 | 610 | (c++)"unity::scopes::internal::RuntimeImpl::future_queue() const@Base" 0.4.3+14.10.20140428 |
544 | 610 | (c++)"unity::scopes::internal::RuntimeImpl::reply_reaper() const@Base" 0.4.0+14.04.20140312.1 | 611 | (c++)"unity::scopes::internal::RuntimeImpl::reply_reaper() const@Base" 0.4.0+14.04.20140312.1 |
545 | 612 | (c++)"unity::scopes::internal::RuntimeImpl::ss_configfile() const@Base" 0replaceme | ||
546 | 611 | (c++)"unity::scopes::internal::RuntimeImpl::waiter_thread(std::shared_ptr<unity::scopes::internal::ThreadSafeQueue<std::future<void> > > const&) const@Base" 0.4.3+14.10.20140428 | 613 | (c++)"unity::scopes::internal::RuntimeImpl::waiter_thread(std::shared_ptr<unity::scopes::internal::ThreadSafeQueue<std::future<void> > > const&) const@Base" 0.4.3+14.10.20140428 |
547 | 612 | (c++)"unity::scopes::internal::RuntimeImpl::proxy_to_string(std::shared_ptr<unity::scopes::Object> const&) const@Base" 0.4.0+14.04.20140312.1 | 614 | (c++)"unity::scopes::internal::RuntimeImpl::proxy_to_string(std::shared_ptr<unity::scopes::Object> const&) const@Base" 0.4.0+14.04.20140312.1 |
548 | 613 | (c++)"unity::scopes::internal::RuntimeImpl::string_to_proxy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1 | 615 | (c++)"unity::scopes::internal::RuntimeImpl::string_to_proxy(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1 |
549 | 614 | (c++)"unity::scopes::internal::RuntimeImpl::registry_endpoint() const@Base" 0.4.0+14.04.20140312.1 | ||
550 | 615 | (c++)"unity::scopes::internal::RuntimeImpl::registry_identity() const@Base" 0.4.0+14.04.20140312.1 | 616 | (c++)"unity::scopes::internal::RuntimeImpl::registry_identity() const@Base" 0.4.0+14.04.20140312.1 |
551 | 616 | (c++)"unity::scopes::internal::RuntimeImpl::registry_configfile() const@Base" 0.4.0+14.04.20140312.1 | 617 | (c++)"unity::scopes::internal::RuntimeImpl::registry_configfile() const@Base" 0.4.0+14.04.20140312.1 |
553 | 617 | (c++)"unity::scopes::internal::RuntimeImpl::registry_endpointdir() const@Base" 0.4.0+14.04.20140312.1 | 618 | (c++)"unity::scopes::internal::RuntimeImpl::ss_registry_identity() const@Base" 0replaceme |
554 | 618 | (c++)"unity::scopes::internal::RuntimeImpl::factory() const@Base" 0.4.0+14.04.20140312.1 | 619 | (c++)"unity::scopes::internal::RuntimeImpl::factory() const@Base" 0.4.0+14.04.20140312.1 |
555 | 619 | (c++)"unity::scopes::internal::RuntimeImpl::registry() const@Base" 0.4.0+14.04.20140312.1 | 620 | (c++)"unity::scopes::internal::RuntimeImpl::registry() const@Base" 0.4.0+14.04.20140312.1 |
556 | 620 | (c++)"unity::scopes::internal::RuntimeImpl::scope_id() const@Base" 0.4.0+14.04.20140312.1 | 621 | (c++)"unity::scopes::internal::RuntimeImpl::scope_id() const@Base" 0.4.0+14.04.20140312.1 |
557 | @@ -637,21 +638,23 @@ | |||
558 | 637 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_ssclient() const@Base" 0.4.0+14.04.20140312.1 | 638 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::get_ssclient() const@Base" 0.4.0+14.04.20140312.1 |
559 | 638 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::list() const@Base" 0.4.2+14.04.20140404.2 | 639 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::list() const@Base" 0.4.2+14.04.20140404.2 |
560 | 639 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::has_scope(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1 | 640 | (c++)"unity::scopes::internal::smartscopes::SSRegistryObject::has_scope(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@Base" 0.4.0+14.04.20140312.1 |
561 | 641 | (c++)"unity::scopes::internal::smartscopes::SSConfig::scope_identity() const@Base" 0replaceme | ||
562 | 642 | (c++)"unity::scopes::internal::smartscopes::SSConfig::reg_refresh_rate() const@Base" 0replaceme | ||
563 | 643 | (c++)"unity::scopes::internal::smartscopes::SSConfig::http_reply_timeout() const@Base" 0replaceme | ||
564 | 644 | (c++)"unity::scopes::internal::smartscopes::SSConfig::reg_refresh_fail_timeout() const@Base" 0replaceme | ||
565 | 645 | (c++)"unity::scopes::internal::RuntimeConfig::ss_configfile() const@Base" 0replaceme | ||
566 | 640 | (c++)"unity::scopes::internal::RuntimeConfig::registry_identity() const@Base" 0.4.2+14.04.20140404.2 | 646 | (c++)"unity::scopes::internal::RuntimeConfig::registry_identity() const@Base" 0.4.2+14.04.20140404.2 |
567 | 641 | (c++)"unity::scopes::internal::RuntimeConfig::default_middleware() const@Base" 0.4.2+14.04.20140404.2 | 647 | (c++)"unity::scopes::internal::RuntimeConfig::default_middleware() const@Base" 0.4.2+14.04.20140404.2 |
568 | 642 | (c++)"unity::scopes::internal::RuntimeConfig::registry_configfile() const@Base" 0.4.2+14.04.20140404.2 | 648 | (c++)"unity::scopes::internal::RuntimeConfig::registry_configfile() const@Base" 0.4.2+14.04.20140404.2 |
569 | 649 | (c++)"unity::scopes::internal::RuntimeConfig::ss_registry_identity() const@Base" 0replaceme | ||
570 | 643 | (c++)"unity::scopes::internal::RuntimeConfig::default_middleware_configfile() const@Base" 0.4.2+14.04.20140404.2 | 650 | (c++)"unity::scopes::internal::RuntimeConfig::default_middleware_configfile() const@Base" 0.4.2+14.04.20140404.2 |
571 | 644 | (c++)"unity::scopes::internal::MiddlewareBase::runtime() const@Base" 0.4.0+14.04.20140312.1 | 651 | (c++)"unity::scopes::internal::MiddlewareBase::runtime() const@Base" 0.4.0+14.04.20140312.1 |
572 | 645 | (c++)"unity::scopes::internal::RegistryConfig::endpointdir() const@Base" 0.4.0+14.04.20140312.1 | ||
573 | 646 | (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1 | 652 | (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1 |
574 | 647 | (c++)"unity::scopes::internal::RegistryConfig::oem_installdir() const@Base" 0.4.0+14.04.20140312.1 | 653 | (c++)"unity::scopes::internal::RegistryConfig::oem_installdir() const@Base" 0.4.0+14.04.20140312.1 |
575 | 648 | (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428 | 654 | (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428 |
576 | 649 | (c++)"unity::scopes::internal::RegistryConfig::scope_installdir() const@Base" 0.4.0+14.04.20140312.1 | 655 | (c++)"unity::scopes::internal::RegistryConfig::scope_installdir() const@Base" 0.4.0+14.04.20140312.1 |
577 | 650 | (c++)"unity::scopes::internal::RegistryConfig::scoperunner_path() const@Base" 0.4.0+14.04.20140312.1 | 656 | (c++)"unity::scopes::internal::RegistryConfig::scoperunner_path() const@Base" 0.4.0+14.04.20140312.1 |
578 | 651 | (c++)"unity::scopes::internal::RegistryConfig::ss_registry_endpoint() const@Base" 0.4.0+14.04.20140312.1 | ||
579 | 652 | (c++)"unity::scopes::internal::RegistryConfig::ss_registry_identity() const@Base" 0.4.0+14.04.20140312.1 | ||
580 | 653 | (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1 | 657 | (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1 |
581 | 654 | (c++)"unity::scopes::internal::RegistryConfig::endpoint() const@Base" 0.4.0+14.04.20140312.1 | ||
582 | 655 | (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1 | 658 | (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1 |
583 | 656 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2 | 659 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2 |
584 | 657 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(std::unique_lock<std::mutex>&, unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2 | 660 | (c++)"unity::scopes::internal::RegistryObject::ScopeProcess::wait_for_state(std::unique_lock<std::mutex>&, unity::scopes::internal::RegistryObject::ScopeProcess::ProcessState, int) const@Base" 0.4.2+14.04.20140404.2 |
585 | 658 | 661 | ||
586 | === modified file 'demo/CMakeLists.txt' | |||
587 | --- demo/CMakeLists.txt 2014-04-23 11:04:31 +0000 | |||
588 | +++ demo/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
589 | @@ -4,7 +4,6 @@ | |||
590 | 4 | 4 | ||
591 | 5 | configure_file(Runtime.ini.in Runtime.ini) | 5 | configure_file(Runtime.ini.in Runtime.ini) |
592 | 6 | configure_file(Registry.ini.in Registry.ini) | 6 | configure_file(Registry.ini.in Registry.ini) |
593 | 7 | configure_file(Zmq.ini.in Zmq.ini) | ||
594 | 8 | 7 | ||
595 | 9 | add_definitions(-DDEMO_RUNTIME_PATH="${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini") | 8 | add_definitions(-DDEMO_RUNTIME_PATH="${CMAKE_CURRENT_BINARY_DIR}/Runtime.ini") |
596 | 10 | 9 | ||
597 | 11 | 10 | ||
598 | === modified file 'demo/README' | |||
599 | --- demo/README 2014-04-23 11:04:31 +0000 | |||
600 | +++ demo/README 2014-05-08 12:06:13 +0000 | |||
601 | @@ -32,4 +32,4 @@ | |||
602 | 32 | $ ./scopes-client scope-B testquery | 32 | $ ./scopes-client scope-B testquery |
603 | 33 | 33 | ||
604 | 34 | The client currently looks for Runtime.ini in the current directory and if not present, uses the system-wide Runtime.ini | 34 | The client currently looks for Runtime.ini in the current directory and if not present, uses the system-wide Runtime.ini |
606 | 35 | shipped with libunity-scopes (/usr/share/unity-scopes-api/Runtime.ini by default) | 35 | shipped with libunity-scopes (/usr/lib/<arch>/unity-scopes/Runtime.ini by default) |
607 | 36 | 36 | ||
608 | === modified file 'demo/Registry.ini.in' | |||
609 | --- demo/Registry.ini.in 2014-02-13 02:40:08 +0000 | |||
610 | +++ demo/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
611 | @@ -1,10 +1,5 @@ | |||
612 | 1 | [Registry] | 1 | [Registry] |
613 | 2 | Middleware = Zmq | ||
614 | 3 | Zmq.Endpoint = ipc:///tmp/Registry | ||
615 | 4 | Zmq.EndpointDir = /tmp | ||
616 | 5 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini | 2 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
617 | 6 | Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes | 3 | Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes |
618 | 7 | OEM.InstallDir = /custom/usr/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity/scopes | 4 | OEM.InstallDir = /custom/usr/lib/@CMAKE_LIBRARY_ARCHITECTURE@/unity/scopes |
619 | 8 | Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner | 5 | Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner |
620 | 9 | SS.Registry.Identity = SSRegistry | ||
621 | 10 | SS.Registry.Endpoint = ipc:///tmp/SSRegistry | ||
622 | 11 | 6 | ||
623 | === modified file 'demo/Runtime.ini.in' | |||
624 | --- demo/Runtime.ini.in 2014-01-31 02:21:24 +0000 | |||
625 | +++ demo/Runtime.ini.in 2014-05-08 12:06:13 +0000 | |||
626 | @@ -1,5 +1,3 @@ | |||
627 | 1 | [Runtime] | 1 | [Runtime] |
628 | 2 | Registry.Identity = Registry | 2 | Registry.Identity = Registry |
629 | 3 | Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Registry.ini | 3 | Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Registry.ini |
630 | 4 | Default.Middleware = Zmq | ||
631 | 5 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini | ||
632 | 6 | 4 | ||
633 | === removed file 'demo/Zmq.ini.in' | |||
634 | --- demo/Zmq.ini.in 2013-11-28 00:27:48 +0000 | |||
635 | +++ demo/Zmq.ini.in 1970-01-01 00:00:00 +0000 | |||
636 | @@ -1,3 +0,0 @@ | |||
637 | 1 | [Zmq] | ||
638 | 2 | EndpointDir.Public = /tmp | ||
639 | 3 | EndpointDir.Private = /tmp | ||
640 | 4 | 0 | ||
641 | === modified file 'demo/click/scope-click/CMakeLists.txt' | |||
642 | --- demo/click/scope-click/CMakeLists.txt 2014-04-03 15:27:11 +0000 | |||
643 | +++ demo/click/scope-click/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
644 | @@ -6,7 +6,7 @@ | |||
645 | 6 | include(GNUInstallDirs) | 6 | include(GNUInstallDirs) |
646 | 7 | include(FindPkgConfig) | 7 | include(FindPkgConfig) |
647 | 8 | 8 | ||
649 | 9 | pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes>=0.4.0) | 9 | pkg_check_modules(UNITY_SCOPES REQUIRED lib${UNITY_SCOPES_LIB}>=0.4.0) |
650 | 10 | add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER}) | 10 | add_definitions(${UNITY_SCOPES_CFLAGS} ${UNITY_SCOPES_CFLAGS_OTHER}) |
651 | 11 | 11 | ||
652 | 12 | add_definitions(-std=c++11) | 12 | add_definitions(-std=c++11) |
653 | 13 | 13 | ||
654 | === modified file 'demo/stand-alone/CMakeLists.txt' | |||
655 | --- demo/stand-alone/CMakeLists.txt 2014-02-03 09:04:04 +0000 | |||
656 | +++ demo/stand-alone/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
657 | @@ -1,5 +1,4 @@ | |||
658 | 1 | configure_file(Runtime.ini.in Runtime.ini) | 1 | configure_file(Runtime.ini.in Runtime.ini) |
659 | 2 | configure_file(Zmq.ini.in Zmq.ini) | ||
660 | 3 | 2 | ||
661 | 4 | add_executable(stand-alone-client stand-alone-client.cpp) | 3 | add_executable(stand-alone-client stand-alone-client.cpp) |
662 | 5 | 4 | ||
663 | 6 | 5 | ||
664 | === modified file 'demo/stand-alone/Runtime.ini.in' | |||
665 | --- demo/stand-alone/Runtime.ini.in 2014-02-03 09:04:04 +0000 | |||
666 | +++ demo/stand-alone/Runtime.ini.in 2014-05-08 12:06:13 +0000 | |||
667 | @@ -1,3 +1,1 @@ | |||
668 | 1 | [Runtime] | 1 | [Runtime] |
669 | 2 | Default.Middleware = Zmq | ||
670 | 3 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini | ||
671 | 4 | 2 | ||
672 | === removed file 'demo/stand-alone/Zmq.ini.in' | |||
673 | --- demo/stand-alone/Zmq.ini.in 2014-02-03 09:04:04 +0000 | |||
674 | +++ demo/stand-alone/Zmq.ini.in 1970-01-01 00:00:00 +0000 | |||
675 | @@ -1,3 +0,0 @@ | |||
676 | 1 | [Zmq] | ||
677 | 2 | EndpointDir.Public = /tmp | ||
678 | 3 | EndpointDir.Private = /tmp | ||
679 | 4 | 0 | ||
680 | === modified file 'doc/Doxyfile-devel.in' | |||
681 | --- doc/Doxyfile-devel.in 2014-02-26 00:34:09 +0000 | |||
682 | +++ doc/Doxyfile-devel.in 2014-05-08 12:06:13 +0000 | |||
683 | @@ -888,7 +888,7 @@ | |||
684 | 888 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | 888 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be |
685 | 889 | # put in front of it. If left blank `html' will be used as the default path. | 889 | # put in front of it. If left blank `html' will be used as the default path. |
686 | 890 | 890 | ||
688 | 891 | HTML_OUTPUT = @PROJECT@ | 891 | HTML_OUTPUT = @UNITY_SCOPES_LIB@ |
689 | 892 | 892 | ||
690 | 893 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for | 893 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for |
691 | 894 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank | 894 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank |
692 | 895 | 895 | ||
693 | === modified file 'doc/Doxyfile.in' | |||
694 | --- doc/Doxyfile.in 2014-05-01 17:25:23 +0000 | |||
695 | +++ doc/Doxyfile.in 2014-05-08 12:06:13 +0000 | |||
696 | @@ -887,7 +887,7 @@ | |||
697 | 887 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | 887 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be |
698 | 888 | # put in front of it. If left blank `html' will be used as the default path. | 888 | # put in front of it. If left blank `html' will be used as the default path. |
699 | 889 | 889 | ||
701 | 890 | HTML_OUTPUT = @PROJECT@ | 890 | HTML_OUTPUT = @UNITY_SCOPES_LIB@ |
702 | 891 | 891 | ||
703 | 892 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for | 892 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for |
704 | 893 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank | 893 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank |
705 | 894 | 894 | ||
706 | === modified file 'doc/index.html' | |||
707 | --- doc/index.html 2014-02-26 10:43:45 +0000 | |||
708 | +++ doc/index.html 2014-05-08 12:06:13 +0000 | |||
709 | @@ -1,10 +1,10 @@ | |||
710 | 1 | <head> | 1 | <head> |
712 | 2 | <meta http-equiv="refresh" content="1;url=unity-scopes-api/index.html"> | 2 | <meta http-equiv="refresh" content="1;url=unity-scopes/index.html"> |
713 | 3 | <script type="text/javascript"> | 3 | <script type="text/javascript"> |
715 | 4 | window.location.href = "unity-scopes-api/index.html" | 4 | window.location.href = "unity-scopes/index.html" |
716 | 5 | </script> | 5 | </script> |
717 | 6 | <title>Unity Scopes API - Page Redirection</title> | 6 | <title>Unity Scopes API - Page Redirection</title> |
718 | 7 | </head> | 7 | </head> |
719 | 8 | <body> | 8 | <body> |
721 | 9 | <p>You will be redirected automatically, otherwise please <a href="unity-scopes-api/index.html">click here</a>.</p> | 9 | <p>You will be redirected automatically, otherwise please <a href="unity-scopes/index.html">click here</a>.</p> |
722 | 10 | </body> | 10 | </body> |
723 | 11 | 11 | ||
724 | === modified file 'include/CMakeLists.txt' | |||
725 | --- include/CMakeLists.txt 2014-01-31 07:55:00 +0000 | |||
726 | +++ include/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
727 | @@ -1,13 +1,13 @@ | |||
728 | 1 | add_subdirectory(unity) | 1 | add_subdirectory(unity) |
729 | 2 | set(UNITY_SCOPES_LIB_HDRS ${UNITY_SCOPES_LIB_HDRS} ${headers} PARENT_SCOPE) | 2 | set(UNITY_SCOPES_LIB_HDRS ${UNITY_SCOPES_LIB_HDRS} ${headers} PARENT_SCOPE) |
730 | 3 | 3 | ||
732 | 4 | add_custom_command(OUTPUT unity-scopes.h | 4 | add_custom_command(OUTPUT ${UNITY_SCOPES_LIB}.h |
733 | 5 | COMMAND ${CMAKE_SOURCE_DIR}/tools/create_globalheader.py | 5 | COMMAND ${CMAKE_SOURCE_DIR}/tools/create_globalheader.py |
735 | 6 | ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} | 6 | ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} |
736 | 7 | DEPENDS ${UNITY_SCOPES_LIB_HDRS}) | 7 | DEPENDS ${UNITY_SCOPES_LIB_HDRS}) |
737 | 8 | 8 | ||
738 | 9 | add_custom_target(globalheader ALL | 9 | add_custom_target(globalheader ALL |
740 | 10 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h) | 10 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h) |
741 | 11 | 11 | ||
743 | 12 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity-scopes.h | 12 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${UNITY_SCOPES_LIB}.h |
744 | 13 | DESTINATION ${HDR_INSTALL_DIR}) | 13 | DESTINATION ${HDR_INSTALL_DIR}) |
745 | 14 | 14 | ||
746 | === modified file 'include/unity/scopes/Runtime.h' | |||
747 | --- include/unity/scopes/Runtime.h 2014-04-03 16:46:00 +0000 | |||
748 | +++ include/unity/scopes/Runtime.h 2014-05-08 12:06:13 +0000 | |||
749 | @@ -102,8 +102,17 @@ | |||
750 | 102 | This method is intended to run a scope that can not be loaded via the scope runner, such as those written in languages that can not be dynamically loaded. | 102 | This method is intended to run a scope that can not be loaded via the scope runner, such as those written in languages that can not be dynamically loaded. |
751 | 103 | 103 | ||
752 | 104 | \param scope_base The scope implementation | 104 | \param scope_base The scope implementation |
753 | 105 | \param runtime_ini_file The full path of runtime configuration file. Passing an empty string uses | ||
754 | 106 | a default configuration. | ||
755 | 105 | \param scope_ini_file The full path of scope configuration file | 107 | \param scope_ini_file The full path of scope configuration file |
756 | 106 | */ | 108 | */ |
757 | 109 | void run_scope(ScopeBase *const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file); | ||
758 | 110 | |||
759 | 111 | /** | ||
760 | 112 | \brief Run a scope without going through the scope runner. | ||
761 | 113 | |||
762 | 114 | Equivalent to `run_scope(scope_base, "", scope_ini_file);` | ||
763 | 115 | */ | ||
764 | 107 | void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file); | 116 | void run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file); |
765 | 108 | 117 | ||
766 | 109 | // TODO: Flesh out documentation for this, especially syntax. | 118 | // TODO: Flesh out documentation for this, especially syntax. |
767 | 110 | 119 | ||
768 | === modified file 'include/unity/scopes/internal/ConfigBase.h' | |||
769 | --- include/unity/scopes/internal/ConfigBase.h 2014-02-26 11:32:43 +0000 | |||
770 | +++ include/unity/scopes/internal/ConfigBase.h 2014-05-08 12:06:13 +0000 | |||
771 | @@ -21,6 +21,9 @@ | |||
772 | 21 | 21 | ||
773 | 22 | #include <unity/util/IniParser.h> | 22 | #include <unity/util/IniParser.h> |
774 | 23 | 23 | ||
775 | 24 | #include <map> | ||
776 | 25 | #include <set> | ||
777 | 26 | |||
778 | 24 | namespace unity | 27 | namespace unity |
779 | 25 | { | 28 | { |
780 | 26 | 29 | ||
781 | @@ -39,16 +42,23 @@ | |||
782 | 39 | { | 42 | { |
783 | 40 | public: | 43 | public: |
784 | 41 | ConfigBase(); | 44 | ConfigBase(); |
786 | 42 | ConfigBase(std::string const& configfile); | 45 | ConfigBase(std::string const& configfile, std::string const& dflt_file = ""); |
787 | 43 | virtual ~ConfigBase(); | 46 | virtual ~ConfigBase(); |
788 | 44 | 47 | ||
789 | 45 | unity::util::IniParser::SPtr parser() const; | 48 | unity::util::IniParser::SPtr parser() const; |
790 | 46 | 49 | ||
791 | 47 | virtual std::string get_string(std::string const& group, std::string const& key) const; | 50 | virtual std::string get_string(std::string const& group, std::string const& key) const; |
793 | 48 | virtual std::string get_optional_string(std::string const& group, std::string const& key) const; | 51 | virtual std::string get_optional_string(std::string const& group, |
794 | 52 | std::string const& key, | ||
795 | 53 | std::string const& dflt = "") const; | ||
796 | 49 | virtual std::string get_middleware(std::string const& group, std::string const& key) const; | 54 | virtual std::string get_middleware(std::string const& group, std::string const& key) const; |
797 | 50 | 55 | ||
799 | 51 | virtual void throw_ex(::std::string const& reason) const; | 56 | protected: |
800 | 57 | void throw_ex(::std::string const& reason) const; | ||
801 | 58 | bool path_exists(::std::string const& path) const; | ||
802 | 59 | |||
803 | 60 | typedef std::map<std::string, std::set<std::string>> KnownEntries; | ||
804 | 61 | void check_unknown_entries(KnownEntries const& valid) const; | ||
805 | 52 | 62 | ||
806 | 53 | private: | 63 | private: |
807 | 54 | unity::util::IniParser::SPtr parser_; | 64 | unity::util::IniParser::SPtr parser_; |
808 | 55 | 65 | ||
809 | === modified file 'include/unity/scopes/internal/DfltConfig.h.in' | |||
810 | --- include/unity/scopes/internal/DfltConfig.h.in 2014-02-06 05:03:24 +0000 | |||
811 | +++ include/unity/scopes/internal/DfltConfig.h.in 2014-05-08 12:06:13 +0000 | |||
812 | @@ -28,9 +28,23 @@ | |||
813 | 28 | namespace internal | 28 | namespace internal |
814 | 29 | { | 29 | { |
815 | 30 | 30 | ||
819 | 31 | static constexpr const char* DFLT_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Runtime.ini"; | 31 | static constexpr const char* DFLT_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Runtime.ini"; |
820 | 32 | static constexpr const char* DFLT_SS_RUNTIME_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/SSRuntime.ini"; | 32 | static constexpr const char* DFLT_REGISTRY_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Registry.ini"; |
821 | 33 | static constexpr const char* DFLT_REGISTRY_INI = "@CMAKE_INSTALL_PREFIX@/@SCOPES_DEFAULT_CONFIGDIR@/Registry.ini"; | 33 | static constexpr char const* DFLT_REGISTRY_ID = "Registry"; |
822 | 34 | static constexpr const char* DFLT_SS_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Smartscopes.ini"; | ||
823 | 35 | static constexpr char const* DFLT_SS_REGISTRY_ID = "SSRegistry"; | ||
824 | 36 | static constexpr char const* DFLT_SCOPERUNNER_PATH = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/scoperunner"; | ||
825 | 37 | static constexpr char const* DFLT_MIDDLEWARE = "Zmq"; | ||
826 | 38 | static constexpr char const* DFLT_ZMQ_MIDDLEWARE_INI = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@/Zmq.ini"; | ||
827 | 39 | static constexpr char const* DFLT_MIDDLEWARE_INI = DFLT_ZMQ_MIDDLEWARE_INI; | ||
828 | 40 | static constexpr char const* DFLT_SCOPE_INSTALL_DIR = "@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@"; | ||
829 | 41 | static constexpr char const* DFLT_OEM_INSTALL_DIR = "/custom/@LIB_INSTALL_PREFIX@/@UNITY_SCOPES_LIB@"; | ||
830 | 42 | |||
831 | 43 | static constexpr int DFLT_SS_HTTP_TIMEOUT = 20; // seconds | ||
832 | 44 | static constexpr int DFLT_SS_REG_REFRESH_RATE = 86400; // 24 hours as seconds | ||
833 | 45 | static constexpr int DFLT_SS_REG_REFRESH_FAIL_TIMEOUT = 10; // seconds | ||
834 | 46 | |||
835 | 47 | static constexpr char const* DFLT_SS_SCOPE_IDENTITY = "SmartScope"; | ||
836 | 34 | 48 | ||
837 | 35 | } // namespace internal | 49 | } // namespace internal |
838 | 36 | 50 | ||
839 | 37 | 51 | ||
840 | === modified file 'include/unity/scopes/internal/MiddlewareBase.h' | |||
841 | --- include/unity/scopes/internal/MiddlewareBase.h 2014-04-02 09:24:02 +0000 | |||
842 | +++ include/unity/scopes/internal/MiddlewareBase.h 2014-05-08 12:06:13 +0000 | |||
843 | @@ -65,7 +65,9 @@ | |||
844 | 65 | virtual ObjectProxy string_to_proxy(std::string const& s) = 0; | 65 | virtual ObjectProxy string_to_proxy(std::string const& s) = 0; |
845 | 66 | virtual std::string proxy_to_string(MWProxy const& proxy) = 0; | 66 | virtual std::string proxy_to_string(MWProxy const& proxy) = 0; |
846 | 67 | 67 | ||
848 | 68 | virtual MWRegistryProxy create_registry_proxy(std::string const& identity, std::string const& endpoint) = 0; | 68 | virtual MWRegistryProxy registry_proxy() = 0; |
849 | 69 | virtual MWRegistryProxy ss_registry_proxy() = 0; | ||
850 | 70 | |||
851 | 69 | virtual MWScopeProxy create_scope_proxy(std::string const& identity) = 0; | 71 | virtual MWScopeProxy create_scope_proxy(std::string const& identity) = 0; |
852 | 70 | virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) = 0; | 72 | virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) = 0; |
853 | 71 | virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) = 0; | 73 | virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) = 0; |
854 | 72 | 74 | ||
855 | === modified file 'include/unity/scopes/internal/RegistryConfig.h' | |||
856 | --- include/unity/scopes/internal/RegistryConfig.h 2014-04-04 13:22:38 +0000 | |||
857 | +++ include/unity/scopes/internal/RegistryConfig.h 2014-05-08 12:06:13 +0000 | |||
858 | @@ -33,35 +33,25 @@ | |||
859 | 33 | class RegistryConfig : public ConfigBase | 33 | class RegistryConfig : public ConfigBase |
860 | 34 | { | 34 | { |
861 | 35 | public: | 35 | public: |
862 | 36 | static constexpr char const* REGISTRY_CONFIG_GROUP = "Registry"; | ||
863 | 37 | |||
864 | 38 | RegistryConfig(std::string const& identity, std::string const& configfile); | 36 | RegistryConfig(std::string const& identity, std::string const& configfile); |
865 | 39 | ~RegistryConfig(); | 37 | ~RegistryConfig(); |
866 | 40 | 38 | ||
867 | 41 | std::string identity() const; | 39 | std::string identity() const; |
868 | 42 | std::string mw_kind() const; | 40 | std::string mw_kind() const; |
869 | 43 | std::string endpointdir() const; | ||
870 | 44 | std::string endpoint() const; | ||
871 | 45 | std::string mw_configfile() const; | 41 | std::string mw_configfile() const; |
872 | 46 | std::string scope_installdir() const; // Directory for Canonical scopes | 42 | std::string scope_installdir() const; // Directory for Canonical scopes |
873 | 47 | std::string oem_installdir() const; // Directory for OEM scope config files | 43 | std::string oem_installdir() const; // Directory for OEM scope config files |
874 | 48 | std::string click_installdir() const; // Directory for Click scope config files | 44 | std::string click_installdir() const; // Directory for Click scope config files |
875 | 49 | std::string scoperunner_path() const; // Path to scoperunner binary | 45 | std::string scoperunner_path() const; // Path to scoperunner binary |
876 | 50 | std::string ss_registry_identity() const; // Identity of smart scopes registry | ||
877 | 51 | std::string ss_registry_endpoint() const; // Endpoint of smart scopes registry | ||
878 | 52 | 46 | ||
879 | 53 | private: | 47 | private: |
880 | 54 | std::string identity_; | 48 | std::string identity_; |
881 | 55 | std::string mw_kind_; | 49 | std::string mw_kind_; |
882 | 56 | std::string endpointdir_; | ||
883 | 57 | std::string endpoint_; | ||
884 | 58 | std::string mw_configfile_; | 50 | std::string mw_configfile_; |
885 | 59 | std::string scope_installdir_; | 51 | std::string scope_installdir_; |
886 | 60 | std::string oem_installdir_; | 52 | std::string oem_installdir_; |
887 | 61 | std::string click_installdir_; | 53 | std::string click_installdir_; |
888 | 62 | std::string scoperunner_path_; | 54 | std::string scoperunner_path_; |
889 | 63 | std::string ss_registry_identity_; | ||
890 | 64 | std::string ss_registry_endpoint_; | ||
891 | 65 | }; | 55 | }; |
892 | 66 | 56 | ||
893 | 67 | } // namespace internal | 57 | } // namespace internal |
894 | 68 | 58 | ||
895 | === modified file 'include/unity/scopes/internal/RegistryObject.h' | |||
896 | --- include/unity/scopes/internal/RegistryObject.h 2014-04-10 10:59:00 +0000 | |||
897 | +++ include/unity/scopes/internal/RegistryObject.h 2014-05-08 12:06:13 +0000 | |||
898 | @@ -123,10 +123,11 @@ | |||
899 | 123 | 123 | ||
900 | 124 | Executor::SPtr executor_; | 124 | Executor::SPtr executor_; |
901 | 125 | 125 | ||
902 | 126 | mutable std::mutex mutex_; | ||
903 | 127 | MetadataMap scopes_; | 126 | MetadataMap scopes_; |
905 | 128 | std::map<std::string, ScopeProcess> scope_processes_; | 127 | typedef std::map<std::string, ScopeProcess> ProcessMap; |
906 | 128 | ProcessMap scope_processes_; | ||
907 | 129 | MWRegistryProxy remote_registry_; | 129 | MWRegistryProxy remote_registry_; |
908 | 130 | mutable std::mutex mutex_; | ||
909 | 130 | }; | 131 | }; |
910 | 131 | 132 | ||
911 | 132 | } // namespace internal | 133 | } // namespace internal |
912 | 133 | 134 | ||
913 | === modified file 'include/unity/scopes/internal/RuntimeConfig.h' | |||
914 | --- include/unity/scopes/internal/RuntimeConfig.h 2014-01-23 11:28:34 +0000 | |||
915 | +++ include/unity/scopes/internal/RuntimeConfig.h 2014-05-08 12:06:13 +0000 | |||
916 | @@ -34,19 +34,21 @@ | |||
917 | 34 | class RuntimeConfig : public ConfigBase | 34 | class RuntimeConfig : public ConfigBase |
918 | 35 | { | 35 | { |
919 | 36 | public: | 36 | public: |
920 | 37 | static const char* RUNTIME_CONFIG_GROUP; | ||
921 | 38 | |||
922 | 39 | RuntimeConfig(std::string const& configfile); | 37 | RuntimeConfig(std::string const& configfile); |
923 | 40 | ~RuntimeConfig(); | 38 | ~RuntimeConfig(); |
924 | 41 | 39 | ||
925 | 42 | std::string registry_identity() const; | 40 | std::string registry_identity() const; |
926 | 43 | std::string registry_configfile() const; | 41 | std::string registry_configfile() const; |
927 | 42 | std::string ss_registry_identity() const; | ||
928 | 43 | std::string ss_configfile() const; | ||
929 | 44 | std::string default_middleware() const; | 44 | std::string default_middleware() const; |
930 | 45 | std::string default_middleware_configfile() const; | 45 | std::string default_middleware_configfile() const; |
931 | 46 | 46 | ||
932 | 47 | private: | 47 | private: |
933 | 48 | std::string registry_identity_; | 48 | std::string registry_identity_; |
934 | 49 | std::string registry_configfile_; | 49 | std::string registry_configfile_; |
935 | 50 | std::string ss_registry_identity_; | ||
936 | 51 | std::string ss_configfile_; | ||
937 | 50 | std::string default_middleware_; | 52 | std::string default_middleware_; |
938 | 51 | std::string default_middleware_configfile_; | 53 | std::string default_middleware_configfile_; |
939 | 52 | }; | 54 | }; |
940 | 53 | 55 | ||
941 | === modified file 'include/unity/scopes/internal/RuntimeImpl.h' | |||
942 | --- include/unity/scopes/internal/RuntimeImpl.h 2014-04-15 05:24:45 +0000 | |||
943 | +++ include/unity/scopes/internal/RuntimeImpl.h 2014-05-08 12:06:13 +0000 | |||
944 | @@ -44,17 +44,17 @@ | |||
945 | 44 | void destroy(); | 44 | void destroy(); |
946 | 45 | 45 | ||
947 | 46 | std::string scope_id() const; | 46 | std::string scope_id() const; |
948 | 47 | std::string configfile() const; | ||
949 | 48 | MiddlewareFactory const* factory() const; | 47 | MiddlewareFactory const* factory() const; |
950 | 49 | RegistryProxy registry() const; | 48 | RegistryProxy registry() const; |
951 | 50 | std::string registry_configfile() const; | 49 | std::string registry_configfile() const; |
952 | 51 | std::string registry_identity() const; | 50 | std::string registry_identity() const; |
955 | 52 | std::string registry_endpointdir() const; | 51 | std::string ss_configfile() const; |
956 | 53 | std::string registry_endpoint() const; | 52 | std::string ss_registry_identity() const; |
957 | 54 | Reaper::SPtr reply_reaper() const; | 53 | Reaper::SPtr reply_reaper() const; |
958 | 55 | ThreadPool::SPtr async_pool() const; | 54 | ThreadPool::SPtr async_pool() const; |
959 | 56 | ThreadSafeQueue<std::future<void>>::SPtr future_queue() const; | 55 | ThreadSafeQueue<std::future<void>>::SPtr future_queue() const; |
961 | 57 | void run_scope(ScopeBase *const scope_base, std::string const &scope_ini_file); | 56 | void run_scope(ScopeBase* const scope_base, std::string const& scope_ini_file); |
962 | 57 | void run_scope(ScopeBase* const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file); | ||
963 | 58 | 58 | ||
964 | 59 | ObjectProxy string_to_proxy(std::string const& s) const; | 59 | ObjectProxy string_to_proxy(std::string const& s) const; |
965 | 60 | std::string proxy_to_string(ObjectProxy const& proxy) const; | 60 | std::string proxy_to_string(ObjectProxy const& proxy) const; |
966 | @@ -67,14 +67,13 @@ | |||
967 | 67 | 67 | ||
968 | 68 | bool destroyed_; | 68 | bool destroyed_; |
969 | 69 | std::string scope_id_; | 69 | std::string scope_id_; |
970 | 70 | std::string configfile_; | ||
971 | 71 | MiddlewareFactory::UPtr middleware_factory_; | 70 | MiddlewareFactory::UPtr middleware_factory_; |
972 | 72 | MiddlewareBase::SPtr middleware_; | 71 | MiddlewareBase::SPtr middleware_; |
973 | 73 | mutable RegistryProxy registry_; | 72 | mutable RegistryProxy registry_; |
974 | 74 | mutable std::string registry_configfile_; | 73 | mutable std::string registry_configfile_; |
975 | 75 | mutable std::string registry_identity_; | 74 | mutable std::string registry_identity_; |
978 | 76 | mutable std::string registry_endpointdir_; | 75 | mutable std::string ss_configfile_; |
979 | 77 | mutable std::string registry_endpoint_; | 76 | mutable std::string ss_registry_identity_; |
980 | 78 | mutable Reaper::SPtr reply_reaper_; | 77 | mutable Reaper::SPtr reply_reaper_; |
981 | 79 | mutable ThreadPool::SPtr async_pool_; // Pool of invocation threads for async query creation | 78 | mutable ThreadPool::SPtr async_pool_; // Pool of invocation threads for async query creation |
982 | 80 | mutable ThreadSafeQueue<std::future<void>>::SPtr future_queue_; | 79 | mutable ThreadSafeQueue<std::future<void>>::SPtr future_queue_; |
983 | 81 | 80 | ||
984 | === modified file 'include/unity/scopes/internal/ScopeConfig.h' | |||
985 | --- include/unity/scopes/internal/ScopeConfig.h 2014-04-08 08:26:44 +0000 | |||
986 | +++ include/unity/scopes/internal/ScopeConfig.h 2014-05-08 12:06:13 +0000 | |||
987 | @@ -35,9 +35,6 @@ | |||
988 | 35 | class ScopeConfig : public ConfigBase | 35 | class ScopeConfig : public ConfigBase |
989 | 36 | { | 36 | { |
990 | 37 | public: | 37 | public: |
991 | 38 | static constexpr const char* SCOPE_CONFIG_GROUP = "ScopeConfig"; | ||
992 | 39 | static constexpr const char* SCOPE_DISPLAY_GROUP = "Appearance"; | ||
993 | 40 | |||
994 | 41 | ScopeConfig(std::string const& configfile); | 38 | ScopeConfig(std::string const& configfile); |
995 | 42 | ~ScopeConfig(); | 39 | ~ScopeConfig(); |
996 | 43 | 40 | ||
997 | @@ -51,6 +48,7 @@ | |||
998 | 51 | std::string hot_key() const; // Optional, throws NotFoundException if not present | 48 | std::string hot_key() const; // Optional, throws NotFoundException if not present |
999 | 52 | bool invisible() const; // Optional, returns false if not present | 49 | bool invisible() const; // Optional, returns false if not present |
1000 | 53 | std::string scope_runner() const; // Optional, throws NotFoundException if not present | 50 | std::string scope_runner() const; // Optional, throws NotFoundException if not present |
1001 | 51 | |||
1002 | 54 | VariantMap appearance_attributes() const; // Optional, return empty map if no attributes are present | 52 | VariantMap appearance_attributes() const; // Optional, return empty map if no attributes are present |
1003 | 55 | 53 | ||
1004 | 56 | private: | 54 | private: |
1005 | @@ -62,7 +60,7 @@ | |||
1006 | 62 | std::unique_ptr<std::string> icon_; | 60 | std::unique_ptr<std::string> icon_; |
1007 | 63 | std::unique_ptr<std::string> search_hint_; | 61 | std::unique_ptr<std::string> search_hint_; |
1008 | 64 | std::unique_ptr<std::string> hot_key_; | 62 | std::unique_ptr<std::string> hot_key_; |
1010 | 65 | std::unique_ptr<bool> invisible_; | 63 | bool invisible_; |
1011 | 66 | std::unique_ptr<std::string> scope_runner_; | 64 | std::unique_ptr<std::string> scope_runner_; |
1012 | 67 | VariantMap appearance_attributes_; | 65 | VariantMap appearance_attributes_; |
1013 | 68 | }; | 66 | }; |
1014 | 69 | 67 | ||
1015 | === added file 'include/unity/scopes/internal/smartscopes/SSConfig.h' | |||
1016 | --- include/unity/scopes/internal/smartscopes/SSConfig.h 1970-01-01 00:00:00 +0000 | |||
1017 | +++ include/unity/scopes/internal/smartscopes/SSConfig.h 2014-05-08 12:06:13 +0000 | |||
1018 | @@ -0,0 +1,62 @@ | |||
1019 | 1 | /* | ||
1020 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
1021 | 3 | * | ||
1022 | 4 | * This program is free software: you can redistribute it and/or modify | ||
1023 | 5 | * it under the terms of the GNU Lesser General Public License version 3 as | ||
1024 | 6 | * published by the Free Software Foundation. | ||
1025 | 7 | * | ||
1026 | 8 | * This program is distributed in the hope that it will be useful, | ||
1027 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1028 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1029 | 11 | * GNU Lesser General Public License for more details. | ||
1030 | 12 | * | ||
1031 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1032 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1033 | 15 | * | ||
1034 | 16 | * Authored by: Michi Henning <michi.henning@canonical.com> | ||
1035 | 17 | */ | ||
1036 | 18 | |||
1037 | 19 | #ifndef UNITY_SCOPES_INTERNAL_SSCONFIG_H | ||
1038 | 20 | #define UNITY_SCOPES_INTERNAL_SSCONFIG_H | ||
1039 | 21 | |||
1040 | 22 | #include <unity/scopes/internal/ConfigBase.h> | ||
1041 | 23 | |||
1042 | 24 | namespace unity | ||
1043 | 25 | { | ||
1044 | 26 | |||
1045 | 27 | namespace scopes | ||
1046 | 28 | { | ||
1047 | 29 | |||
1048 | 30 | namespace internal | ||
1049 | 31 | { | ||
1050 | 32 | |||
1051 | 33 | namespace smartscopes | ||
1052 | 34 | { | ||
1053 | 35 | |||
1054 | 36 | class SSConfig : public ConfigBase | ||
1055 | 37 | { | ||
1056 | 38 | public: | ||
1057 | 39 | SSConfig(std::string const& configfile); | ||
1058 | 40 | ~SSConfig(); | ||
1059 | 41 | |||
1060 | 42 | int http_reply_timeout() const; // seconds | ||
1061 | 43 | int reg_refresh_rate() const; // seconds | ||
1062 | 44 | int reg_refresh_fail_timeout() const; // seconds | ||
1063 | 45 | std::string scope_identity() const; | ||
1064 | 46 | |||
1065 | 47 | private: | ||
1066 | 48 | int http_reply_timeout_; | ||
1067 | 49 | int reg_refresh_rate_; | ||
1068 | 50 | int reg_refresh_fail_timeout_; | ||
1069 | 51 | std::string scope_identity_; | ||
1070 | 52 | }; | ||
1071 | 53 | |||
1072 | 54 | } // namespace smartscopes | ||
1073 | 55 | |||
1074 | 56 | } // namespace internal | ||
1075 | 57 | |||
1076 | 58 | } // namespace scopes | ||
1077 | 59 | |||
1078 | 60 | } // namespace unity | ||
1079 | 61 | |||
1080 | 62 | #endif | ||
1081 | 0 | 63 | ||
1082 | === modified file 'include/unity/scopes/internal/smartscopes/SSRegistryObject.h' | |||
1083 | --- include/unity/scopes/internal/smartscopes/SSRegistryObject.h 2014-04-03 12:57:25 +0000 | |||
1084 | +++ include/unity/scopes/internal/smartscopes/SSRegistryObject.h 2014-05-08 12:06:13 +0000 | |||
1085 | @@ -22,6 +22,7 @@ | |||
1086 | 22 | #include <unity/scopes/internal/MiddlewareBase.h> | 22 | #include <unity/scopes/internal/MiddlewareBase.h> |
1087 | 23 | #include <unity/scopes/internal/RegistryObjectBase.h> | 23 | #include <unity/scopes/internal/RegistryObjectBase.h> |
1088 | 24 | #include <unity/scopes/internal/smartscopes/SmartScopesClient.h> | 24 | #include <unity/scopes/internal/smartscopes/SmartScopesClient.h> |
1089 | 25 | #include <unity/scopes/internal/smartscopes/SSConfig.h> | ||
1090 | 25 | 26 | ||
1091 | 26 | #include <mutex> | 27 | #include <mutex> |
1092 | 27 | 28 | ||
1093 | @@ -42,8 +43,10 @@ | |||
1094 | 42 | public: | 43 | public: |
1095 | 43 | UNITY_DEFINES_PTRS(SSRegistryObject); | 44 | UNITY_DEFINES_PTRS(SSRegistryObject); |
1096 | 44 | 45 | ||
1099 | 45 | SSRegistryObject(MiddlewareBase::SPtr middleware, std::string const& ss_scope_endpoint, | 46 | SSRegistryObject(MiddlewareBase::SPtr middleware, |
1100 | 46 | uint http_reply_timeout, uint refresh_rate_in_sec, std::string const& sss_url = "", | 47 | SSConfig const& ss_config, |
1101 | 48 | std::string const& ss_scope_endpoint, | ||
1102 | 49 | std::string const& sss_url = "", | ||
1103 | 47 | bool caching_enabled = true); | 50 | bool caching_enabled = true); |
1104 | 48 | virtual ~SSRegistryObject() noexcept; | 51 | virtual ~SSRegistryObject() noexcept; |
1105 | 49 | 52 | ||
1106 | @@ -78,6 +81,7 @@ | |||
1107 | 78 | std::string ss_scope_endpoint_; | 81 | std::string ss_scope_endpoint_; |
1108 | 79 | uint const regular_refresh_timeout_; | 82 | uint const regular_refresh_timeout_; |
1109 | 80 | uint next_refresh_timeout_; | 83 | uint next_refresh_timeout_; |
1110 | 84 | uint const failed_refresh_timeout_; | ||
1111 | 81 | 85 | ||
1112 | 82 | bool caching_enabled_; | 86 | bool caching_enabled_; |
1113 | 83 | }; | 87 | }; |
1114 | 84 | 88 | ||
1115 | === modified file 'include/unity/scopes/internal/zmq_middleware/ZmqConfig.h' | |||
1116 | --- include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2014-01-23 11:28:34 +0000 | |||
1117 | +++ include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2014-05-08 12:06:13 +0000 | |||
1118 | @@ -33,8 +33,6 @@ | |||
1119 | 33 | class ZmqConfig : public ConfigBase | 33 | class ZmqConfig : public ConfigBase |
1120 | 34 | { | 34 | { |
1121 | 35 | public: | 35 | public: |
1122 | 36 | static const char* ZMQ_CONFIG_GROUP; | ||
1123 | 37 | |||
1124 | 38 | ZmqConfig(std::string const& configfile); | 36 | ZmqConfig(std::string const& configfile); |
1125 | 39 | ~ZmqConfig(); | 37 | ~ZmqConfig(); |
1126 | 40 | 38 | ||
1127 | 41 | 39 | ||
1128 | === modified file 'include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h' | |||
1129 | --- include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2014-04-16 07:04:34 +0000 | |||
1130 | +++ include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2014-05-08 12:06:13 +0000 | |||
1131 | @@ -53,7 +53,7 @@ | |||
1132 | 53 | class ZmqMiddleware final : public MiddlewareBase | 53 | class ZmqMiddleware final : public MiddlewareBase |
1133 | 54 | { | 54 | { |
1134 | 55 | public: | 55 | public: |
1136 | 56 | ZmqMiddleware(std::string const& server_name, std::string const& configfile, RuntimeImpl* runtime); | 56 | ZmqMiddleware(std::string const& server_name, RuntimeImpl* runtime, std::string const& configfile = ""); |
1137 | 57 | virtual ~ZmqMiddleware(); | 57 | virtual ~ZmqMiddleware(); |
1138 | 58 | 58 | ||
1139 | 59 | virtual void start() override; | 59 | virtual void start() override; |
1140 | @@ -63,7 +63,9 @@ | |||
1141 | 63 | virtual ObjectProxy string_to_proxy(std::string const& s) override; | 63 | virtual ObjectProxy string_to_proxy(std::string const& s) override; |
1142 | 64 | virtual std::string proxy_to_string(MWProxy const& proxy) override; | 64 | virtual std::string proxy_to_string(MWProxy const& proxy) override; |
1143 | 65 | 65 | ||
1145 | 66 | virtual MWRegistryProxy create_registry_proxy(std::string const& identity, std::string const& endpoint) override; | 66 | virtual MWRegistryProxy registry_proxy() override; |
1146 | 67 | virtual MWRegistryProxy ss_registry_proxy() override; | ||
1147 | 68 | |||
1148 | 67 | virtual MWScopeProxy create_scope_proxy(std::string const& identity) override; | 69 | virtual MWScopeProxy create_scope_proxy(std::string const& identity) override; |
1149 | 68 | virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) override; | 70 | virtual MWScopeProxy create_scope_proxy(std::string const& identity, std::string const& endpoint) override; |
1150 | 69 | virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) override; | 71 | virtual MWQueryProxy create_query_proxy(std::string const& identity, std::string const& endpoint) override; |
1151 | @@ -110,6 +112,8 @@ | |||
1152 | 110 | 112 | ||
1153 | 111 | std::string server_name_; | 113 | std::string server_name_; |
1154 | 112 | zmqpp::context context_; | 114 | zmqpp::context context_; |
1155 | 115 | MWRegistryProxy registry_proxy_; | ||
1156 | 116 | MWRegistryProxy ss_registry_proxy_; | ||
1157 | 113 | 117 | ||
1158 | 114 | typedef std::map<std::string, std::shared_ptr<ObjectAdapter>> AdapterMap; | 118 | typedef std::map<std::string, std::shared_ptr<ObjectAdapter>> AdapterMap; |
1159 | 115 | AdapterMap am_; | 119 | AdapterMap am_; |
1160 | 116 | 120 | ||
1161 | === modified file 'scoperegistry/CMakeLists.txt' | |||
1162 | --- scoperegistry/CMakeLists.txt 2014-03-19 10:03:19 +0000 | |||
1163 | +++ scoperegistry/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
1164 | @@ -9,4 +9,4 @@ | |||
1165 | 9 | add_executable(scoperegistry ${SRC}) | 9 | add_executable(scoperegistry ${SRC}) |
1166 | 10 | target_link_libraries(scoperegistry ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) | 10 | target_link_libraries(scoperegistry ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) |
1167 | 11 | 11 | ||
1169 | 12 | install(TARGETS scoperegistry RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/scoperegistry) | 12 | install(TARGETS scoperegistry RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB}) |
1170 | 13 | 13 | ||
1171 | === modified file 'scoperegistry/scoperegistry.cpp' | |||
1172 | --- scoperegistry/scoperegistry.cpp 2014-04-15 04:53:44 +0000 | |||
1173 | +++ scoperegistry/scoperegistry.cpp 2014-05-08 12:06:13 +0000 | |||
1174 | @@ -322,22 +322,11 @@ | |||
1175 | 322 | } | 322 | } |
1176 | 323 | } | 323 | } |
1177 | 324 | 324 | ||
1178 | 325 | // Overwrite any remote scopes loaded previously with the current ones. | ||
1179 | 326 | |||
1180 | 327 | void load_remote_scopes(RegistryObject::SPtr const& registry, | ||
1181 | 328 | MiddlewareBase::SPtr const& mw, | ||
1182 | 329 | string const& ss_reg_id, | ||
1183 | 330 | string const& ss_reg_endpoint) | ||
1184 | 331 | { | ||
1185 | 332 | auto ss_reg = mw->create_registry_proxy(ss_reg_id, ss_reg_endpoint); | ||
1186 | 333 | registry->set_remote_registry(ss_reg); | ||
1187 | 334 | } | ||
1188 | 335 | |||
1189 | 336 | } // namespace | 325 | } // namespace |
1190 | 337 | 326 | ||
1191 | 338 | // Usage: scoperegistry [runtime.ini] [scope.ini]... | 327 | // Usage: scoperegistry [runtime.ini] [scope.ini]... |
1192 | 339 | // | 328 | // |
1194 | 340 | // If no runtime config file is specified, the default location (/usr/share/unity-scopes-api/Runtime.ini) | 329 | // If no runtime config file is specified, the default location (/usr/lib/<arch>/unity-scopes/Runtime.ini) |
1195 | 341 | // is assumed. | 330 | // is assumed. |
1196 | 342 | // If additional scope configuration files are specified, the corresponding scopes will be added | 331 | // If additional scope configuration files are specified, the corresponding scopes will be added |
1197 | 343 | // to the registry (overriding any scopes that are found via config files reached via Runtime.ini). | 332 | // to the registry (overriding any scopes that are found via config files reached via Runtime.ini). |
1198 | @@ -370,29 +359,22 @@ | |||
1199 | 370 | RuntimeImpl::UPtr runtime = RuntimeImpl::create(rt_config.registry_identity(), config_file); | 359 | RuntimeImpl::UPtr runtime = RuntimeImpl::create(rt_config.registry_identity(), config_file); |
1200 | 371 | 360 | ||
1201 | 372 | string identity = runtime->registry_identity(); | 361 | string identity = runtime->registry_identity(); |
1202 | 362 | string ss_reg_id = runtime->ss_registry_identity(); | ||
1203 | 373 | 363 | ||
1204 | 374 | // Collect the registry config data. | 364 | // Collect the registry config data. |
1205 | 375 | 365 | ||
1206 | 376 | string mw_kind; | 366 | string mw_kind; |
1207 | 377 | string mw_endpoint; | ||
1208 | 378 | string mw_configfile; | ||
1209 | 379 | string scope_installdir; | 367 | string scope_installdir; |
1210 | 380 | string oem_installdir; | 368 | string oem_installdir; |
1211 | 381 | string click_installdir; | 369 | string click_installdir; |
1212 | 382 | string scoperunner_path; | 370 | string scoperunner_path; |
1213 | 383 | string ss_reg_id; | ||
1214 | 384 | string ss_reg_endpoint; | ||
1215 | 385 | { | 371 | { |
1216 | 386 | RegistryConfig c(identity, runtime->registry_configfile()); | 372 | RegistryConfig c(identity, runtime->registry_configfile()); |
1217 | 387 | mw_kind = c.mw_kind(); | 373 | mw_kind = c.mw_kind(); |
1218 | 388 | mw_endpoint = c.endpoint(); | ||
1219 | 389 | mw_configfile = c.mw_configfile(); | ||
1220 | 390 | scope_installdir = c.scope_installdir(); | 374 | scope_installdir = c.scope_installdir(); |
1221 | 391 | oem_installdir = c.oem_installdir(); | 375 | oem_installdir = c.oem_installdir(); |
1222 | 392 | click_installdir = c.click_installdir(); | 376 | click_installdir = c.click_installdir(); |
1223 | 393 | scoperunner_path = c.scoperunner_path(); | 377 | scoperunner_path = c.scoperunner_path(); |
1224 | 394 | ss_reg_id = c.ss_registry_identity(); | ||
1225 | 395 | ss_reg_endpoint = c.ss_registry_endpoint(); | ||
1226 | 396 | } // Release memory for config parser | 378 | } // Release memory for config parser |
1227 | 397 | 379 | ||
1228 | 398 | MiddlewareBase::SPtr middleware = runtime->factory()->find(identity, mw_kind); | 380 | MiddlewareBase::SPtr middleware = runtime->factory()->find(identity, mw_kind); |
1229 | @@ -434,16 +416,16 @@ | |||
1230 | 434 | local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries | 416 | local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries |
1231 | 435 | } | 417 | } |
1232 | 436 | 418 | ||
1235 | 437 | add_local_scopes(registry, local_scopes, middleware, scoperunner_path, runtime->configfile(), false); | 419 | add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false); |
1236 | 438 | add_local_scopes(registry, click_scopes, middleware, scoperunner_path, runtime->configfile(), true); | 420 | add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true); |
1237 | 439 | local_scopes.insert(click_scopes.begin(), click_scopes.end()); | 421 | local_scopes.insert(click_scopes.begin(), click_scopes.end()); |
1239 | 440 | if (ss_reg_id.empty() || ss_reg_endpoint.empty()) | 422 | if (ss_reg_id.empty()) |
1240 | 441 | { | 423 | { |
1241 | 442 | error("no remote registry configured, only local scopes will be available"); | 424 | error("no remote registry configured, only local scopes will be available"); |
1242 | 443 | } | 425 | } |
1243 | 444 | else | 426 | else |
1244 | 445 | { | 427 | { |
1246 | 446 | load_remote_scopes(registry, middleware, ss_reg_id, ss_reg_endpoint); | 428 | registry->set_remote_registry(middleware->ss_registry_proxy()); |
1247 | 447 | } | 429 | } |
1248 | 448 | 430 | ||
1249 | 449 | // Let's add the registry's state receiver to the middleware so that scopes can inform | 431 | // Let's add the registry's state receiver to the middleware so that scopes can inform |
1250 | 450 | 432 | ||
1251 | === modified file 'scoperunner/CMakeLists.txt' | |||
1252 | --- scoperunner/CMakeLists.txt 2013-11-29 12:20:25 +0000 | |||
1253 | +++ scoperunner/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
1254 | @@ -3,4 +3,4 @@ | |||
1255 | 3 | add_executable(scoperunner ${SRC}) | 3 | add_executable(scoperunner ${SRC}) |
1256 | 4 | target_link_libraries(scoperunner ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) | 4 | target_link_libraries(scoperunner ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) |
1257 | 5 | 5 | ||
1259 | 6 | install(TARGETS scoperunner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/scoperunner) | 6 | install(TARGETS scoperunner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB}) |
1260 | 7 | 7 | ||
1261 | === modified file 'smartscopesproxy/CMakeLists.txt' | |||
1262 | --- smartscopesproxy/CMakeLists.txt 2014-02-04 10:50:16 +0000 | |||
1263 | +++ smartscopesproxy/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
1264 | @@ -3,4 +3,4 @@ | |||
1265 | 3 | add_executable(smartscopesproxy ${SRC}) | 3 | add_executable(smartscopesproxy ${SRC}) |
1266 | 4 | target_link_libraries(smartscopesproxy ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) | 4 | target_link_libraries(smartscopesproxy ${UNITY_SCOPES_LIB} ${OTHER_LIBS}) |
1267 | 5 | 5 | ||
1269 | 6 | install(TARGETS smartscopesproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/smartscopesproxy) | 6 | install(TARGETS smartscopesproxy RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${UNITY_SCOPES_LIB}) |
1270 | 7 | 7 | ||
1271 | === modified file 'smartscopesproxy/smartscopesproxy.cpp' | |||
1272 | --- smartscopesproxy/smartscopesproxy.cpp 2014-04-09 09:51:32 +0000 | |||
1273 | +++ smartscopesproxy/smartscopesproxy.cpp 2014-05-08 12:06:13 +0000 | |||
1274 | @@ -17,6 +17,7 @@ | |||
1275 | 17 | */ | 17 | */ |
1276 | 18 | 18 | ||
1277 | 19 | #include <unity/scopes/internal/RegistryConfig.h> | 19 | #include <unity/scopes/internal/RegistryConfig.h> |
1278 | 20 | #include <unity/scopes/internal/RuntimeConfig.h> | ||
1279 | 20 | #include <unity/scopes/internal/RuntimeImpl.h> | 21 | #include <unity/scopes/internal/RuntimeImpl.h> |
1280 | 21 | #include <unity/scopes/internal/smartscopes/SSScopeObject.h> | 22 | #include <unity/scopes/internal/smartscopes/SSScopeObject.h> |
1281 | 22 | #include <unity/scopes/internal/smartscopes/SSRegistryObject.h> | 23 | #include <unity/scopes/internal/smartscopes/SSRegistryObject.h> |
1282 | @@ -107,14 +108,14 @@ | |||
1283 | 107 | { | 108 | { |
1284 | 108 | SignalThreadWrapper signal_handler; | 109 | SignalThreadWrapper signal_handler; |
1285 | 109 | 110 | ||
1291 | 110 | ///! TODO: get these from config | 111 | RuntimeConfig rt_config(config_file); |
1292 | 111 | std::string ss_reg_id = "SSRegistry"; | 112 | std::string ss_reg_id = rt_config.ss_registry_identity(); |
1293 | 112 | std::string ss_scope_id = "SmartScope"; | 113 | |
1294 | 113 | uint const http_reply_timeout = 20000; | 114 | SSConfig ss_config(rt_config.ss_configfile()); |
1295 | 114 | uint const ss_reg_refresh_rate = 60 * 60 * 24; // 24 hour refresh (in seconds) | 115 | std::string ss_scope_id = ss_config.scope_identity(); |
1296 | 115 | 116 | ||
1297 | 116 | // Instantiate SS registry and scopes runtimes | 117 | // Instantiate SS registry and scopes runtimes |
1299 | 117 | RuntimeImpl::UPtr reg_rt = RuntimeImpl::create(ss_reg_id, DFLT_SS_RUNTIME_INI); | 118 | RuntimeImpl::UPtr reg_rt = RuntimeImpl::create(ss_reg_id, config_file); |
1300 | 118 | RuntimeImpl::UPtr scope_rt = RuntimeImpl::create(ss_scope_id, config_file); | 119 | RuntimeImpl::UPtr scope_rt = RuntimeImpl::create(ss_scope_id, config_file); |
1301 | 119 | 120 | ||
1302 | 120 | // Get registry config | 121 | // Get registry config |
1303 | @@ -133,14 +134,13 @@ | |||
1304 | 133 | }); | 134 | }); |
1305 | 134 | 135 | ||
1306 | 135 | // Instantiate a SS registry object | 136 | // Instantiate a SS registry object |
1309 | 136 | SSRegistryObject::SPtr reg(new SSRegistryObject(reg_mw, scope_mw->get_scope_endpoint(), | 137 | SSRegistryObject::SPtr reg(new SSRegistryObject(reg_mw, ss_config, scope_mw->get_scope_endpoint())); |
1308 | 137 | http_reply_timeout, ss_reg_refresh_rate)); | ||
1310 | 138 | 138 | ||
1311 | 139 | // Instantiate a SS scope object | 139 | // Instantiate a SS scope object |
1312 | 140 | SSScopeObject::UPtr scope(new SSScopeObject(ss_scope_id, scope_mw, reg)); | 140 | SSScopeObject::UPtr scope(new SSScopeObject(ss_scope_id, scope_mw, reg)); |
1313 | 141 | 141 | ||
1314 | 142 | // Add objects to the middlewares | 142 | // Add objects to the middlewares |
1316 | 143 | reg_mw->add_registry_object(reg_rt->registry_identity(), reg); | 143 | reg_mw->add_registry_object(reg_rt->ss_registry_identity(), reg); |
1317 | 144 | scope_mw->add_dflt_scope_object(std::move(scope)); | 144 | scope_mw->add_dflt_scope_object(std::move(scope)); |
1318 | 145 | 145 | ||
1319 | 146 | if (sig_upstart) | 146 | if (sig_upstart) |
1320 | 147 | 147 | ||
1321 | === modified file 'src/scopes/Runtime.cpp' | |||
1322 | --- src/scopes/Runtime.cpp 2014-04-03 16:46:00 +0000 | |||
1323 | +++ src/scopes/Runtime.cpp 2014-05-08 12:06:13 +0000 | |||
1324 | @@ -62,11 +62,16 @@ | |||
1325 | 62 | return p->registry(); | 62 | return p->registry(); |
1326 | 63 | } | 63 | } |
1327 | 64 | 64 | ||
1329 | 65 | void Runtime::run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file) | 65 | void Runtime::run_scope(ScopeBase* const scope_base, std::string const& scope_ini_file) |
1330 | 66 | { | 66 | { |
1331 | 67 | p->run_scope(scope_base, scope_ini_file); | 67 | p->run_scope(scope_base, scope_ini_file); |
1332 | 68 | } | 68 | } |
1333 | 69 | 69 | ||
1334 | 70 | void Runtime::run_scope(ScopeBase* const scope_base, std::string const& runtime_ini_file, std::string const& scope_ini_file) | ||
1335 | 71 | { | ||
1336 | 72 | p->run_scope(scope_base, runtime_ini_file, scope_ini_file); | ||
1337 | 73 | } | ||
1338 | 74 | |||
1339 | 70 | ObjectProxy Runtime::string_to_proxy(string const& s) const | 75 | ObjectProxy Runtime::string_to_proxy(string const& s) const |
1340 | 71 | { | 76 | { |
1341 | 72 | return p->string_to_proxy(s); | 77 | return p->string_to_proxy(s); |
1342 | 73 | 78 | ||
1343 | === modified file 'src/scopes/internal/ConfigBase.cpp' | |||
1344 | --- src/scopes/internal/ConfigBase.cpp 2014-02-26 11:32:43 +0000 | |||
1345 | +++ src/scopes/internal/ConfigBase.cpp 2014-05-08 12:06:13 +0000 | |||
1346 | @@ -18,10 +18,15 @@ | |||
1347 | 18 | 18 | ||
1348 | 19 | #include <unity/scopes/internal/ConfigBase.h> | 19 | #include <unity/scopes/internal/ConfigBase.h> |
1349 | 20 | 20 | ||
1350 | 21 | #include <unity/scopes/internal/DfltConfig.h> | ||
1351 | 21 | #include <unity/scopes/ScopeExceptions.h> | 22 | #include <unity/scopes/ScopeExceptions.h> |
1352 | 22 | #include <unity/UnityExceptions.h> | 23 | #include <unity/UnityExceptions.h> |
1353 | 23 | #include <unity/util/IniParser.h> | 24 | #include <unity/util/IniParser.h> |
1354 | 24 | 25 | ||
1355 | 26 | #include <boost/filesystem/path.hpp> | ||
1356 | 27 | |||
1357 | 28 | #include <iostream> | ||
1358 | 29 | #include <sys/stat.h> | ||
1359 | 25 | 30 | ||
1360 | 26 | using namespace std; | 31 | using namespace std; |
1361 | 27 | 32 | ||
1362 | @@ -37,13 +42,38 @@ | |||
1363 | 37 | // If configfile is the empty string, we create a default instance that returns "Zmq" for the middleware | 42 | // If configfile is the empty string, we create a default instance that returns "Zmq" for the middleware |
1364 | 38 | // and throws for the other methods. | 43 | // and throws for the other methods. |
1365 | 39 | 44 | ||
1367 | 40 | ConfigBase::ConfigBase(string const& configfile) : | 45 | ConfigBase::ConfigBase(string const& configfile, string const& dflt_file) : |
1368 | 41 | parser_(nullptr), | 46 | parser_(nullptr), |
1369 | 42 | configfile_(configfile) | 47 | configfile_(configfile) |
1370 | 43 | { | 48 | { |
1371 | 44 | if (!configfile.empty()) | 49 | if (!configfile.empty()) |
1372 | 45 | { | 50 | { |
1374 | 46 | parser_ = make_shared<util::IniParser>(configfile.c_str()); | 51 | boost::filesystem::path path(configfile); |
1375 | 52 | if (path.extension() != ".ini") | ||
1376 | 53 | { | ||
1377 | 54 | throw ConfigException(string("invalid config file name: \"") + configfile + "\": missing .ini extension"); | ||
1378 | 55 | } | ||
1379 | 56 | } | ||
1380 | 57 | if (configfile.empty() || configfile == dflt_file) | ||
1381 | 58 | { | ||
1382 | 59 | // No configfile was specified or it was the same as dflt_file. | ||
1383 | 60 | // We check whether dflt_file exists. If so, we use it. Otherwise, | ||
1384 | 61 | // we don't have a configfile at all and run with defaults. | ||
1385 | 62 | if (path_exists(dflt_file)) | ||
1386 | 63 | { | ||
1387 | 64 | parser_ = make_shared<util::IniParser>(dflt_file.c_str()); | ||
1388 | 65 | configfile_ = dflt_file; | ||
1389 | 66 | } | ||
1390 | 67 | } | ||
1391 | 68 | else | ||
1392 | 69 | { | ||
1393 | 70 | // The configfile was specified and differs from dflt_file, | ||
1394 | 71 | // so we use it. | ||
1395 | 72 | if (configfile != dflt_file) | ||
1396 | 73 | { | ||
1397 | 74 | parser_ = make_shared<util::IniParser>(configfile.c_str()); | ||
1398 | 75 | configfile_ = configfile; | ||
1399 | 76 | } | ||
1400 | 47 | } | 77 | } |
1401 | 48 | } | 78 | } |
1402 | 49 | 79 | ||
1403 | @@ -70,15 +100,19 @@ | |||
1404 | 70 | return val; | 100 | return val; |
1405 | 71 | } | 101 | } |
1406 | 72 | 102 | ||
1408 | 73 | string ConfigBase::get_optional_string(string const& group, string const& key) const | 103 | string ConfigBase::get_optional_string(string const& group, string const& key, string const& dflt) const |
1409 | 74 | { | 104 | { |
1410 | 75 | try | 105 | try |
1411 | 76 | { | 106 | { |
1412 | 107 | if (!parser_) | ||
1413 | 108 | { | ||
1414 | 109 | return dflt; | ||
1415 | 110 | } | ||
1416 | 77 | return parser()->get_string(group, key); | 111 | return parser()->get_string(group, key); |
1417 | 78 | } | 112 | } |
1418 | 79 | catch (unity::LogicException const&) | 113 | catch (unity::LogicException const&) |
1419 | 80 | { | 114 | { |
1421 | 81 | return string(); | 115 | return dflt; |
1422 | 82 | } | 116 | } |
1423 | 83 | } | 117 | } |
1424 | 84 | 118 | ||
1425 | @@ -86,9 +120,13 @@ | |||
1426 | 86 | { | 120 | { |
1427 | 87 | if (!parser_) | 121 | if (!parser_) |
1428 | 88 | { | 122 | { |
1432 | 89 | return "Zmq"; | 123 | return DFLT_MIDDLEWARE; |
1433 | 90 | } | 124 | } |
1434 | 91 | string val = get_string(group, key); | 125 | string val = get_optional_string(group, key); |
1435 | 126 | if (val.empty()) | ||
1436 | 127 | { | ||
1437 | 128 | return DFLT_MIDDLEWARE; | ||
1438 | 129 | } | ||
1439 | 92 | if (val != "Zmq" && val != "REST") | 130 | if (val != "Zmq" && val != "REST") |
1440 | 93 | { | 131 | { |
1441 | 94 | throw_ex("Illegal value for " + key + ": \"" + val + | 132 | throw_ex("Illegal value for " + key + ": \"" + val + |
1442 | @@ -103,6 +141,50 @@ | |||
1443 | 103 | throw ConfigException(s); | 141 | throw ConfigException(s); |
1444 | 104 | } | 142 | } |
1445 | 105 | 143 | ||
1446 | 144 | bool ConfigBase::path_exists(string const& path) const | ||
1447 | 145 | { | ||
1448 | 146 | struct stat st; | ||
1449 | 147 | return stat(path.c_str(), &st) == 0; | ||
1450 | 148 | } | ||
1451 | 149 | |||
1452 | 150 | // Check whether a configuration file contains unknown groups | ||
1453 | 151 | // or unknown keys within a known group. This is useful to catch typos. | ||
1454 | 152 | // For example, if a config file contains "Smartscopes.Registry.Idenity" instead | ||
1455 | 153 | // of "Smartscopes.Registry.Identity" (did you spot it?), we print a warning, | ||
1456 | 154 | // so people don't endlessly scratch their heads as to why the config | ||
1457 | 155 | // isn't working for them. | ||
1458 | 156 | // | ||
1459 | 157 | // KnownEntries is a map of <group, set<key>> pairs that contains | ||
1460 | 158 | // the known keys for each group. Anything in the config file that | ||
1461 | 159 | // is not found in the map generates a warning. | ||
1462 | 160 | |||
1463 | 161 | void ConfigBase::check_unknown_entries(KnownEntries const& known_entries) const | ||
1464 | 162 | { | ||
1465 | 163 | if (!parser_) | ||
1466 | 164 | { | ||
1467 | 165 | return; | ||
1468 | 166 | } | ||
1469 | 167 | auto const groups = parser()->get_groups(); | ||
1470 | 168 | for (auto const& group : groups) | ||
1471 | 169 | { | ||
1472 | 170 | auto const it = known_entries.find(group); | ||
1473 | 171 | if (it == known_entries.end()) | ||
1474 | 172 | { | ||
1475 | 173 | cerr << "warning: ignoring unknown group " << group << " in file " << configfile_ << endl; | ||
1476 | 174 | continue; | ||
1477 | 175 | } | ||
1478 | 176 | auto keys = parser()->get_keys(group); | ||
1479 | 177 | for (auto const& key : keys) | ||
1480 | 178 | { | ||
1481 | 179 | if (it->second.find(key) == it->second.end()) | ||
1482 | 180 | { | ||
1483 | 181 | cerr << "warning: ignoring unknown key " << key << " in group " << group | ||
1484 | 182 | << " in file " << configfile_ << endl; | ||
1485 | 183 | } | ||
1486 | 184 | } | ||
1487 | 185 | } | ||
1488 | 186 | } | ||
1489 | 187 | |||
1490 | 106 | } // namespace internal | 188 | } // namespace internal |
1491 | 107 | 189 | ||
1492 | 108 | } // namespace scopes | 190 | } // namespace scopes |
1493 | 109 | 191 | ||
1494 | === modified file 'src/scopes/internal/MiddlewareFactory.cpp' | |||
1495 | --- src/scopes/internal/MiddlewareFactory.cpp 2014-02-04 21:32:07 +0000 | |||
1496 | +++ src/scopes/internal/MiddlewareFactory.cpp 2014-05-08 12:06:13 +0000 | |||
1497 | @@ -62,7 +62,7 @@ | |||
1498 | 62 | { | 62 | { |
1499 | 63 | case Kind_Zmq: | 63 | case Kind_Zmq: |
1500 | 64 | { | 64 | { |
1502 | 65 | mw = make_shared<zmq_middleware::ZmqMiddleware>(server_name, configfile, runtime_); | 65 | mw = make_shared<zmq_middleware::ZmqMiddleware>(server_name, runtime_, configfile); |
1503 | 66 | break; | 66 | break; |
1504 | 67 | } | 67 | } |
1505 | 68 | case Kind_REST: | 68 | case Kind_REST: |
1506 | 69 | 69 | ||
1507 | === modified file 'src/scopes/internal/RegistryConfig.cpp' | |||
1508 | --- src/scopes/internal/RegistryConfig.cpp 2014-05-08 07:25:37 +0000 | |||
1509 | +++ src/scopes/internal/RegistryConfig.cpp 2014-05-08 12:06:13 +0000 | |||
1510 | @@ -18,6 +18,7 @@ | |||
1511 | 18 | 18 | ||
1512 | 19 | #include <unity/scopes/internal/RegistryConfig.h> | 19 | #include <unity/scopes/internal/RegistryConfig.h> |
1513 | 20 | 20 | ||
1514 | 21 | #include <unity/scopes/internal/DfltConfig.h> | ||
1515 | 21 | #include <unity/scopes/ScopeExceptions.h> | 22 | #include <unity/scopes/ScopeExceptions.h> |
1516 | 22 | #include <unity/UnityExceptions.h> | 23 | #include <unity/UnityExceptions.h> |
1517 | 23 | 24 | ||
1518 | @@ -32,23 +33,30 @@ | |||
1519 | 32 | namespace internal | 33 | namespace internal |
1520 | 33 | { | 34 | { |
1521 | 34 | 35 | ||
1523 | 35 | constexpr char const* RegistryConfig::REGISTRY_CONFIG_GROUP; | 36 | namespace |
1524 | 37 | { | ||
1525 | 38 | const string registry_config_group = "Registry"; | ||
1526 | 39 | const string mw_kind_key = "Middleware"; | ||
1527 | 40 | const string configfile_key = ".ConfigFile"; | ||
1528 | 41 | const string scope_installdir_key = "Scope.InstallDir"; | ||
1529 | 42 | const string oem_installdir_key = "OEM.InstallDir"; | ||
1530 | 43 | const string click_installdir_key = "Click.InstallDir"; | ||
1531 | 44 | const string scoperunner_path_key = "Scoperunner.Path"; | ||
1532 | 45 | } | ||
1533 | 36 | 46 | ||
1534 | 37 | RegistryConfig::RegistryConfig(string const& identity, string const& configfile) : | 47 | RegistryConfig::RegistryConfig(string const& identity, string const& configfile) : |
1536 | 38 | ConfigBase(configfile) | 48 | ConfigBase(configfile, DFLT_REGISTRY_INI) |
1537 | 39 | { | 49 | { |
1538 | 40 | identity_ = identity; | 50 | identity_ = identity; |
1539 | 41 | if (identity.empty()) | 51 | if (identity.empty()) |
1540 | 42 | { | 52 | { |
1541 | 43 | throw InvalidArgumentException("Registry identity cannot be an empty string"); | 53 | throw InvalidArgumentException("Registry identity cannot be an empty string"); |
1542 | 44 | } | 54 | } |
1550 | 45 | mw_kind_ = get_middleware(REGISTRY_CONFIG_GROUP, "Middleware"); | 55 | mw_kind_ = get_middleware(registry_config_group, mw_kind_key); |
1551 | 46 | endpointdir_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".EndpointDir"); | 56 | mw_configfile_ = get_optional_string(registry_config_group, mw_kind_ + configfile_key); |
1552 | 47 | endpoint_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".Endpoint"); | 57 | scope_installdir_ = get_optional_string(registry_config_group, scope_installdir_key, DFLT_SCOPE_INSTALL_DIR); |
1553 | 48 | mw_configfile_ = get_string(REGISTRY_CONFIG_GROUP, mw_kind_ + ".ConfigFile"); | 58 | oem_installdir_ = get_optional_string(registry_config_group, oem_installdir_key, DFLT_OEM_INSTALL_DIR); |
1554 | 49 | scope_installdir_ = get_string(REGISTRY_CONFIG_GROUP, "Scope.InstallDir"); | 59 | click_installdir_ = get_optional_string(registry_config_group, click_installdir_key); |
1548 | 50 | oem_installdir_ = get_optional_string(REGISTRY_CONFIG_GROUP, "OEM.InstallDir"); | ||
1549 | 51 | click_installdir_ = get_optional_string(REGISTRY_CONFIG_GROUP, "Click.InstallDir"); | ||
1555 | 52 | if (click_installdir_.empty()) | 60 | if (click_installdir_.empty()) |
1556 | 53 | { | 61 | { |
1557 | 54 | char const* home = getenv("HOME"); | 62 | char const* home = getenv("HOME"); |
1558 | @@ -58,13 +66,25 @@ | |||
1559 | 58 | } | 66 | } |
1560 | 59 | click_installdir_ = string(home) + "/.local/share/unity-scopes/"; | 67 | click_installdir_ = string(home) + "/.local/share/unity-scopes/"; |
1561 | 60 | } | 68 | } |
1563 | 61 | scoperunner_path_ = get_string(REGISTRY_CONFIG_GROUP, "Scoperunner.Path"); | 69 | scoperunner_path_ = get_optional_string(registry_config_group, scoperunner_path_key, DFLT_SCOPERUNNER_PATH); |
1564 | 62 | if (scoperunner_path_[0] != '/') | 70 | if (scoperunner_path_[0] != '/') |
1565 | 63 | { | 71 | { |
1567 | 64 | throw ConfigException(configfile + ": Scoperunner.Path must be an absolute path"); | 72 | throw ConfigException(configfile + ": " + scoperunner_path_key + " must be an absolute path"); |
1568 | 65 | } | 73 | } |
1571 | 66 | ss_registry_identity_ = get_optional_string(REGISTRY_CONFIG_GROUP, "SS.Registry.Identity"); | 74 | |
1572 | 67 | ss_registry_endpoint_ = get_optional_string(REGISTRY_CONFIG_GROUP, "SS.Registry.Endpoint"); | 75 | const KnownEntries known_entries = { |
1573 | 76 | { registry_config_group, | ||
1574 | 77 | { | ||
1575 | 78 | mw_kind_key, | ||
1576 | 79 | mw_kind_ + configfile_key, | ||
1577 | 80 | scope_installdir_key, | ||
1578 | 81 | oem_installdir_key, | ||
1579 | 82 | click_installdir_key, | ||
1580 | 83 | scoperunner_path_key, | ||
1581 | 84 | } | ||
1582 | 85 | } | ||
1583 | 86 | }; | ||
1584 | 87 | check_unknown_entries(known_entries); | ||
1585 | 68 | } | 88 | } |
1586 | 69 | 89 | ||
1587 | 70 | RegistryConfig::~RegistryConfig() | 90 | RegistryConfig::~RegistryConfig() |
1588 | @@ -81,16 +101,6 @@ | |||
1589 | 81 | return mw_kind_; | 101 | return mw_kind_; |
1590 | 82 | } | 102 | } |
1591 | 83 | 103 | ||
1592 | 84 | string RegistryConfig::endpointdir() const | ||
1593 | 85 | { | ||
1594 | 86 | return endpointdir_; | ||
1595 | 87 | } | ||
1596 | 88 | |||
1597 | 89 | string RegistryConfig::endpoint() const | ||
1598 | 90 | { | ||
1599 | 91 | return endpoint_; | ||
1600 | 92 | } | ||
1601 | 93 | |||
1602 | 94 | string RegistryConfig::mw_configfile() const | 104 | string RegistryConfig::mw_configfile() const |
1603 | 95 | { | 105 | { |
1604 | 96 | return mw_configfile_; | 106 | return mw_configfile_; |
1605 | @@ -116,16 +126,6 @@ | |||
1606 | 116 | return scoperunner_path_; | 126 | return scoperunner_path_; |
1607 | 117 | } | 127 | } |
1608 | 118 | 128 | ||
1609 | 119 | string RegistryConfig::ss_registry_identity() const | ||
1610 | 120 | { | ||
1611 | 121 | return ss_registry_identity_; | ||
1612 | 122 | } | ||
1613 | 123 | |||
1614 | 124 | string RegistryConfig::ss_registry_endpoint() const | ||
1615 | 125 | { | ||
1616 | 126 | return ss_registry_endpoint_; | ||
1617 | 127 | } | ||
1618 | 128 | |||
1619 | 129 | } // namespace internal | 129 | } // namespace internal |
1620 | 130 | 130 | ||
1621 | 131 | } // namespace scopes | 131 | } // namespace scopes |
1622 | 132 | 132 | ||
1623 | === modified file 'src/scopes/internal/RegistryObject.cpp' | |||
1624 | --- src/scopes/internal/RegistryObject.cpp 2014-04-15 04:53:44 +0000 | |||
1625 | +++ src/scopes/internal/RegistryObject.cpp 2014-05-08 12:06:13 +0000 | |||
1626 | @@ -90,25 +90,36 @@ | |||
1627 | 90 | 90 | ||
1628 | 91 | ScopeMetadata RegistryObject::get_metadata(std::string const& scope_id) const | 91 | ScopeMetadata RegistryObject::get_metadata(std::string const& scope_id) const |
1629 | 92 | { | 92 | { |
1630 | 93 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1631 | 94 | // If the id is empty, it was sent as empty by the remote client. | ||
1632 | 95 | if (scope_id.empty()) | 93 | if (scope_id.empty()) |
1633 | 96 | { | 94 | { |
1634 | 95 | // If the id is empty, it was sent as empty by the remote client. | ||
1635 | 97 | throw unity::InvalidArgumentException("RegistryObject::get_metadata(): Cannot search for scope with empty id"); | 96 | throw unity::InvalidArgumentException("RegistryObject::get_metadata(): Cannot search for scope with empty id"); |
1636 | 98 | } | 97 | } |
1637 | 99 | 98 | ||
1638 | 100 | // Look for the scope in both the local and the remote map. | 99 | // Look for the scope in both the local and the remote map. |
1643 | 101 | // Local scopes take precedence over remote ones of the same | 100 | // Local scopes take precedence over remote ones of the same id. |
1644 | 102 | // id. (Ideally, this should never happen.) | 101 | // (Ideally, this should never happen.) |
1641 | 103 | auto const& scope_it = scopes_.find(scope_id); | ||
1642 | 104 | if (scope_it != scopes_.end()) | ||
1645 | 105 | { | 102 | { |
1647 | 106 | return scope_it->second; | 103 | lock_guard<decltype(mutex_)> lock(mutex_); |
1648 | 104 | auto const& scope_it = scopes_.find(scope_id); | ||
1649 | 105 | if (scope_it != scopes_.end()) | ||
1650 | 106 | { | ||
1651 | 107 | return scope_it->second; | ||
1652 | 108 | } | ||
1653 | 107 | } | 109 | } |
1654 | 110 | // Unlock, so we don't call the remote registry while holding a lock. | ||
1655 | 108 | 111 | ||
1656 | 109 | if (remote_registry_) | 112 | if (remote_registry_) |
1657 | 110 | { | 113 | { |
1659 | 111 | return remote_registry_->get_metadata(scope_id); | 114 | try |
1660 | 115 | { | ||
1661 | 116 | return remote_registry_->get_metadata(scope_id); | ||
1662 | 117 | } | ||
1663 | 118 | catch (std::exception const& e) | ||
1664 | 119 | { | ||
1665 | 120 | cerr << "cannot get metdata from remote registry: " << e.what() << endl; | ||
1666 | 121 | // TODO: log error | ||
1667 | 122 | } | ||
1668 | 112 | } | 123 | } |
1669 | 113 | 124 | ||
1670 | 114 | throw NotFoundException("RegistryObject::get_metadata(): no such scope: ", scope_id); | 125 | throw NotFoundException("RegistryObject::get_metadata(): no such scope: ", scope_id); |
1671 | @@ -116,16 +127,28 @@ | |||
1672 | 116 | 127 | ||
1673 | 117 | MetadataMap RegistryObject::list() const | 128 | MetadataMap RegistryObject::list() const |
1674 | 118 | { | 129 | { |
1677 | 119 | lock_guard<decltype(mutex_)> lock(mutex_); | 130 | MetadataMap all_scopes; // Local scopes |
1678 | 120 | MetadataMap all_scopes(scopes_); // Local scopes | 131 | { |
1679 | 132 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1680 | 133 | all_scopes = scopes_; // Local scopes | ||
1681 | 134 | } | ||
1682 | 135 | // Unlock, so we don't call the remote registry while holding a lock. | ||
1683 | 121 | 136 | ||
1684 | 122 | // If a remote scope has the same id as a local one, | 137 | // If a remote scope has the same id as a local one, |
1685 | 123 | // this will not overwrite a local scope with a remote | 138 | // this will not overwrite a local scope with a remote |
1686 | 124 | // one if they have the same id. | 139 | // one if they have the same id. |
1687 | 125 | if (remote_registry_) | 140 | if (remote_registry_) |
1688 | 126 | { | 141 | { |
1691 | 127 | MetadataMap remote_scopes = remote_registry_->list(); | 142 | try |
1692 | 128 | all_scopes.insert(remote_scopes.begin(), remote_scopes.end()); | 143 | { |
1693 | 144 | MetadataMap remote_scopes = remote_registry_->list(); | ||
1694 | 145 | all_scopes.insert(remote_scopes.begin(), remote_scopes.end()); | ||
1695 | 146 | } | ||
1696 | 147 | catch (std::exception const& e) | ||
1697 | 148 | { | ||
1698 | 149 | cerr << "cannot get scopes list from remote registry: " << e.what() << endl; | ||
1699 | 150 | // TODO: log error | ||
1700 | 151 | } | ||
1701 | 129 | } | 152 | } |
1702 | 130 | 153 | ||
1703 | 131 | return all_scopes; | 154 | return all_scopes; |
1704 | @@ -133,22 +156,23 @@ | |||
1705 | 133 | 156 | ||
1706 | 134 | ObjectProxy RegistryObject::locate(std::string const& identity) | 157 | ObjectProxy RegistryObject::locate(std::string const& identity) |
1707 | 135 | { | 158 | { |
1710 | 136 | decltype(scopes_.cbegin()) scope_it; | 159 | // If the id is empty, it was sent as empty by the remote client. |
1711 | 137 | decltype(scope_processes_.begin()) proc_it; | 160 | if (identity.empty()) |
1712 | 161 | { | ||
1713 | 162 | throw unity::InvalidArgumentException("RegistryObject::locate(): Cannot locate scope with empty id"); | ||
1714 | 163 | } | ||
1715 | 138 | 164 | ||
1716 | 165 | ObjectProxy proxy; | ||
1717 | 166 | ProcessMap::iterator proc_it; | ||
1718 | 139 | { | 167 | { |
1719 | 140 | lock_guard<decltype(mutex_)> lock(mutex_); | 168 | lock_guard<decltype(mutex_)> lock(mutex_); |
1720 | 141 | // If the id is empty, it was sent as empty by the remote client. | ||
1721 | 142 | if (identity.empty()) | ||
1722 | 143 | { | ||
1723 | 144 | throw unity::InvalidArgumentException("RegistryObject::locate(): Cannot locate scope with empty id"); | ||
1724 | 145 | } | ||
1725 | 146 | 169 | ||
1727 | 147 | scope_it = scopes_.find(identity); | 170 | auto scope_it = scopes_.find(identity); |
1728 | 148 | if (scope_it == scopes_.end()) | 171 | if (scope_it == scopes_.end()) |
1729 | 149 | { | 172 | { |
1730 | 150 | throw NotFoundException("RegistryObject::locate(): Tried to locate unknown local scope", identity); | 173 | throw NotFoundException("RegistryObject::locate(): Tried to locate unknown local scope", identity); |
1731 | 151 | } | 174 | } |
1732 | 175 | proxy = scope_it->second.proxy(); | ||
1733 | 152 | 176 | ||
1734 | 153 | proc_it = scope_processes_.find(identity); | 177 | proc_it = scope_processes_.find(identity); |
1735 | 154 | if (proc_it == scope_processes_.end()) | 178 | if (proc_it == scope_processes_.end()) |
1736 | @@ -157,15 +181,15 @@ | |||
1737 | 157 | } | 181 | } |
1738 | 158 | } | 182 | } |
1739 | 159 | 183 | ||
1740 | 184 | // Exec after unlocking, so we can start processing another locate() | ||
1741 | 160 | proc_it->second.exec(death_observer_, executor_); | 185 | proc_it->second.exec(death_observer_, executor_); |
1743 | 161 | return scope_it->second.proxy(); | 186 | |
1744 | 187 | return proxy; | ||
1745 | 162 | } | 188 | } |
1746 | 163 | 189 | ||
1747 | 164 | bool RegistryObject::add_local_scope(std::string const& scope_id, ScopeMetadata const& metadata, | 190 | bool RegistryObject::add_local_scope(std::string const& scope_id, ScopeMetadata const& metadata, |
1748 | 165 | ScopeExecData const& exec_data) | 191 | ScopeExecData const& exec_data) |
1749 | 166 | { | 192 | { |
1750 | 167 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1751 | 168 | bool return_value = true; | ||
1752 | 169 | if (scope_id.empty()) | 193 | if (scope_id.empty()) |
1753 | 170 | { | 194 | { |
1754 | 171 | throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot add scope with empty id"); | 195 | throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot add scope with empty id"); |
1755 | @@ -175,6 +199,9 @@ | |||
1756 | 175 | throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot create a scope with '/' in its id"); | 199 | throw unity::InvalidArgumentException("RegistryObject::add_local_scope(): Cannot create a scope with '/' in its id"); |
1757 | 176 | } | 200 | } |
1758 | 177 | 201 | ||
1759 | 202 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1760 | 203 | |||
1761 | 204 | bool return_value = true; | ||
1762 | 178 | if (scopes_.find(scope_id) != scopes_.end()) | 205 | if (scopes_.find(scope_id) != scopes_.end()) |
1763 | 179 | { | 206 | { |
1764 | 180 | scopes_.erase(scope_id); | 207 | scopes_.erase(scope_id); |
1765 | @@ -188,7 +215,6 @@ | |||
1766 | 188 | 215 | ||
1767 | 189 | bool RegistryObject::remove_local_scope(std::string const& scope_id) | 216 | bool RegistryObject::remove_local_scope(std::string const& scope_id) |
1768 | 190 | { | 217 | { |
1769 | 191 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1770 | 192 | // If the id is empty, it was sent as empty by the remote client. | 218 | // If the id is empty, it was sent as empty by the remote client. |
1771 | 193 | if (scope_id.empty()) | 219 | if (scope_id.empty()) |
1772 | 194 | { | 220 | { |
1773 | @@ -196,6 +222,8 @@ | |||
1774 | 196 | "with empty id"); | 222 | "with empty id"); |
1775 | 197 | } | 223 | } |
1776 | 198 | 224 | ||
1777 | 225 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1778 | 226 | |||
1779 | 199 | scope_processes_.erase(scope_id); | 227 | scope_processes_.erase(scope_id); |
1780 | 200 | return scopes_.erase(scope_id) == 1; | 228 | return scopes_.erase(scope_id) == 1; |
1781 | 201 | } | 229 | } |
1782 | @@ -208,6 +236,8 @@ | |||
1783 | 208 | 236 | ||
1784 | 209 | bool RegistryObject::is_scope_running(std::string const& scope_id) | 237 | bool RegistryObject::is_scope_running(std::string const& scope_id) |
1785 | 210 | { | 238 | { |
1786 | 239 | lock_guard<decltype(mutex_)> lock(mutex_); | ||
1787 | 240 | |||
1788 | 211 | auto it = scope_processes_.find(scope_id); | 241 | auto it = scope_processes_.find(scope_id); |
1789 | 212 | if (it != scope_processes_.end()) | 242 | if (it != scope_processes_.end()) |
1790 | 213 | { | 243 | { |
1791 | @@ -224,14 +254,16 @@ | |||
1792 | 224 | 254 | ||
1793 | 225 | void RegistryObject::on_process_death(core::posix::Process const& process) | 255 | void RegistryObject::on_process_death(core::posix::Process const& process) |
1794 | 226 | { | 256 | { |
1798 | 227 | // the death observer has signaled that a child has died. | 257 | // The death observer has signaled that a child has died. |
1799 | 228 | // broadcast this message to each scope process until we have found the process in question. | 258 | // Broadcast this message to each scope process until we have found the process in question. |
1800 | 229 | // (this is slightly more efficient than just connecting the signal to every scope process) | 259 | // (This is slightly more efficient than just connecting the signal to every scope process.) |
1801 | 230 | pid_t pid = process.pid(); | 260 | pid_t pid = process.pid(); |
1802 | 231 | for (auto& scope_process : scope_processes_) | 261 | for (auto& scope_process : scope_processes_) |
1803 | 232 | { | 262 | { |
1804 | 233 | if (scope_process.second.on_process_death(pid)) | 263 | if (scope_process.second.on_process_death(pid)) |
1805 | 264 | { | ||
1806 | 234 | break; | 265 | break; |
1807 | 266 | } | ||
1808 | 235 | } | 267 | } |
1809 | 236 | } | 268 | } |
1810 | 237 | 269 | ||
1811 | 238 | 270 | ||
1812 | === modified file 'src/scopes/internal/RuntimeConfig.cpp' | |||
1813 | --- src/scopes/internal/RuntimeConfig.cpp 2014-02-05 13:08:06 +0000 | |||
1814 | +++ src/scopes/internal/RuntimeConfig.cpp 2014-05-08 12:06:13 +0000 | |||
1815 | @@ -20,6 +20,7 @@ | |||
1816 | 20 | 20 | ||
1817 | 21 | #include <unity/scopes/internal/DfltConfig.h> | 21 | #include <unity/scopes/internal/DfltConfig.h> |
1818 | 22 | #include <unity/UnityExceptions.h> | 22 | #include <unity/UnityExceptions.h> |
1819 | 23 | #include <iostream> // TODO: remove this | ||
1820 | 23 | 24 | ||
1821 | 24 | using namespace std; | 25 | using namespace std; |
1822 | 25 | 26 | ||
1823 | @@ -32,14 +33,15 @@ | |||
1824 | 32 | namespace internal | 33 | namespace internal |
1825 | 33 | { | 34 | { |
1826 | 34 | 35 | ||
1827 | 35 | const char* RuntimeConfig::RUNTIME_CONFIG_GROUP = "Runtime"; | ||
1828 | 36 | |||
1829 | 37 | namespace | 36 | namespace |
1830 | 38 | { | 37 | { |
1835 | 39 | const string registry_identity_str = "Registry.Identity"; | 38 | const string runtime_config_group = "Runtime"; |
1836 | 40 | const string registry_configfile_str = "Registry.ConfigFile"; | 39 | const string registry_identity_key = "Registry.Identity"; |
1837 | 41 | const string default_middleware_str = "Default.Middleware"; | 40 | const string registry_configfile_key = "Registry.ConfigFile"; |
1838 | 42 | const string default_middleware_configfile_str = "ConfigFile"; | 41 | const string ss_registry_identity_key = "Smartscopes.Registry.Identity"; |
1839 | 42 | const string ss_configfile_key = "Smartscopes.ConfigFile"; | ||
1840 | 43 | const string default_middleware_key = "Default.Middleware"; | ||
1841 | 44 | const string default_middleware_configfile_key = ".ConfigFile"; | ||
1842 | 43 | } | 45 | } |
1843 | 44 | 46 | ||
1844 | 45 | RuntimeConfig::RuntimeConfig(string const& configfile) : | 47 | RuntimeConfig::RuntimeConfig(string const& configfile) : |
1845 | @@ -47,25 +49,38 @@ | |||
1846 | 47 | { | 49 | { |
1847 | 48 | if (configfile.empty()) // Default config | 50 | if (configfile.empty()) // Default config |
1848 | 49 | { | 51 | { |
1850 | 50 | registry_identity_ = "Registry"; | 52 | registry_identity_ = DFLT_REGISTRY_ID; |
1851 | 51 | registry_configfile_ = DFLT_REGISTRY_INI; | 53 | registry_configfile_ = DFLT_REGISTRY_INI; |
1854 | 52 | default_middleware_ = "Zmq"; | 54 | ss_registry_identity_ = DFLT_SS_REGISTRY_ID; |
1855 | 53 | default_middleware_configfile_ = "Zmq.ini"; | 55 | ss_configfile_ = DFLT_SS_INI; |
1856 | 56 | default_middleware_ = DFLT_MIDDLEWARE; | ||
1857 | 57 | default_middleware_configfile_ = DFLT_ZMQ_MIDDLEWARE_INI; | ||
1858 | 54 | } | 58 | } |
1859 | 55 | else | 59 | else |
1860 | 56 | { | 60 | { |
1872 | 57 | registry_identity_ = get_optional_string(RUNTIME_CONFIG_GROUP, registry_identity_str); | 61 | registry_identity_ = get_optional_string(runtime_config_group, registry_identity_key); |
1873 | 58 | auto pos = registry_identity_.find_first_of("@:/"); | 62 | registry_configfile_ = get_optional_string(runtime_config_group, registry_configfile_key); |
1874 | 59 | if (pos != string::npos) | 63 | ss_configfile_ = get_optional_string(runtime_config_group, ss_configfile_key); |
1875 | 60 | { | 64 | ss_registry_identity_ = get_optional_string(runtime_config_group, ss_registry_identity_key); |
1876 | 61 | throw_ex("Illegal character in value for " + registry_identity_str + ": \"" + registry_identity_ + | 65 | default_middleware_ = get_middleware(runtime_config_group, default_middleware_key); |
1877 | 62 | "\": identity cannot contain '" + registry_identity_[pos] + "'"); | 66 | default_middleware_configfile_ = get_optional_string(runtime_config_group, |
1878 | 63 | } | 67 | default_middleware_ + default_middleware_configfile_key, |
1879 | 64 | registry_configfile_ = get_optional_string(RUNTIME_CONFIG_GROUP, registry_configfile_str); | 68 | DFLT_MIDDLEWARE_INI); |
1869 | 65 | default_middleware_ = get_middleware(RUNTIME_CONFIG_GROUP, default_middleware_str); | ||
1870 | 66 | default_middleware_configfile_ = get_string(RUNTIME_CONFIG_GROUP, | ||
1871 | 67 | default_middleware_ + "." + default_middleware_configfile_str); | ||
1880 | 68 | } | 69 | } |
1881 | 70 | |||
1882 | 71 | const KnownEntries known_entries = { | ||
1883 | 72 | { runtime_config_group, | ||
1884 | 73 | { | ||
1885 | 74 | registry_identity_key, | ||
1886 | 75 | registry_configfile_key, | ||
1887 | 76 | ss_registry_identity_key, | ||
1888 | 77 | ss_configfile_key, | ||
1889 | 78 | default_middleware_key, | ||
1890 | 79 | default_middleware_ + default_middleware_configfile_key | ||
1891 | 80 | } | ||
1892 | 81 | } | ||
1893 | 82 | }; | ||
1894 | 83 | check_unknown_entries(known_entries); | ||
1895 | 69 | } | 84 | } |
1896 | 70 | 85 | ||
1897 | 71 | RuntimeConfig::~RuntimeConfig() | 86 | RuntimeConfig::~RuntimeConfig() |
1898 | @@ -82,6 +97,16 @@ | |||
1899 | 82 | return registry_configfile_; | 97 | return registry_configfile_; |
1900 | 83 | } | 98 | } |
1901 | 84 | 99 | ||
1902 | 100 | string RuntimeConfig::ss_registry_identity() const | ||
1903 | 101 | { | ||
1904 | 102 | return ss_registry_identity_; | ||
1905 | 103 | } | ||
1906 | 104 | |||
1907 | 105 | string RuntimeConfig::ss_configfile() const | ||
1908 | 106 | { | ||
1909 | 107 | return ss_configfile_; | ||
1910 | 108 | } | ||
1911 | 109 | |||
1912 | 85 | string RuntimeConfig::default_middleware() const | 110 | string RuntimeConfig::default_middleware() const |
1913 | 86 | { | 111 | { |
1914 | 87 | return default_middleware_; | 112 | return default_middleware_; |
1915 | 88 | 113 | ||
1916 | === modified file 'src/scopes/internal/RuntimeImpl.cpp' | |||
1917 | --- src/scopes/internal/RuntimeImpl.cpp 2014-04-28 06:24:24 +0000 | |||
1918 | +++ src/scopes/internal/RuntimeImpl.cpp 2014-05-08 12:06:13 +0000 | |||
1919 | @@ -64,18 +64,17 @@ | |||
1920 | 64 | scope_id_ = "c-" + id.gen(); | 64 | scope_id_ = "c-" + id.gen(); |
1921 | 65 | } | 65 | } |
1922 | 66 | 66 | ||
1923 | 67 | string config_file(configfile.empty() ? DFLT_RUNTIME_INI : configfile); | ||
1924 | 68 | configfile_ = config_file; | ||
1925 | 69 | |||
1926 | 70 | try | 67 | try |
1927 | 71 | { | 68 | { |
1928 | 72 | // Create the middleware factory and get the registry identity and config filename. | 69 | // Create the middleware factory and get the registry identity and config filename. |
1930 | 73 | RuntimeConfig config(config_file); | 70 | RuntimeConfig config(configfile); |
1931 | 74 | string default_middleware = config.default_middleware(); | 71 | string default_middleware = config.default_middleware(); |
1932 | 75 | string middleware_configfile = config.default_middleware_configfile(); | 72 | string middleware_configfile = config.default_middleware_configfile(); |
1933 | 76 | middleware_factory_.reset(new MiddlewareFactory(this)); | 73 | middleware_factory_.reset(new MiddlewareFactory(this)); |
1934 | 77 | registry_configfile_ = config.registry_configfile(); | 74 | registry_configfile_ = config.registry_configfile(); |
1935 | 78 | registry_identity_ = config.registry_identity(); | 75 | registry_identity_ = config.registry_identity(); |
1936 | 76 | ss_configfile_ = config.ss_configfile(); | ||
1937 | 77 | ss_registry_identity_ = config.ss_registry_identity(); | ||
1938 | 79 | 78 | ||
1939 | 80 | middleware_ = middleware_factory_->create(scope_id_, default_middleware, middleware_configfile); | 79 | middleware_ = middleware_factory_->create(scope_id_, default_middleware, middleware_configfile); |
1940 | 81 | middleware_->start(); | 80 | middleware_->start(); |
1941 | @@ -91,18 +90,15 @@ | |||
1942 | 91 | } | 90 | } |
1943 | 92 | else | 91 | else |
1944 | 93 | { | 92 | { |
1946 | 94 | // Create the registry proxy. | 93 | // Create the registry proxy |
1947 | 95 | RegistryConfig reg_config(registry_identity_, registry_configfile_); | 94 | RegistryConfig reg_config(registry_identity_, registry_configfile_); |
1952 | 96 | string reg_mw_configfile = reg_config.mw_configfile(); | 95 | auto registry_mw_proxy = middleware_->registry_proxy(); |
1949 | 97 | registry_endpoint_ = reg_config.endpoint(); | ||
1950 | 98 | registry_endpointdir_ = reg_config.endpointdir(); | ||
1951 | 99 | auto registry_mw_proxy = middleware_->create_registry_proxy(registry_identity_, registry_endpoint_); | ||
1953 | 100 | registry_ = make_shared<RegistryImpl>(registry_mw_proxy, this); | 96 | registry_ = make_shared<RegistryImpl>(registry_mw_proxy, this); |
1954 | 101 | } | 97 | } |
1955 | 102 | } | 98 | } |
1956 | 103 | catch (unity::Exception const& e) | 99 | catch (unity::Exception const& e) |
1957 | 104 | { | 100 | { |
1959 | 105 | throw ConfigException("Cannot instantiate run time for " + scope_id + ", config file: " + config_file); | 101 | throw ConfigException("Cannot instantiate run time for " + scope_id_ + ", config file: " + configfile); |
1960 | 106 | } | 102 | } |
1961 | 107 | } | 103 | } |
1962 | 108 | 104 | ||
1963 | @@ -169,8 +165,6 @@ | |||
1964 | 169 | middleware_->wait_for_shutdown(); | 165 | middleware_->wait_for_shutdown(); |
1965 | 170 | middleware_ = nullptr; | 166 | middleware_ = nullptr; |
1966 | 171 | middleware_factory_.reset(nullptr); | 167 | middleware_factory_.reset(nullptr); |
1967 | 172 | |||
1968 | 173 | registry_ = nullptr; | ||
1969 | 174 | } | 168 | } |
1970 | 175 | 169 | ||
1971 | 176 | string RuntimeImpl::scope_id() const | 170 | string RuntimeImpl::scope_id() const |
1972 | @@ -179,11 +173,6 @@ | |||
1973 | 179 | return scope_id_; | 173 | return scope_id_; |
1974 | 180 | } | 174 | } |
1975 | 181 | 175 | ||
1976 | 182 | string RuntimeImpl::configfile() const | ||
1977 | 183 | { | ||
1978 | 184 | return configfile_; | ||
1979 | 185 | } | ||
1980 | 186 | |||
1981 | 187 | MiddlewareFactory const* RuntimeImpl::factory() const | 176 | MiddlewareFactory const* RuntimeImpl::factory() const |
1982 | 188 | { | 177 | { |
1983 | 189 | lock_guard<mutex> lock(mutex_); | 178 | lock_guard<mutex> lock(mutex_); |
1984 | @@ -212,26 +201,22 @@ | |||
1985 | 212 | 201 | ||
1986 | 213 | string RuntimeImpl::registry_configfile() const | 202 | string RuntimeImpl::registry_configfile() const |
1987 | 214 | { | 203 | { |
1990 | 215 | lock_guard<mutex> lock(mutex_); | 204 | return registry_configfile_; // Immutable |
1989 | 216 | return registry_configfile_; | ||
1991 | 217 | } | 205 | } |
1992 | 218 | 206 | ||
1993 | 219 | string RuntimeImpl::registry_identity() const | 207 | string RuntimeImpl::registry_identity() const |
1994 | 220 | { | 208 | { |
2009 | 221 | lock_guard<mutex> lock(mutex_); | 209 | return registry_identity_; // Immutable |
2010 | 222 | return registry_identity_; | 210 | } |
2011 | 223 | } | 211 | |
2012 | 224 | 212 | string RuntimeImpl::ss_configfile() const | |
2013 | 225 | string RuntimeImpl::registry_endpointdir() const | 213 | { |
2014 | 226 | { | 214 | return ss_configfile_; // Immutable |
2015 | 227 | lock_guard<mutex> lock(mutex_); | 215 | } |
2016 | 228 | return registry_endpointdir_; | 216 | |
2017 | 229 | } | 217 | string RuntimeImpl::ss_registry_identity() const |
2018 | 230 | 218 | { | |
2019 | 231 | string RuntimeImpl::registry_endpoint() const | 219 | return ss_registry_identity_; // Immutable |
2006 | 232 | { | ||
2007 | 233 | lock_guard<mutex> lock(mutex_); | ||
2008 | 234 | return registry_endpoint_; | ||
2020 | 235 | } | 220 | } |
2021 | 236 | 221 | ||
2022 | 237 | Reaper::SPtr RuntimeImpl::reply_reaper() const | 222 | Reaper::SPtr RuntimeImpl::reply_reaper() const |
2023 | @@ -270,15 +255,19 @@ | |||
2024 | 270 | 255 | ||
2025 | 271 | ThreadSafeQueue<future<void>>::SPtr RuntimeImpl::future_queue() const | 256 | ThreadSafeQueue<future<void>>::SPtr RuntimeImpl::future_queue() const |
2026 | 272 | { | 257 | { |
2032 | 273 | lock_guard<mutex> lock(mutex_); | 258 | return future_queue_; // Immutable |
2033 | 274 | return future_queue_; | 259 | } |
2034 | 275 | } | 260 | |
2035 | 276 | 261 | void RuntimeImpl::run_scope(ScopeBase *const scope_base, string const& scope_ini_file) | |
2036 | 277 | void RuntimeImpl::run_scope(ScopeBase *const scope_base, std::string const& scope_ini_file) | 262 | { |
2037 | 263 | run_scope(scope_base, "", scope_ini_file); | ||
2038 | 264 | } | ||
2039 | 265 | |||
2040 | 266 | void RuntimeImpl::run_scope(ScopeBase *const scope_base, string const& runtime_ini_file, string const& scope_ini_file) | ||
2041 | 278 | { | 267 | { |
2042 | 279 | // Retrieve the registry middleware and create a proxy to its state receiver | 268 | // Retrieve the registry middleware and create a proxy to its state receiver |
2043 | 280 | RegistryConfig reg_conf(registry_identity_, registry_configfile_); | 269 | RegistryConfig reg_conf(registry_identity_, registry_configfile_); |
2045 | 281 | auto reg_runtime = create(registry_identity_, configfile_); | 270 | auto reg_runtime = create(registry_identity_, runtime_ini_file); |
2046 | 282 | auto reg_mw = reg_runtime->factory()->find(registry_identity_, reg_conf.mw_kind()); | 271 | auto reg_mw = reg_runtime->factory()->find(registry_identity_, reg_conf.mw_kind()); |
2047 | 283 | auto reg_state_receiver = reg_mw->create_state_receiver_proxy("StateReceiver"); | 272 | auto reg_state_receiver = reg_mw->create_state_receiver_proxy("StateReceiver"); |
2048 | 284 | 273 | ||
2049 | @@ -286,8 +275,8 @@ | |||
2050 | 286 | 275 | ||
2051 | 287 | { | 276 | { |
2052 | 288 | // dirname modifies its argument, so we need a copy of scope lib path | 277 | // dirname modifies its argument, so we need a copy of scope lib path |
2055 | 289 | std::vector<char> scope_ini(scope_ini_file.c_str(), scope_ini_file.c_str() + scope_ini_file.size() + 1); | 278 | vector<char> scope_ini(scope_ini_file.c_str(), scope_ini_file.c_str() + scope_ini_file.size() + 1); |
2056 | 290 | const std::string scope_dir(dirname(&scope_ini[0])); | 279 | const string scope_dir(dirname(&scope_ini[0])); |
2057 | 291 | scope_base->p->set_scope_directory(scope_dir); | 280 | scope_base->p->set_scope_directory(scope_dir); |
2058 | 292 | } | 281 | } |
2059 | 293 | 282 | ||
2060 | 294 | 283 | ||
2061 | === modified file 'src/scopes/internal/ScopeConfig.cpp' | |||
2062 | --- src/scopes/internal/ScopeConfig.cpp 2014-04-23 13:26:03 +0000 | |||
2063 | +++ src/scopes/internal/ScopeConfig.cpp 2014-05-08 12:06:13 +0000 | |||
2064 | @@ -37,16 +37,19 @@ | |||
2065 | 37 | 37 | ||
2066 | 38 | namespace | 38 | namespace |
2067 | 39 | { | 39 | { |
2078 | 40 | const string overrideable_str = "Override"; | 40 | const string scope_config_group = "ScopeConfig"; |
2079 | 41 | const string scope_name_str = "DisplayName"; | 41 | const string overrideable_key = "Override"; |
2080 | 42 | const string description_str = "Description"; | 42 | const string scope_name_key = "DisplayName"; |
2081 | 43 | const string author_str = "Author"; | 43 | const string description_key = "Description"; |
2082 | 44 | const string art_str = "Art"; | 44 | const string author_key = "Author"; |
2083 | 45 | const string icon_str = "Icon"; | 45 | const string art_key = "Art"; |
2084 | 46 | const string search_hint_str = "SearchHint"; | 46 | const string icon_key = "Icon"; |
2085 | 47 | const string hot_key_str = "HotKey"; | 47 | const string search_hint_key = "SearchHint"; |
2086 | 48 | const string invisible_str = "Invisible"; | 48 | const string hot_key_key = "HotKey"; |
2087 | 49 | const string scope_runner_exec = "ScopeRunner"; | 49 | const string invisible_key = "Invisible"; |
2088 | 50 | const string scoperunner_key = "ScopeRunner"; | ||
2089 | 51 | |||
2090 | 52 | const string scope_appearance_group = "Appearance"; | ||
2091 | 50 | } | 53 | } |
2092 | 51 | 54 | ||
2093 | 52 | ScopeConfig::ScopeConfig(string const& configfile) : | 55 | ScopeConfig::ScopeConfig(string const& configfile) : |
2094 | @@ -54,23 +57,23 @@ | |||
2095 | 54 | { | 57 | { |
2096 | 55 | try | 58 | try |
2097 | 56 | { | 59 | { |
2099 | 57 | overrideable_ = parser()->get_boolean(SCOPE_CONFIG_GROUP, overrideable_str); | 60 | overrideable_ = parser()->get_boolean(scope_config_group, overrideable_key); |
2100 | 58 | } | 61 | } |
2101 | 59 | catch (LogicException const&) | 62 | catch (LogicException const&) |
2102 | 60 | { | 63 | { |
2103 | 61 | overrideable_ = false; | 64 | overrideable_ = false; |
2104 | 62 | } | 65 | } |
2105 | 63 | 66 | ||
2109 | 64 | display_name_ = parser()->get_locale_string(SCOPE_CONFIG_GROUP, scope_name_str); | 67 | display_name_ = parser()->get_locale_string(scope_config_group, scope_name_key); |
2110 | 65 | description_ = parser()->get_locale_string(SCOPE_CONFIG_GROUP, description_str); | 68 | description_ = parser()->get_locale_string(scope_config_group, description_key); |
2111 | 66 | author_ = parser()->get_string(SCOPE_CONFIG_GROUP, author_str); | 69 | author_ = parser()->get_string(scope_config_group, author_key); |
2112 | 67 | 70 | ||
2113 | 68 | // For optional values, we store them in a unique_ptr so we can distinguish the "not set at all" case | 71 | // For optional values, we store them in a unique_ptr so we can distinguish the "not set at all" case |
2114 | 69 | // from the "explicitly set to empty string" case. parser()->get_string throws LogicException if | 72 | // from the "explicitly set to empty string" case. parser()->get_string throws LogicException if |
2115 | 70 | // the key is not present, so we ignore the exception for optional values. | 73 | // the key is not present, so we ignore the exception for optional values. |
2116 | 71 | try | 74 | try |
2117 | 72 | { | 75 | { |
2119 | 73 | string art = parser()->get_string(SCOPE_CONFIG_GROUP, art_str); | 76 | string art = parser()->get_string(scope_config_group, art_key); |
2120 | 74 | art_.reset(new string(art)); | 77 | art_.reset(new string(art)); |
2121 | 75 | } | 78 | } |
2122 | 76 | catch (LogicException const&) | 79 | catch (LogicException const&) |
2123 | @@ -78,7 +81,7 @@ | |||
2124 | 78 | } | 81 | } |
2125 | 79 | try | 82 | try |
2126 | 80 | { | 83 | { |
2128 | 81 | string icon = parser()->get_string(SCOPE_CONFIG_GROUP, icon_str); | 84 | string icon = parser()->get_string(scope_config_group, icon_key); |
2129 | 82 | icon_.reset(new string(icon)); | 85 | icon_.reset(new string(icon)); |
2130 | 83 | } | 86 | } |
2131 | 84 | catch (LogicException const&) | 87 | catch (LogicException const&) |
2132 | @@ -86,7 +89,7 @@ | |||
2133 | 86 | } | 89 | } |
2134 | 87 | try | 90 | try |
2135 | 88 | { | 91 | { |
2137 | 89 | string hint = parser()->get_locale_string(SCOPE_CONFIG_GROUP, search_hint_str); | 92 | string hint = parser()->get_locale_string(scope_config_group, search_hint_key); |
2138 | 90 | search_hint_.reset(new string(hint)); | 93 | search_hint_.reset(new string(hint)); |
2139 | 91 | } | 94 | } |
2140 | 92 | catch (LogicException const&) | 95 | catch (LogicException const&) |
2141 | @@ -94,7 +97,7 @@ | |||
2142 | 94 | } | 97 | } |
2143 | 95 | try | 98 | try |
2144 | 96 | { | 99 | { |
2146 | 97 | string key = parser()->get_string(SCOPE_CONFIG_GROUP, hot_key_str); | 100 | string key = parser()->get_string(scope_config_group, hot_key_key); |
2147 | 98 | hot_key_.reset(new string(key)); | 101 | hot_key_.reset(new string(key)); |
2148 | 99 | } | 102 | } |
2149 | 100 | catch (LogicException const&) | 103 | catch (LogicException const&) |
2150 | @@ -102,35 +105,58 @@ | |||
2151 | 102 | } | 105 | } |
2152 | 103 | try | 106 | try |
2153 | 104 | { | 107 | { |
2157 | 105 | string key = parser()->get_string(SCOPE_CONFIG_GROUP, invisible_str); | 108 | invisible_ = parser()->get_boolean(scope_config_group, invisible_key); |
2155 | 106 | std::transform(begin(key), end(key), begin(key), ::toupper); | ||
2156 | 107 | invisible_.reset(new bool(key == "TRUE")); | ||
2158 | 108 | } | 109 | } |
2159 | 109 | catch (LogicException const&) | 110 | catch (LogicException const&) |
2160 | 110 | { | 111 | { |
2161 | 112 | invisible_ = false; | ||
2162 | 111 | } | 113 | } |
2163 | 112 | 114 | ||
2164 | 113 | // custom scope runner executable is optional | 115 | // custom scope runner executable is optional |
2165 | 114 | try | 116 | try |
2166 | 115 | { | 117 | { |
2168 | 116 | string key = parser()->get_string(SCOPE_CONFIG_GROUP, scope_runner_exec); | 118 | string key = parser()->get_string(scope_config_group, scoperunner_key); |
2169 | 117 | scope_runner_.reset(new string(key)); | 119 | scope_runner_.reset(new string(key)); |
2170 | 118 | } | 120 | } |
2171 | 119 | catch (LogicException const&) | 121 | catch (LogicException const&) |
2172 | 120 | { | 122 | { |
2173 | 121 | } | 123 | } |
2174 | 122 | 124 | ||
2176 | 123 | // read all display attributes from SCOPE_DISPLAY_GROUP config group | 125 | // read all display attributes from scope_appearance_group |
2177 | 124 | try | 126 | try |
2178 | 125 | { | 127 | { |
2180 | 126 | for (auto const& key: parser()->get_keys(SCOPE_DISPLAY_GROUP)) | 128 | for (auto const& key: parser()->get_keys(scope_appearance_group)) |
2181 | 127 | { | 129 | { |
2183 | 128 | appearance_attributes_[key] = parser()->get_string(SCOPE_DISPLAY_GROUP, key); | 130 | appearance_attributes_[key] = parser()->get_string(scope_appearance_group, key); |
2184 | 129 | } | 131 | } |
2185 | 130 | } | 132 | } |
2186 | 131 | catch (LogicException const&) | 133 | catch (LogicException const&) |
2187 | 132 | { | 134 | { |
2188 | 133 | } | 135 | } |
2189 | 136 | |||
2190 | 137 | const KnownEntries known_entries = { | ||
2191 | 138 | { scope_config_group, | ||
2192 | 139 | { | ||
2193 | 140 | overrideable_key, | ||
2194 | 141 | scope_name_key, | ||
2195 | 142 | description_key, | ||
2196 | 143 | author_key, | ||
2197 | 144 | art_key, | ||
2198 | 145 | icon_key, | ||
2199 | 146 | search_hint_key, | ||
2200 | 147 | invisible_key, | ||
2201 | 148 | hot_key_key, | ||
2202 | 149 | scoperunner_key | ||
2203 | 150 | } | ||
2204 | 151 | }, | ||
2205 | 152 | // TODO: once we know what appearance attributes are supported, | ||
2206 | 153 | // we need to add them here. | ||
2207 | 154 | { scope_appearance_group, | ||
2208 | 155 | { | ||
2209 | 156 | } | ||
2210 | 157 | } | ||
2211 | 158 | }; | ||
2212 | 159 | check_unknown_entries(known_entries); | ||
2213 | 134 | } | 160 | } |
2214 | 135 | 161 | ||
2215 | 136 | ScopeConfig::~ScopeConfig() | 162 | ScopeConfig::~ScopeConfig() |
2216 | @@ -161,7 +187,7 @@ | |||
2217 | 161 | { | 187 | { |
2218 | 162 | if (!art_) | 188 | if (!art_) |
2219 | 163 | { | 189 | { |
2221 | 164 | throw NotFoundException("Art not set", art_str); | 190 | throw NotFoundException("Art not set", art_key); |
2222 | 165 | } | 191 | } |
2223 | 166 | return *art_; | 192 | return *art_; |
2224 | 167 | } | 193 | } |
2225 | @@ -170,7 +196,7 @@ | |||
2226 | 170 | { | 196 | { |
2227 | 171 | if (!icon_) | 197 | if (!icon_) |
2228 | 172 | { | 198 | { |
2230 | 173 | throw NotFoundException("Icon not set", icon_str); | 199 | throw NotFoundException("Icon not set", icon_key); |
2231 | 174 | } | 200 | } |
2232 | 175 | return *icon_; | 201 | return *icon_; |
2233 | 176 | } | 202 | } |
2234 | @@ -179,7 +205,7 @@ | |||
2235 | 179 | { | 205 | { |
2236 | 180 | if (!search_hint_) | 206 | if (!search_hint_) |
2237 | 181 | { | 207 | { |
2239 | 182 | throw NotFoundException("Hint not set", search_hint_str); | 208 | throw NotFoundException("Hint not set", search_hint_key); |
2240 | 183 | } | 209 | } |
2241 | 184 | return *search_hint_; | 210 | return *search_hint_; |
2242 | 185 | } | 211 | } |
2243 | @@ -188,25 +214,21 @@ | |||
2244 | 188 | { | 214 | { |
2245 | 189 | if (!hot_key_) | 215 | if (!hot_key_) |
2246 | 190 | { | 216 | { |
2248 | 191 | throw NotFoundException("Key not set", hot_key_str); | 217 | throw NotFoundException("Key not set", hot_key_key); |
2249 | 192 | } | 218 | } |
2250 | 193 | return *hot_key_; | 219 | return *hot_key_; |
2251 | 194 | } | 220 | } |
2252 | 195 | 221 | ||
2253 | 196 | bool ScopeConfig::invisible() const | 222 | bool ScopeConfig::invisible() const |
2254 | 197 | { | 223 | { |
2260 | 198 | if (!invisible_) | 224 | return invisible_; |
2256 | 199 | { | ||
2257 | 200 | return false; | ||
2258 | 201 | } | ||
2259 | 202 | return *invisible_; | ||
2261 | 203 | } | 225 | } |
2262 | 204 | 226 | ||
2263 | 205 | string ScopeConfig::scope_runner() const | 227 | string ScopeConfig::scope_runner() const |
2264 | 206 | { | 228 | { |
2265 | 207 | if (!scope_runner_) | 229 | if (!scope_runner_) |
2266 | 208 | { | 230 | { |
2268 | 209 | throw NotFoundException("Runner binary not set", scope_runner_exec); | 231 | throw NotFoundException("Runner binary not set", scoperunner_key); |
2269 | 210 | } | 232 | } |
2270 | 211 | return *scope_runner_; | 233 | return *scope_runner_; |
2271 | 212 | } | 234 | } |
2272 | 213 | 235 | ||
2273 | === modified file 'src/scopes/internal/smartscopes/CMakeLists.txt' | |||
2274 | --- src/scopes/internal/smartscopes/CMakeLists.txt 2014-02-13 07:43:40 +0000 | |||
2275 | +++ src/scopes/internal/smartscopes/CMakeLists.txt 2014-05-08 12:06:13 +0000 | |||
2276 | @@ -1,4 +1,5 @@ | |||
2277 | 1 | set(SRC | 1 | set(SRC |
2278 | 2 | ${CMAKE_CURRENT_SOURCE_DIR}/SSConfig.cpp | ||
2279 | 2 | ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryCtrlObject.cpp | 3 | ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryCtrlObject.cpp |
2280 | 3 | ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryObject.cpp | 4 | ${CMAKE_CURRENT_SOURCE_DIR}/SSQueryObject.cpp |
2281 | 4 | ${CMAKE_CURRENT_SOURCE_DIR}/SSRegistryObject.cpp | 5 | ${CMAKE_CURRENT_SOURCE_DIR}/SSRegistryObject.cpp |
2282 | 5 | 6 | ||
2283 | === added file 'src/scopes/internal/smartscopes/SSConfig.cpp' | |||
2284 | --- src/scopes/internal/smartscopes/SSConfig.cpp 1970-01-01 00:00:00 +0000 | |||
2285 | +++ src/scopes/internal/smartscopes/SSConfig.cpp 2014-05-08 12:06:13 +0000 | |||
2286 | @@ -0,0 +1,129 @@ | |||
2287 | 1 | /* | ||
2288 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
2289 | 3 | * | ||
2290 | 4 | * This program is free software: you can redistribute it and/or modify | ||
2291 | 5 | * it under the terms of the GNU Lesser General Public License version 3 as | ||
2292 | 6 | * published by the Free Software Foundation. | ||
2293 | 7 | * | ||
2294 | 8 | * This program is distributed in the hope that it will be useful, | ||
2295 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2296 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2297 | 11 | * GNU Lesser General Public License for more details. | ||
2298 | 12 | * | ||
2299 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
2300 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2301 | 15 | * | ||
2302 | 16 | * Authored by: Michi Henning <michi.henning@canonical.com> | ||
2303 | 17 | */ | ||
2304 | 18 | |||
2305 | 19 | #include <unity/scopes/internal/smartscopes/SSConfig.h> | ||
2306 | 20 | |||
2307 | 21 | #include <unity/scopes/internal/DfltConfig.h> | ||
2308 | 22 | #include <unity/scopes/ScopeExceptions.h> | ||
2309 | 23 | |||
2310 | 24 | #include <unistd.h> | ||
2311 | 25 | |||
2312 | 26 | #include <unity/UnityExceptions.h> // TODO: remove this in config-fixes-stage2 merge proposal | ||
2313 | 27 | |||
2314 | 28 | using namespace std; | ||
2315 | 29 | |||
2316 | 30 | namespace unity | ||
2317 | 31 | { | ||
2318 | 32 | |||
2319 | 33 | namespace scopes | ||
2320 | 34 | { | ||
2321 | 35 | |||
2322 | 36 | namespace internal | ||
2323 | 37 | { | ||
2324 | 38 | |||
2325 | 39 | namespace smartscopes | ||
2326 | 40 | { | ||
2327 | 41 | |||
2328 | 42 | namespace | ||
2329 | 43 | { | ||
2330 | 44 | const string ss_config_group = "Smartscopes"; | ||
2331 | 45 | const string http_reply_timeout_key = "Http.Reply.Timeout"; | ||
2332 | 46 | const string reg_refresh_rate_key = "Registry.Refresh.Rate"; | ||
2333 | 47 | const string reg_refresh_fail_timeout_key = "Registry.Refresh.Fail.Timeout"; | ||
2334 | 48 | const string scope_identity_key = "Scope.Identity"; | ||
2335 | 49 | } | ||
2336 | 50 | |||
2337 | 51 | SSConfig::SSConfig(string const& configfile) : | ||
2338 | 52 | ConfigBase(configfile, DFLT_SS_INI) | ||
2339 | 53 | { | ||
2340 | 54 | if (configfile.empty()) | ||
2341 | 55 | { | ||
2342 | 56 | http_reply_timeout_ = DFLT_SS_HTTP_TIMEOUT; | ||
2343 | 57 | reg_refresh_rate_ = DFLT_SS_REG_REFRESH_RATE; | ||
2344 | 58 | reg_refresh_fail_timeout_ = DFLT_SS_REG_REFRESH_FAIL_TIMEOUT; | ||
2345 | 59 | scope_identity_ = DFLT_SS_SCOPE_IDENTITY; | ||
2346 | 60 | } | ||
2347 | 61 | else | ||
2348 | 62 | { | ||
2349 | 63 | // TODO: replace code below with commented-out lines as part of config-fixes-stage2 merge proposal: | ||
2350 | 64 | // http_reply_timeout_ = get_optional_int(ss_config_group, http_reply_timeout_key, DFLT_SS_HTTP_TIMEOUT); | ||
2351 | 65 | // reg_refresh_rate_ = get_optional_int(ss_config_group, reg_refresh_rate_key, DFLT_SS_REG_REFRESH); | ||
2352 | 66 | // reg_refresh_fail_timeout_ = get_optional_int(ss_config_group, | ||
2353 | 67 | // reg_refresh_fail_timeout_key, | ||
2354 | 68 | // DFLT_SS_REG_REFRESH_FAIL_TIMEOUT); | ||
2355 | 69 | // scope_identity_ = get_optional_int(ss_config_group, scope_identity_key, DFLT_SS_SCOPE_IDENTITY); | ||
2356 | 70 | try | ||
2357 | 71 | { | ||
2358 | 72 | http_reply_timeout_ = parser()->get_int(ss_config_group, http_reply_timeout_key); | ||
2359 | 73 | reg_refresh_rate_ = parser()->get_int(ss_config_group, reg_refresh_rate_key); | ||
2360 | 74 | reg_refresh_fail_timeout_ = parser()->get_int(ss_config_group, reg_refresh_fail_timeout_key); | ||
2361 | 75 | scope_identity_ = parser()->get_int(ss_config_group, scope_identity_key); | ||
2362 | 76 | } | ||
2363 | 77 | catch (unity::LogicException const&) | ||
2364 | 78 | { | ||
2365 | 79 | http_reply_timeout_ = DFLT_SS_HTTP_TIMEOUT; | ||
2366 | 80 | reg_refresh_rate_ = DFLT_SS_REG_REFRESH_RATE; | ||
2367 | 81 | reg_refresh_fail_timeout_ = DFLT_SS_REG_REFRESH_FAIL_TIMEOUT; | ||
2368 | 82 | scope_identity_ = DFLT_SS_SCOPE_IDENTITY; | ||
2369 | 83 | } | ||
2370 | 84 | } | ||
2371 | 85 | |||
2372 | 86 | const KnownEntries known_entries = { | ||
2373 | 87 | { ss_config_group, | ||
2374 | 88 | { | ||
2375 | 89 | http_reply_timeout_key, | ||
2376 | 90 | reg_refresh_rate_key, | ||
2377 | 91 | reg_refresh_fail_timeout_key, | ||
2378 | 92 | scope_identity_key, | ||
2379 | 93 | } | ||
2380 | 94 | } | ||
2381 | 95 | }; | ||
2382 | 96 | check_unknown_entries(known_entries); | ||
2383 | 97 | } | ||
2384 | 98 | |||
2385 | 99 | SSConfig::~SSConfig() | ||
2386 | 100 | { | ||
2387 | 101 | } | ||
2388 | 102 | |||
2389 | 103 | int SSConfig::http_reply_timeout() const | ||
2390 | 104 | { | ||
2391 | 105 | return http_reply_timeout_; | ||
2392 | 106 | } | ||
2393 | 107 | |||
2394 | 108 | int SSConfig::reg_refresh_rate() const | ||
2395 | 109 | { | ||
2396 | 110 | return reg_refresh_rate_; | ||
2397 | 111 | } | ||
2398 | 112 | |||
2399 | 113 | int SSConfig::reg_refresh_fail_timeout() const | ||
2400 | 114 | { | ||
2401 | 115 | return reg_refresh_fail_timeout_; | ||
2402 | 116 | } | ||
2403 | 117 | |||
2404 | 118 | string SSConfig::scope_identity() const | ||
2405 | 119 | { | ||
2406 | 120 | return scope_identity_; | ||
2407 | 121 | } | ||
2408 | 122 | |||
2409 | 123 | } // namespace smartscopes | ||
2410 | 124 | |||
2411 | 125 | } // namespace internal | ||
2412 | 126 | |||
2413 | 127 | } // namespace scopes | ||
2414 | 128 | |||
2415 | 129 | } // namespace unity | ||
2416 | 0 | 130 | ||
2417 | === modified file 'src/scopes/internal/smartscopes/SSRegistryObject.cpp' | |||
2418 | --- src/scopes/internal/smartscopes/SSRegistryObject.cpp 2014-04-03 12:57:25 +0000 | |||
2419 | +++ src/scopes/internal/smartscopes/SSRegistryObject.cpp 2014-05-08 12:06:13 +0000 | |||
2420 | @@ -28,7 +28,6 @@ | |||
2421 | 28 | 28 | ||
2422 | 29 | #include <iostream> | 29 | #include <iostream> |
2423 | 30 | 30 | ||
2424 | 31 | static const uint c_failed_refresh_timeout = 10; ///! TODO get from config | ||
2425 | 32 | static const char* c_dbussend_cmd = "dbus-send /com/canonical/unity/scopes com.canonical.unity.scopes.InvalidateResults string:smart-scopes"; | 31 | static const char* c_dbussend_cmd = "dbus-send /com/canonical/unity/scopes com.canonical.unity.scopes.InvalidateResults string:smart-scopes"; |
2426 | 33 | 32 | ||
2427 | 34 | namespace unity | 33 | namespace unity |
2428 | @@ -44,19 +43,19 @@ | |||
2429 | 44 | { | 43 | { |
2430 | 45 | 44 | ||
2431 | 46 | SSRegistryObject::SSRegistryObject(MiddlewareBase::SPtr middleware, | 45 | SSRegistryObject::SSRegistryObject(MiddlewareBase::SPtr middleware, |
2432 | 46 | SSConfig const& ss_config, | ||
2433 | 47 | std::string const& ss_scope_endpoint, | 47 | std::string const& ss_scope_endpoint, |
2434 | 48 | uint http_reply_timeout, | ||
2435 | 49 | uint refresh_rate_in_sec, | ||
2436 | 50 | std::string const& sss_url, | 48 | std::string const& sss_url, |
2437 | 51 | bool caching_enabled) | 49 | bool caching_enabled) |
2438 | 52 | : ssclient_(std::make_shared<SmartScopesClient>( | 50 | : ssclient_(std::make_shared<SmartScopesClient>( |
2440 | 53 | std::make_shared<HttpClientQt>(http_reply_timeout), | 51 | std::make_shared<HttpClientQt>(ss_config.http_reply_timeout() * 1000), // need millisecs |
2441 | 54 | std::make_shared<JsonCppNode>(), sss_url)) | 52 | std::make_shared<JsonCppNode>(), sss_url)) |
2442 | 55 | , refresh_stopped_(false) | 53 | , refresh_stopped_(false) |
2443 | 56 | , middleware_(middleware) | 54 | , middleware_(middleware) |
2444 | 57 | , ss_scope_endpoint_(ss_scope_endpoint) | 55 | , ss_scope_endpoint_(ss_scope_endpoint) |
2447 | 58 | , regular_refresh_timeout_(refresh_rate_in_sec) | 56 | , regular_refresh_timeout_(ss_config.reg_refresh_rate()) |
2448 | 59 | , next_refresh_timeout_(refresh_rate_in_sec) | 57 | , next_refresh_timeout_(ss_config.reg_refresh_rate()) |
2449 | 58 | , failed_refresh_timeout_(ss_config.reg_refresh_fail_timeout()) | ||
2450 | 60 | , caching_enabled_(caching_enabled) | 59 | , caching_enabled_(caching_enabled) |
2451 | 61 | { | 60 | { |
2452 | 62 | // get remote scopes then start the auto-refresh background thread | 61 | // get remote scopes then start the auto-refresh background thread |
2453 | @@ -183,14 +182,14 @@ | |||
2454 | 183 | } | 182 | } |
2455 | 184 | else | 183 | else |
2456 | 185 | { | 184 | { |
2458 | 186 | next_refresh_timeout_ = c_failed_refresh_timeout; | 185 | next_refresh_timeout_ = failed_refresh_timeout_; |
2459 | 187 | } | 186 | } |
2460 | 188 | } | 187 | } |
2461 | 189 | catch (std::exception const& e) | 188 | catch (std::exception const& e) |
2462 | 190 | { | 189 | { |
2463 | 191 | std::cerr << e.what() << std::endl; | 190 | std::cerr << e.what() << std::endl; |
2464 | 192 | // refresh again soon as get_remote_scopes failed | 191 | // refresh again soon as get_remote_scopes failed |
2466 | 193 | next_refresh_timeout_ = c_failed_refresh_timeout; | 192 | next_refresh_timeout_ = failed_refresh_timeout_; |
2467 | 194 | return; | 193 | return; |
2468 | 195 | } | 194 | } |
2469 | 196 | 195 | ||
2470 | 197 | 196 | ||
2471 | === modified file 'src/scopes/internal/zmq_middleware/ZmqConfig.cpp' | |||
2472 | --- src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2014-01-23 11:28:34 +0000 | |||
2473 | +++ src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2014-05-08 12:06:13 +0000 | |||
2474 | @@ -18,6 +18,11 @@ | |||
2475 | 18 | 18 | ||
2476 | 19 | #include <unity/scopes/internal/zmq_middleware/ZmqConfig.h> | 19 | #include <unity/scopes/internal/zmq_middleware/ZmqConfig.h> |
2477 | 20 | 20 | ||
2478 | 21 | #include <unity/scopes/internal/DfltConfig.h> | ||
2479 | 22 | #include <unity/scopes/ScopeExceptions.h> | ||
2480 | 23 | |||
2481 | 24 | #include <unistd.h> | ||
2482 | 25 | |||
2483 | 21 | using namespace std; | 26 | using namespace std; |
2484 | 22 | 27 | ||
2485 | 23 | namespace unity | 28 | namespace unity |
2486 | @@ -29,27 +34,43 @@ | |||
2487 | 29 | namespace internal | 34 | namespace internal |
2488 | 30 | { | 35 | { |
2489 | 31 | 36 | ||
2490 | 32 | const char* ZmqConfig::ZMQ_CONFIG_GROUP = "Zmq"; | ||
2491 | 33 | |||
2492 | 34 | namespace | 37 | namespace |
2493 | 35 | { | 38 | { |
2496 | 36 | const string public_dir_str = "EndpointDir.Public"; | 39 | const string zmq_config_group = "Zmq"; |
2497 | 37 | const string private_dir_str = "EndpointDir.Private"; | 40 | const string public_dir_key = "EndpointDir"; |
2498 | 38 | } | 41 | } |
2499 | 39 | 42 | ||
2500 | 40 | ZmqConfig::ZmqConfig(string const& configfile) : | 43 | ZmqConfig::ZmqConfig(string const& configfile) : |
2502 | 41 | ConfigBase(configfile) | 44 | ConfigBase(configfile, DFLT_ZMQ_MIDDLEWARE_INI) |
2503 | 42 | { | 45 | { |
2514 | 43 | if (configfile.empty()) | 46 | if (!configfile.empty()) |
2515 | 44 | { | 47 | { |
2516 | 45 | public_dir_ = "/tmp"; | 48 | public_dir_ = get_optional_string(zmq_config_group, public_dir_key); |
2517 | 46 | private_dir_ = "/tmp"; | 49 | } |
2518 | 47 | } | 50 | |
2519 | 48 | else | 51 | // Set the endpoint directory if it was not set explicitly. |
2520 | 49 | { | 52 | // We look for the XDG_RUNTIME_DIR env variable. If that is not |
2521 | 50 | public_dir_ = get_string(ZMQ_CONFIG_GROUP, public_dir_str); | 53 | // set, we give up. |
2522 | 51 | private_dir_ = get_string(ZMQ_CONFIG_GROUP, private_dir_str); | 54 | if (public_dir_.empty()) |
2523 | 52 | } | 55 | { |
2524 | 56 | char* xdg_runtime_dir = secure_getenv("XDG_RUNTIME_DIR"); | ||
2525 | 57 | if (!xdg_runtime_dir || *xdg_runtime_dir == '\0') | ||
2526 | 58 | { | ||
2527 | 59 | throw ConfigException("No endpoint directories specified, and XDG_RUNTIME_DIR " | ||
2528 | 60 | "environment variable not set"); | ||
2529 | 61 | } | ||
2530 | 62 | public_dir_ = string(xdg_runtime_dir) + "/zmq"; | ||
2531 | 63 | } | ||
2532 | 64 | private_dir_ = public_dir_ + "/priv"; | ||
2533 | 65 | |||
2534 | 66 | const KnownEntries known_entries = { | ||
2535 | 67 | { zmq_config_group, | ||
2536 | 68 | { | ||
2537 | 69 | public_dir_key | ||
2538 | 70 | } | ||
2539 | 71 | } | ||
2540 | 72 | }; | ||
2541 | 73 | check_unknown_entries(known_entries); | ||
2542 | 53 | } | 74 | } |
2543 | 54 | 75 | ||
2544 | 55 | ZmqConfig::~ZmqConfig() | 76 | ZmqConfig::~ZmqConfig() |
2545 | 56 | 77 | ||
2546 | === modified file 'src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp' | |||
2547 | --- src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-04-28 06:24:24 +0000 | |||
2548 | +++ src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2014-05-08 12:06:13 +0000 | |||
2549 | @@ -40,6 +40,7 @@ | |||
2550 | 40 | #include <unity/UnityExceptions.h> | 40 | #include <unity/UnityExceptions.h> |
2551 | 41 | 41 | ||
2552 | 42 | #include <iostream> // TODO: remove this once logging is added | 42 | #include <iostream> // TODO: remove this once logging is added |
2553 | 43 | #include <sys/stat.h> | ||
2554 | 43 | 44 | ||
2555 | 44 | using namespace std; | 45 | using namespace std; |
2556 | 45 | 46 | ||
2557 | @@ -70,9 +71,22 @@ | |||
2558 | 70 | char const* scope_category = "Scope"; // scope adapter category name | 71 | char const* scope_category = "Scope"; // scope adapter category name |
2559 | 71 | char const* registry_category = "Registry"; // registry adapter category name | 72 | char const* registry_category = "Registry"; // registry adapter category name |
2560 | 72 | 73 | ||
2561 | 74 | // Create a directory with mode rwx------t if it doesn't exist yet. | ||
2562 | 75 | // We set the sticky bit to prevent the directory from being deleted: | ||
2563 | 76 | // if it happens to be under $XDG_RUNTIME_DIR and is not accessed | ||
2564 | 77 | // for more than six hours, the system may delete it. | ||
2565 | 78 | |||
2566 | 79 | void create_dir(string const& dir) | ||
2567 | 80 | { | ||
2568 | 81 | if (mkdir(dir.c_str(), 0700 | S_ISVTX) == -1 && errno != EEXIST) | ||
2569 | 82 | { | ||
2570 | 83 | throw FileException("cannot create endpoint directory " + dir, errno); | ||
2571 | 84 | } | ||
2572 | 85 | } | ||
2573 | 86 | |||
2574 | 73 | } // namespace | 87 | } // namespace |
2575 | 74 | 88 | ||
2577 | 75 | ZmqMiddleware::ZmqMiddleware(string const& server_name, string const& configfile, RuntimeImpl* runtime) | 89 | ZmqMiddleware::ZmqMiddleware(string const& server_name, RuntimeImpl* runtime, string const& configfile) |
2578 | 76 | try : | 90 | try : |
2579 | 77 | MiddlewareBase(runtime), | 91 | MiddlewareBase(runtime), |
2580 | 78 | server_name_(server_name), | 92 | server_name_(server_name), |
2581 | @@ -82,6 +96,17 @@ | |||
2582 | 82 | locate_timeout_(2000) // TODO: get timeout from config | 96 | locate_timeout_(2000) // TODO: get timeout from config |
2583 | 83 | { | 97 | { |
2584 | 84 | assert(!server_name.empty()); | 98 | assert(!server_name.empty()); |
2585 | 99 | |||
2586 | 100 | // Create the endpoint dirs if they don't exist. | ||
2587 | 101 | try | ||
2588 | 102 | { | ||
2589 | 103 | create_dir(config_.public_dir()); | ||
2590 | 104 | create_dir(config_.private_dir()); | ||
2591 | 105 | } | ||
2592 | 106 | catch (...) | ||
2593 | 107 | { | ||
2594 | 108 | throw MiddlewareException("cannot initialize zmq middleware for scope " + server_name); | ||
2595 | 109 | } | ||
2596 | 85 | } | 110 | } |
2597 | 86 | catch (zmqpp::exception const& e) | 111 | catch (zmqpp::exception const& e) |
2598 | 87 | { | 112 | { |
2599 | @@ -347,90 +372,63 @@ | |||
2600 | 347 | return proxy->to_string(); | 372 | return proxy->to_string(); |
2601 | 348 | } | 373 | } |
2602 | 349 | 374 | ||
2615 | 350 | MWRegistryProxy ZmqMiddleware::create_registry_proxy(string const& identity, string const& endpoint) | 375 | MWRegistryProxy ZmqMiddleware::registry_proxy() |
2616 | 351 | { | 376 | { |
2617 | 352 | MWRegistryProxy proxy; | 377 | lock_guard<mutex> lock(data_mutex_); |
2618 | 353 | try | 378 | |
2619 | 354 | { | 379 | if (!registry_proxy_) |
2620 | 355 | proxy.reset(new ZmqRegistry(this, endpoint, identity, registry_category, twoway_timeout_)); | 380 | { |
2621 | 356 | } | 381 | string r_id = runtime()->registry_identity(); // May be empty, if no registry is configured. |
2622 | 357 | catch (zmqpp::exception const& e) | 382 | if (!r_id.empty()) |
2623 | 358 | { | 383 | { |
2624 | 359 | rethrow_zmq_ex(e); | 384 | string r_endp = "ipc://" + config_.public_dir() + "/" + r_id; |
2625 | 360 | } | 385 | registry_proxy_.reset(new ZmqRegistry(this, r_endp, r_id, registry_category, twoway_timeout_)); |
2626 | 361 | return proxy; | 386 | } |
2627 | 387 | } | ||
2628 | 388 | return registry_proxy_; | ||
2629 | 389 | } | ||
2630 | 390 | |||
2631 | 391 | MWRegistryProxy ZmqMiddleware::ss_registry_proxy() | ||
2632 | 392 | { | ||
2633 | 393 | lock_guard<mutex> lock(data_mutex_); | ||
2634 | 394 | |||
2635 | 395 | if (!ss_registry_proxy_) | ||
2636 | 396 | { | ||
2637 | 397 | string ssr_id = runtime()->ss_registry_identity(); // May be empty, if no registry is configured. | ||
2638 | 398 | if (!ssr_id.empty()) | ||
2639 | 399 | { | ||
2640 | 400 | string ssr_endp = "ipc://" + config_.public_dir() + "/" + ssr_id; | ||
2641 | 401 | ss_registry_proxy_.reset(new ZmqRegistry(this, ssr_endp, ssr_id, registry_category, twoway_timeout_)); | ||
2642 | 402 | } | ||
2643 | 403 | } | ||
2644 | 404 | return ss_registry_proxy_; | ||
2645 | 362 | } | 405 | } |
2646 | 363 | 406 | ||
2647 | 364 | MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity) | 407 | MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity) |
2648 | 365 | { | 408 | { |
2660 | 366 | MWScopeProxy proxy; | 409 | string endpoint = "ipc://" + config_.private_dir() + "/" + identity; |
2661 | 367 | try | 410 | return make_shared<ZmqScope>(this, endpoint, identity, scope_category, twoway_timeout_); |
2651 | 368 | { | ||
2652 | 369 | string endpoint = "ipc://" + config_.private_dir() + "/" + identity; | ||
2653 | 370 | proxy.reset(new ZmqScope(this, endpoint, identity, scope_category, twoway_timeout_)); | ||
2654 | 371 | } | ||
2655 | 372 | catch (zmqpp::exception const& e) | ||
2656 | 373 | { | ||
2657 | 374 | rethrow_zmq_ex(e); | ||
2658 | 375 | } | ||
2659 | 376 | return proxy; | ||
2662 | 377 | } | 411 | } |
2663 | 378 | 412 | ||
2664 | 379 | MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity, string const& endpoint) | 413 | MWScopeProxy ZmqMiddleware::create_scope_proxy(string const& identity, string const& endpoint) |
2665 | 380 | { | 414 | { |
2676 | 381 | MWScopeProxy proxy; | 415 | return make_shared<ZmqScope>(this, endpoint, identity, scope_category, twoway_timeout_); |
2667 | 382 | try | ||
2668 | 383 | { | ||
2669 | 384 | proxy.reset(new ZmqScope(this, endpoint, identity, scope_category, twoway_timeout_)); | ||
2670 | 385 | } | ||
2671 | 386 | catch (zmqpp::exception const& e) | ||
2672 | 387 | { | ||
2673 | 388 | rethrow_zmq_ex(e); | ||
2674 | 389 | } | ||
2675 | 390 | return proxy; | ||
2677 | 391 | } | 416 | } |
2678 | 392 | 417 | ||
2679 | 393 | MWQueryProxy ZmqMiddleware::create_query_proxy(string const& identity, string const& endpoint) | 418 | MWQueryProxy ZmqMiddleware::create_query_proxy(string const& identity, string const& endpoint) |
2680 | 394 | { | 419 | { |
2691 | 395 | MWQueryProxy proxy; | 420 | return make_shared<ZmqQuery>(this, endpoint, identity, query_category); |
2682 | 396 | try | ||
2683 | 397 | { | ||
2684 | 398 | proxy.reset(new ZmqQuery(this, endpoint, identity, query_category)); | ||
2685 | 399 | } | ||
2686 | 400 | catch (zmqpp::exception const& e) | ||
2687 | 401 | { | ||
2688 | 402 | rethrow_zmq_ex(e); | ||
2689 | 403 | } | ||
2690 | 404 | return proxy; | ||
2692 | 405 | } | 421 | } |
2693 | 406 | 422 | ||
2694 | 407 | MWQueryCtrlProxy ZmqMiddleware::create_query_ctrl_proxy(string const& identity, string const& endpoint) | 423 | MWQueryCtrlProxy ZmqMiddleware::create_query_ctrl_proxy(string const& identity, string const& endpoint) |
2695 | 408 | { | 424 | { |
2706 | 409 | MWQueryCtrlProxy proxy; | 425 | return make_shared<ZmqQueryCtrl>(this, endpoint, identity, ctrl_category); |
2697 | 410 | try | ||
2698 | 411 | { | ||
2699 | 412 | proxy.reset(new ZmqQueryCtrl(this, endpoint, identity, ctrl_category)); | ||
2700 | 413 | } | ||
2701 | 414 | catch (zmqpp::exception const& e) | ||
2702 | 415 | { | ||
2703 | 416 | rethrow_zmq_ex(e); | ||
2704 | 417 | } | ||
2705 | 418 | return proxy; | ||
2707 | 419 | } | 426 | } |
2708 | 420 | 427 | ||
2709 | 421 | MWStateReceiverProxy ZmqMiddleware::create_state_receiver_proxy(std::string const& identity) | 428 | MWStateReceiverProxy ZmqMiddleware::create_state_receiver_proxy(std::string const& identity) |
2710 | 422 | { | 429 | { |
2722 | 423 | MWStateReceiverProxy proxy; | 430 | string endpoint = "ipc://" + config_.private_dir() + "/" + server_name_ + state_suffix; |
2723 | 424 | try | 431 | return make_shared<ZmqStateReceiver>(this, endpoint, identity, state_category); |
2713 | 425 | { | ||
2714 | 426 | proxy.reset(new ZmqStateReceiver(this, "ipc://" + config_.private_dir() + "/" + server_name_ + state_suffix, | ||
2715 | 427 | identity, state_category)); | ||
2716 | 428 | } | ||
2717 | 429 | catch (zmqpp::exception const& e) | ||
2718 | 430 | { | ||
2719 | 431 | rethrow_zmq_ex(e); | ||
2720 | 432 | } | ||
2721 | 433 | return proxy; | ||
2724 | 434 | } | 432 | } |
2725 | 435 | 433 | ||
2726 | 436 | MWQueryCtrlProxy ZmqMiddleware::add_query_ctrl_object(QueryCtrlObjectBase::SPtr const& ctrl) | 434 | MWQueryCtrlProxy ZmqMiddleware::add_query_ctrl_object(QueryCtrlObjectBase::SPtr const& ctrl) |
2727 | @@ -526,7 +524,7 @@ | |||
2728 | 526 | try | 524 | try |
2729 | 527 | { | 525 | { |
2730 | 528 | shared_ptr<RegistryI> ri(make_shared<RegistryI>(registry)); | 526 | shared_ptr<RegistryI> ri(make_shared<RegistryI>(registry)); |
2732 | 529 | auto adapter = find_adapter(server_name_, runtime()->registry_endpointdir(), registry_category); | 527 | auto adapter = find_adapter(server_name_, config_.public_dir(), registry_category); |
2733 | 530 | function<void()> df; | 528 | function<void()> df; |
2734 | 531 | auto p = safe_add(df, adapter, identity, ri); | 529 | auto p = safe_add(df, adapter, identity, ri); |
2735 | 532 | registry->set_disconnect_function(df); | 530 | registry->set_disconnect_function(df); |
2736 | 533 | 531 | ||
2737 | === modified file 'src/scopes/internal/zmq_middleware/ZmqObject.cpp' | |||
2738 | --- src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-04-17 05:59:48 +0000 | |||
2739 | +++ src/scopes/internal/zmq_middleware/ZmqObject.cpp 2014-05-08 12:06:13 +0000 | |||
2740 | @@ -47,9 +47,6 @@ | |||
2741 | 47 | { | 47 | { |
2742 | 48 | // this mutex protects all members of all ZmqObjectProxies | 48 | // this mutex protects all members of all ZmqObjectProxies |
2743 | 49 | std::mutex shared_mutex; | 49 | std::mutex shared_mutex; |
2744 | 50 | |||
2745 | 51 | // There is only one registry proxy, so share it across all ZmqObjectProxies | ||
2746 | 52 | ZmqRegistryProxy shared_reg_proxy = nullptr; | ||
2747 | 53 | } | 50 | } |
2748 | 54 | 51 | ||
2749 | 55 | #define MONITOR_ENDPOINT "ipc:///tmp/scopes-monitor" | 52 | #define MONITOR_ENDPOINT "ipc:///tmp/scopes-monitor" |
2750 | @@ -217,40 +214,16 @@ | |||
2751 | 217 | } | 214 | } |
2752 | 218 | catch (TimeoutException const&) | 215 | catch (TimeoutException const&) |
2753 | 219 | { | 216 | { |
2782 | 220 | // retrieve the registry proxy if we haven't already done so | 217 | auto registry_proxy = mw_base()->registry_proxy(); |
2783 | 221 | { | 218 | |
2784 | 222 | lock_guard<mutex> lock(shared_mutex); | 219 | // If no registry is configured or if this object is the registry itself, rethrow the exception |
2785 | 223 | if (!shared_reg_proxy) | 220 | if (!registry_proxy || identity() == registry_proxy->identity()) |
2758 | 224 | { | ||
2759 | 225 | auto runtime = mw_base() ? mw_base()->runtime() : nullptr; | ||
2760 | 226 | if (!runtime) | ||
2761 | 227 | { | ||
2762 | 228 | throw; | ||
2763 | 229 | } | ||
2764 | 230 | |||
2765 | 231 | // we must do this via lazy initialization as attempting to do this in | ||
2766 | 232 | // the constructor causes a deadlock when accessing runtime methods | ||
2767 | 233 | shared_reg_proxy = dynamic_pointer_cast<ZmqRegistry>(mw_base()->create_registry_proxy( | ||
2768 | 234 | runtime->registry_identity(), | ||
2769 | 235 | runtime->registry_endpoint())); | ||
2770 | 236 | |||
2771 | 237 | // this really shouldn't happen but if we do fail to retrieve the | ||
2772 | 238 | // registry proxy, just rethrow the exception | ||
2773 | 239 | if (!shared_reg_proxy) | ||
2774 | 240 | { | ||
2775 | 241 | throw; | ||
2776 | 242 | } | ||
2777 | 243 | } | ||
2778 | 244 | } | ||
2779 | 245 | |||
2780 | 246 | // if this object is the registry itself, rethrow the exception | ||
2781 | 247 | if (identity() == shared_reg_proxy->identity()) | ||
2786 | 248 | { | 221 | { |
2787 | 249 | throw; | 222 | throw; |
2788 | 250 | } | 223 | } |
2789 | 251 | 224 | ||
2790 | 252 | // rebind | 225 | // rebind |
2792 | 253 | ObjectProxy new_proxy = shared_reg_proxy->locate(identity()); | 226 | ObjectProxy new_proxy = registry_proxy->locate(identity()); |
2793 | 254 | 227 | ||
2794 | 255 | // update our proxy with the newly received data | 228 | // update our proxy with the newly received data |
2795 | 256 | // (we need to first store values in local variables outside of the mutex, | 229 | // (we need to first store values in local variables outside of the mutex, |
2796 | @@ -312,7 +285,7 @@ | |||
2797 | 312 | // If a request times out, we must trash the corresponding socket, otherwise | 285 | // If a request times out, we must trash the corresponding socket, otherwise |
2798 | 313 | // zmq gets confused: the reply will never be read, so the socket ends up | 286 | // zmq gets confused: the reply will never be read, so the socket ends up |
2799 | 314 | // in a bad state. | 287 | // in a bad state. |
2801 | 315 | // (removing a socket from the connection pool deletes it, hense closing the socket) | 288 | // (Removing a socket from the connection pool deletes it, hence closing the socket.) |
2802 | 316 | pool.remove(endpoint); | 289 | pool.remove(endpoint); |
2803 | 317 | throw TimeoutException("Request timed out after " + std::to_string(timeout) + " milliseconds"); | 290 | throw TimeoutException("Request timed out after " + std::to_string(timeout) + " milliseconds"); |
2804 | 318 | } | 291 | } |
2805 | 319 | 292 | ||
2806 | === modified file 'test/gtest/scopes/Activation/Activation_test.cpp' | |||
2807 | --- test/gtest/scopes/Activation/Activation_test.cpp 2014-04-15 05:36:38 +0000 | |||
2808 | +++ test/gtest/scopes/Activation/Activation_test.cpp 2014-05-08 12:06:13 +0000 | |||
2809 | @@ -513,7 +513,7 @@ | |||
2810 | 513 | 513 | ||
2811 | 514 | RaiiScopeThread(std::string const& scope_id, std::string const& configfile) | 514 | RaiiScopeThread(std::string const& scope_id, std::string const& configfile) |
2812 | 515 | : runtime(Runtime::create_scope_runtime(scope_id, configfile)), | 515 | : runtime(Runtime::create_scope_runtime(scope_id, configfile)), |
2814 | 516 | scope_thread([this]{ runtime->run_scope(&scope, "/foo"); }) {} | 516 | scope_thread([this, configfile]{ runtime->run_scope(&scope, configfile, "/foo"); }) {} |
2815 | 517 | 517 | ||
2816 | 518 | ~RaiiScopeThread() | 518 | ~RaiiScopeThread() |
2817 | 519 | { | 519 | { |
2818 | 520 | 520 | ||
2819 | === modified file 'test/gtest/scopes/Activation/Registry.ini.in' | |||
2820 | --- test/gtest/scopes/Activation/Registry.ini.in 2014-04-08 08:26:44 +0000 | |||
2821 | +++ test/gtest/scopes/Activation/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
2822 | @@ -1,7 +1,5 @@ | |||
2823 | 1 | [Registry] | 1 | [Registry] |
2824 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
2825 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
2826 | 4 | Zmq.EndpointDir = /tmp | ||
2827 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
2828 | 6 | Scope.InstallDir = /unused | 4 | Scope.InstallDir = /unused |
2829 | 7 | Click.InstallDir = /unused | 5 | Click.InstallDir = /unused |
2830 | 8 | 6 | ||
2831 | === modified file 'test/gtest/scopes/Activation/Zmq.ini.in' | |||
2832 | --- test/gtest/scopes/Activation/Zmq.ini.in 2014-01-14 17:31:16 +0000 | |||
2833 | +++ test/gtest/scopes/Activation/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
2834 | @@ -1,3 +1,2 @@ | |||
2835 | 1 | [Zmq] | 1 | [Zmq] |
2838 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
2837 | 3 | EndpointDir.Private = /tmp | ||
2839 | 4 | 3 | ||
2840 | === modified file 'test/gtest/scopes/Filters/Filters_test.cpp' | |||
2841 | --- test/gtest/scopes/Filters/Filters_test.cpp 2014-04-15 05:36:38 +0000 | |||
2842 | +++ test/gtest/scopes/Filters/Filters_test.cpp 2014-05-08 12:06:13 +0000 | |||
2843 | @@ -80,7 +80,7 @@ | |||
2844 | 80 | 80 | ||
2845 | 81 | RaiiScopeThread(std::string const& scope_id, std::string const& configfile) | 81 | RaiiScopeThread(std::string const& scope_id, std::string const& configfile) |
2846 | 82 | : runtime(Runtime::create_scope_runtime(scope_id, configfile)), | 82 | : runtime(Runtime::create_scope_runtime(scope_id, configfile)), |
2848 | 83 | scope_thread([this]{ runtime->run_scope(&scope, "/foo"); }) {} | 83 | scope_thread([this, configfile]{ runtime->run_scope(&scope, configfile, "/foo"); }) {} |
2849 | 84 | 84 | ||
2850 | 85 | ~RaiiScopeThread() | 85 | ~RaiiScopeThread() |
2851 | 86 | { | 86 | { |
2852 | 87 | 87 | ||
2853 | === modified file 'test/gtest/scopes/Filters/Registry.ini.in' | |||
2854 | --- test/gtest/scopes/Filters/Registry.ini.in 2014-04-08 08:26:44 +0000 | |||
2855 | +++ test/gtest/scopes/Filters/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
2856 | @@ -1,7 +1,5 @@ | |||
2857 | 1 | [Registry] | 1 | [Registry] |
2858 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
2859 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
2860 | 4 | Zmq.EndpointDir = /tmp | ||
2861 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
2862 | 6 | Scope.InstallDir = /unused | 4 | Scope.InstallDir = /unused |
2863 | 7 | Click.InstallDir = /unused | 5 | Click.InstallDir = /unused |
2864 | 8 | 6 | ||
2865 | === modified file 'test/gtest/scopes/Filters/Zmq.ini.in' | |||
2866 | --- test/gtest/scopes/Filters/Zmq.ini.in 2014-01-24 12:51:40 +0000 | |||
2867 | +++ test/gtest/scopes/Filters/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
2868 | @@ -1,3 +1,2 @@ | |||
2869 | 1 | [Zmq] | 1 | [Zmq] |
2872 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
2871 | 3 | EndpointDir.Private = /tmp | ||
2873 | 4 | 3 | ||
2874 | === modified file 'test/gtest/scopes/Invocation/Invocation_test.cpp' | |||
2875 | --- test/gtest/scopes/Invocation/Invocation_test.cpp 2014-05-05 09:21:30 +0000 | |||
2876 | +++ test/gtest/scopes/Invocation/Invocation_test.cpp 2014-05-08 12:06:13 +0000 | |||
2877 | @@ -120,10 +120,10 @@ | |||
2878 | 120 | EXPECT_EQ("", receiver->error_message()); | 120 | EXPECT_EQ("", receiver->error_message()); |
2879 | 121 | } | 121 | } |
2880 | 122 | 122 | ||
2882 | 123 | void scope_thread(Runtime::SPtr const& rt) | 123 | void scope_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
2883 | 124 | { | 124 | { |
2884 | 125 | TestScope scope; | 125 | TestScope scope; |
2886 | 126 | rt->run_scope(&scope, "/foo"); | 126 | rt->run_scope(&scope, runtime_ini_file, "/foo"); |
2887 | 127 | } | 127 | } |
2888 | 128 | 128 | ||
2889 | 129 | int main(int argc, char **argv) | 129 | int main(int argc, char **argv) |
2890 | @@ -131,7 +131,7 @@ | |||
2891 | 131 | ::testing::InitGoogleTest(&argc, argv); | 131 | ::testing::InitGoogleTest(&argc, argv); |
2892 | 132 | 132 | ||
2893 | 133 | Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini")); | 133 | Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini")); |
2895 | 134 | std::thread scope_t(scope_thread, srt); | 134 | std::thread scope_t(scope_thread, srt, "Runtime.ini"); |
2896 | 135 | 135 | ||
2897 | 136 | // Give thread some time to bind to its endpoint, to avoid getting ObjectNotExistException | 136 | // Give thread some time to bind to its endpoint, to avoid getting ObjectNotExistException |
2898 | 137 | // from a synchronous remote call. | 137 | // from a synchronous remote call. |
2899 | 138 | 138 | ||
2900 | === modified file 'test/gtest/scopes/Invocation/Registry.ini.in' | |||
2901 | --- test/gtest/scopes/Invocation/Registry.ini.in 2014-04-17 01:36:29 +0000 | |||
2902 | +++ test/gtest/scopes/Invocation/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
2903 | @@ -1,7 +1,5 @@ | |||
2904 | 1 | [Registry] | 1 | [Registry] |
2905 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
2906 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
2907 | 4 | Zmq.EndpointDir = /tmp | ||
2908 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
2909 | 6 | Scope.InstallDir = /unused | 4 | Scope.InstallDir = /unused |
2910 | 7 | Click.InstallDir = /unused | 5 | Click.InstallDir = /unused |
2911 | 8 | 6 | ||
2912 | === modified file 'test/gtest/scopes/Invocation/Zmq.ini.in' | |||
2913 | --- test/gtest/scopes/Invocation/Zmq.ini.in 2014-04-17 01:36:29 +0000 | |||
2914 | +++ test/gtest/scopes/Invocation/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
2915 | @@ -1,3 +1,2 @@ | |||
2916 | 1 | [Zmq] | 1 | [Zmq] |
2919 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
2918 | 3 | EndpointDir.Private = /tmp | ||
2920 | 4 | 3 | ||
2921 | === modified file 'test/gtest/scopes/Registry/RegistryTest.ini.in' | |||
2922 | --- test/gtest/scopes/Registry/RegistryTest.ini.in 2014-04-08 08:26:44 +0000 | |||
2923 | +++ test/gtest/scopes/Registry/RegistryTest.ini.in 2014-05-08 12:06:13 +0000 | |||
2924 | @@ -1,7 +1,5 @@ | |||
2925 | 1 | [Registry] | 1 | [Registry] |
2926 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
2927 | 3 | Zmq.Endpoint = ipc:///tmp/RegistryTest | ||
2928 | 4 | Zmq.EndpointDir = /tmp | ||
2929 | 5 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini | 3 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
2930 | 6 | Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes | 4 | Scope.InstallDir = @CMAKE_CURRENT_BINARY_DIR@/scopes |
2931 | 7 | OEM.InstallDir = /unused | 5 | OEM.InstallDir = /unused |
2932 | 8 | 6 | ||
2933 | === modified file 'test/gtest/scopes/Registry/Registry_test.cpp' | |||
2934 | --- test/gtest/scopes/Registry/Registry_test.cpp 2014-05-05 11:20:55 +0000 | |||
2935 | +++ test/gtest/scopes/Registry/Registry_test.cpp 2014-05-08 12:06:13 +0000 | |||
2936 | @@ -80,11 +80,13 @@ | |||
2937 | 80 | // wait for the registry to become available on middleware | 80 | // wait for the registry to become available on middleware |
2938 | 81 | // FIXME: remove this once we have async queries and can set arbitrary timeout when calling registry | 81 | // FIXME: remove this once we have async queries and can set arbitrary timeout when calling registry |
2939 | 82 | const int num_retries = 10; | 82 | const int num_retries = 10; |
2940 | 83 | bool registry_started = false; | ||
2941 | 83 | for (int i = 0; i < num_retries; ++i) | 84 | for (int i = 0; i < num_retries; ++i) |
2942 | 84 | { | 85 | { |
2943 | 85 | try | 86 | try |
2944 | 86 | { | 87 | { |
2945 | 87 | r->list(); // this will throw if the registry is not yet available on middleware | 88 | r->list(); // this will throw if the registry is not yet available on middleware |
2946 | 89 | registry_started = true; | ||
2947 | 88 | break; | 90 | break; |
2948 | 89 | } | 91 | } |
2949 | 90 | catch (std::exception const&) | 92 | catch (std::exception const&) |
2950 | @@ -92,6 +94,7 @@ | |||
2951 | 92 | sleep(1); | 94 | sleep(1); |
2952 | 93 | } | 95 | } |
2953 | 94 | } | 96 | } |
2954 | 97 | ASSERT_TRUE(registry_started); | ||
2955 | 95 | 98 | ||
2956 | 96 | auto meta = r->get_metadata("testscopeA"); | 99 | auto meta = r->get_metadata("testscopeA"); |
2957 | 97 | EXPECT_EQ("testscopeA", meta.scope_id()); | 100 | EXPECT_EQ("testscopeA", meta.scope_id()); |
2958 | 98 | 101 | ||
2959 | === modified file 'test/gtest/scopes/Registry/Runtime.ini.in' | |||
2960 | --- test/gtest/scopes/Registry/Runtime.ini.in 2014-04-03 16:50:44 +0000 | |||
2961 | +++ test/gtest/scopes/Registry/Runtime.ini.in 2014-05-08 12:06:13 +0000 | |||
2962 | @@ -3,3 +3,4 @@ | |||
2963 | 3 | Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/RegistryTest.ini | 3 | Registry.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/RegistryTest.ini |
2964 | 4 | Default.Middleware = Zmq | 4 | Default.Middleware = Zmq |
2965 | 5 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini | 5 | Zmq.ConfigFile = @CMAKE_CURRENT_BINARY_DIR@/Zmq.ini |
2966 | 6 | Smartscopes.Registry.Identity = | ||
2967 | 6 | 7 | ||
2968 | === modified file 'test/gtest/scopes/Registry/Zmq.ini.in' | |||
2969 | --- test/gtest/scopes/Registry/Zmq.ini.in 2014-04-01 16:58:32 +0000 | |||
2970 | +++ test/gtest/scopes/Registry/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
2971 | @@ -1,3 +1,2 @@ | |||
2972 | 1 | [Zmq] | 1 | [Zmq] |
2975 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
2974 | 3 | EndpointDir.Private = /tmp | ||
2976 | 4 | 3 | ||
2977 | === modified file 'test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp' | |||
2978 | --- test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-04-14 05:11:28 +0000 | |||
2979 | +++ test/gtest/scopes/Registry/scopes/testscopeB/testscopeB.cpp 2014-05-08 12:06:13 +0000 | |||
2980 | @@ -102,6 +102,6 @@ | |||
2981 | 102 | 102 | ||
2982 | 103 | MyScope scope; | 103 | MyScope scope; |
2983 | 104 | auto runtime = Runtime::create_scope_runtime("testscopeB", rt_config); | 104 | auto runtime = Runtime::create_scope_runtime("testscopeB", rt_config); |
2985 | 105 | runtime->run_scope(&scope, scope_config); | 105 | runtime->run_scope(&scope, rt_config, scope_config); |
2986 | 106 | return 0; | 106 | return 0; |
2987 | 107 | } | 107 | } |
2988 | 108 | 108 | ||
2989 | === modified file 'test/gtest/scopes/Runtime/Registry.ini.in' | |||
2990 | --- test/gtest/scopes/Runtime/Registry.ini.in 2014-04-08 08:26:44 +0000 | |||
2991 | +++ test/gtest/scopes/Runtime/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
2992 | @@ -1,7 +1,5 @@ | |||
2993 | 1 | [Registry] | 1 | [Registry] |
2994 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
2995 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
2996 | 4 | Zmq.EndpointDir = /tmp | ||
2997 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
2998 | 6 | Scope.InstallDir = /unused | 4 | Scope.InstallDir = /unused |
2999 | 7 | Click.InstallDir = /unused | 5 | Click.InstallDir = /unused |
3000 | 8 | 6 | ||
3001 | === modified file 'test/gtest/scopes/Runtime/Runtime_test.cpp' | |||
3002 | --- test/gtest/scopes/Runtime/Runtime_test.cpp 2014-04-17 07:17:31 +0000 | |||
3003 | +++ test/gtest/scopes/Runtime/Runtime_test.cpp 2014-05-08 12:06:13 +0000 | |||
3004 | @@ -382,22 +382,22 @@ | |||
3005 | 382 | this_thread::sleep_for(chrono::milliseconds(200)); | 382 | this_thread::sleep_for(chrono::milliseconds(200)); |
3006 | 383 | } | 383 | } |
3007 | 384 | 384 | ||
3009 | 385 | void scope_thread(Runtime::SPtr const& rt) | 385 | void scope_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
3010 | 386 | { | 386 | { |
3011 | 387 | TestScope scope; | 387 | TestScope scope; |
3013 | 388 | rt->run_scope(&scope, "/foo"); | 388 | rt->run_scope(&scope, runtime_ini_file, "/foo"); |
3014 | 389 | } | 389 | } |
3015 | 390 | 390 | ||
3017 | 391 | void pusher_thread(Runtime::SPtr const& rt) | 391 | void pusher_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
3018 | 392 | { | 392 | { |
3019 | 393 | PusherScope scope; | 393 | PusherScope scope; |
3021 | 394 | rt->run_scope(&scope, "/foo"); | 394 | rt->run_scope(&scope, runtime_ini_file, "/foo"); |
3022 | 395 | } | 395 | } |
3023 | 396 | 396 | ||
3025 | 397 | void slow_create_thread(Runtime::SPtr const& rt) | 397 | void slow_create_thread(Runtime::SPtr const& rt, string const& runtime_ini_file) |
3026 | 398 | { | 398 | { |
3027 | 399 | SlowCreateScope scope; | 399 | SlowCreateScope scope; |
3029 | 400 | rt->run_scope(&scope, "/foo"); | 400 | rt->run_scope(&scope, runtime_ini_file, "/foo"); |
3030 | 401 | } | 401 | } |
3031 | 402 | 402 | ||
3032 | 403 | int main(int argc, char **argv) | 403 | int main(int argc, char **argv) |
3033 | @@ -405,13 +405,13 @@ | |||
3034 | 405 | ::testing::InitGoogleTest(&argc, argv); | 405 | ::testing::InitGoogleTest(&argc, argv); |
3035 | 406 | 406 | ||
3036 | 407 | Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini")); | 407 | Runtime::SPtr srt = move(Runtime::create_scope_runtime("TestScope", "Runtime.ini")); |
3038 | 408 | std::thread scope_t(scope_thread, srt); | 408 | std::thread scope_t(scope_thread, srt, "Runtime.ini"); |
3039 | 409 | 409 | ||
3040 | 410 | Runtime::SPtr prt = move(Runtime::create_scope_runtime("PusherScope", "Runtime.ini")); | 410 | Runtime::SPtr prt = move(Runtime::create_scope_runtime("PusherScope", "Runtime.ini")); |
3042 | 411 | std::thread pusher_t(pusher_thread, prt); | 411 | std::thread pusher_t(pusher_thread, prt, "Runtime.ini"); |
3043 | 412 | 412 | ||
3044 | 413 | Runtime::SPtr scrt = move(Runtime::create_scope_runtime("SlowCreateScope", "Runtime.ini")); | 413 | Runtime::SPtr scrt = move(Runtime::create_scope_runtime("SlowCreateScope", "Runtime.ini")); |
3046 | 414 | std::thread slow_create_t(slow_create_thread, scrt); | 414 | std::thread slow_create_t(slow_create_thread, scrt, "Runtime.ini"); |
3047 | 415 | 415 | ||
3048 | 416 | // Give threads some time to bind to their endpoints, to avoid getting ObjectNotExistException | 416 | // Give threads some time to bind to their endpoints, to avoid getting ObjectNotExistException |
3049 | 417 | // from a synchronous remote call. | 417 | // from a synchronous remote call. |
3050 | 418 | 418 | ||
3051 | === modified file 'test/gtest/scopes/Runtime/Zmq.ini.in' | |||
3052 | --- test/gtest/scopes/Runtime/Zmq.ini.in 2013-11-29 12:20:25 +0000 | |||
3053 | +++ test/gtest/scopes/Runtime/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3054 | @@ -1,3 +1,2 @@ | |||
3055 | 1 | [Zmq] | 1 | [Zmq] |
3058 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3057 | 3 | EndpointDir.Private = /tmp | ||
3059 | 4 | 3 | ||
3060 | === modified file 'test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp' | |||
3061 | --- test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-05-08 07:25:37 +0000 | |||
3062 | +++ test/gtest/scopes/internal/ConfigBase/ConfigBase_test.cpp 2014-05-08 12:06:13 +0000 | |||
3063 | @@ -22,6 +22,8 @@ | |||
3064 | 22 | 22 | ||
3065 | 23 | #include <gtest/gtest.h> | 23 | #include <gtest/gtest.h> |
3066 | 24 | 24 | ||
3067 | 25 | #include <scope-api-testconfig.h> | ||
3068 | 26 | |||
3069 | 25 | using namespace std; | 27 | using namespace std; |
3070 | 26 | using namespace unity; | 28 | using namespace unity; |
3071 | 27 | using namespace unity::scopes; | 29 | using namespace unity::scopes; |
3072 | @@ -41,22 +43,25 @@ | |||
3073 | 41 | } | 43 | } |
3074 | 42 | }; | 44 | }; |
3075 | 43 | 45 | ||
3076 | 46 | const string TEST_DIR = string(TEST_BUILD_ROOT) + "/gtest/scopes/internal/ConfigBase"; | ||
3077 | 47 | const string TEST_INI = TEST_DIR + "/Test.ini"; | ||
3078 | 48 | |||
3079 | 44 | TEST(ConfigBase, basic) | 49 | TEST(ConfigBase, basic) |
3080 | 45 | { | 50 | { |
3082 | 46 | MyConfig c("Test.ini"); | 51 | MyConfig c(TEST_INI); |
3083 | 47 | EXPECT_TRUE(c.parser().get()); | 52 | EXPECT_TRUE(c.parser().get()); |
3084 | 48 | } | 53 | } |
3085 | 49 | 54 | ||
3086 | 50 | TEST(ConfigBase, optional_string) | 55 | TEST(ConfigBase, optional_string) |
3087 | 51 | { | 56 | { |
3089 | 52 | MyConfig c("Test.ini"); | 57 | MyConfig c(TEST_INI); |
3090 | 53 | EXPECT_EQ("", c.get_optional_string("SomeGroup", "NoSuchKey")); | 58 | EXPECT_EQ("", c.get_optional_string("SomeGroup", "NoSuchKey")); |
3091 | 54 | EXPECT_EQ("", c.get_optional_string("SomeGroup", "Empty")); | 59 | EXPECT_EQ("", c.get_optional_string("SomeGroup", "Empty")); |
3092 | 55 | } | 60 | } |
3093 | 56 | 61 | ||
3094 | 57 | TEST(ConfigBase, non_optional_string) | 62 | TEST(ConfigBase, non_optional_string) |
3095 | 58 | { | 63 | { |
3097 | 59 | MyConfig c("Test.ini"); | 64 | MyConfig c(TEST_INI); |
3098 | 60 | try | 65 | try |
3099 | 61 | { | 66 | { |
3100 | 62 | c.get_string("SomeGroup", "Empty"); | 67 | c.get_string("SomeGroup", "Empty"); |
3101 | @@ -64,13 +69,13 @@ | |||
3102 | 64 | } | 69 | } |
3103 | 65 | catch (ConfigException const& e) | 70 | catch (ConfigException const& e) |
3104 | 66 | { | 71 | { |
3106 | 67 | EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal empty value for Empty", e.what()); | 72 | EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal empty value for Empty", e.what()); |
3107 | 68 | } | 73 | } |
3108 | 69 | } | 74 | } |
3109 | 70 | 75 | ||
3110 | 71 | TEST(ConfigBase, middleware) | 76 | TEST(ConfigBase, middleware) |
3111 | 72 | { | 77 | { |
3113 | 73 | MyConfig c("Test.ini"); | 78 | MyConfig c(TEST_INI); |
3114 | 74 | EXPECT_EQ("Zmq", c.get_middleware("SomeGroup", "Zmq.Middleware")); | 79 | EXPECT_EQ("Zmq", c.get_middleware("SomeGroup", "Zmq.Middleware")); |
3115 | 75 | EXPECT_EQ("REST", c.get_middleware("SomeGroup", "REST.Middleware")); | 80 | EXPECT_EQ("REST", c.get_middleware("SomeGroup", "REST.Middleware")); |
3116 | 76 | try | 81 | try |
3117 | @@ -80,9 +85,9 @@ | |||
3118 | 80 | } | 85 | } |
3119 | 81 | catch (ConfigException const& e) | 86 | catch (ConfigException const& e) |
3120 | 82 | { | 87 | { |
3124 | 83 | EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for Zmq.BadMiddleware: \"foo\": " | 88 | EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal value for Zmq.BadMiddleware: \"foo\": " |
3125 | 84 | "legal values are \"Zmq\" and \"REST\"", | 89 | "legal values are \"Zmq\" and \"REST\"", |
3126 | 85 | e.what()); | 90 | e.what()); |
3127 | 86 | } | 91 | } |
3128 | 87 | try | 92 | try |
3129 | 88 | { | 93 | { |
3130 | @@ -91,15 +96,15 @@ | |||
3131 | 91 | } | 96 | } |
3132 | 92 | catch (ConfigException const& e) | 97 | catch (ConfigException const& e) |
3133 | 93 | { | 98 | { |
3137 | 94 | EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": Illegal value for REST.BadMiddleware: \"bar\": " | 99 | EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": Illegal value for REST.BadMiddleware: \"bar\": " |
3138 | 95 | "legal values are \"Zmq\" and \"REST\"", | 100 | "legal values are \"Zmq\" and \"REST\"", |
3139 | 96 | e.what()); | 101 | e.what()); |
3140 | 97 | } | 102 | } |
3141 | 98 | } | 103 | } |
3142 | 99 | 104 | ||
3143 | 100 | TEST(ConfigBase, throw_ex) | 105 | TEST(ConfigBase, throw_ex) |
3144 | 101 | { | 106 | { |
3146 | 102 | MyConfig c("Test.ini"); | 107 | MyConfig c(TEST_INI); |
3147 | 103 | EXPECT_TRUE(c.parser().get()); | 108 | EXPECT_TRUE(c.parser().get()); |
3148 | 104 | 109 | ||
3149 | 105 | try | 110 | try |
3150 | @@ -108,7 +113,7 @@ | |||
3151 | 108 | } | 113 | } |
3152 | 109 | catch (ConfigException const& e) | 114 | catch (ConfigException const& e) |
3153 | 110 | { | 115 | { |
3155 | 111 | EXPECT_STREQ("unity::scopes::ConfigException: \"Test.ini\": error", e.what()); | 116 | EXPECT_EQ("unity::scopes::ConfigException: \"" + TEST_INI + "\": error", e.what()); |
3156 | 112 | } | 117 | } |
3157 | 113 | } | 118 | } |
3158 | 114 | 119 | ||
3159 | @@ -116,11 +121,22 @@ | |||
3160 | 116 | { | 121 | { |
3161 | 117 | try | 122 | try |
3162 | 118 | { | 123 | { |
3164 | 119 | MyConfig c("no_such_file"); | 124 | MyConfig c("wrong_extension.x"); |
3165 | 125 | } | ||
3166 | 126 | catch (ConfigException const& e) | ||
3167 | 127 | { | ||
3168 | 128 | EXPECT_STREQ("unity::scopes::ConfigException: invalid config file name: \"wrong_extension.x\": " | ||
3169 | 129 | "missing .ini extension", | ||
3170 | 130 | e.what()); | ||
3171 | 131 | } | ||
3172 | 132 | |||
3173 | 133 | try | ||
3174 | 134 | { | ||
3175 | 135 | MyConfig c("no_such_file.ini"); | ||
3176 | 120 | } | 136 | } |
3177 | 121 | catch (FileException const& e) | 137 | catch (FileException const& e) |
3178 | 122 | { | 138 | { |
3180 | 123 | EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file: No such file or directory (errno = 4)", | 139 | EXPECT_STREQ("unity::FileException: Could not load ini file no_such_file.ini: No such file or directory (errno = 4)", |
3181 | 124 | e.what()); | 140 | e.what()); |
3182 | 125 | } | 141 | } |
3183 | 126 | } | 142 | } |
3184 | 127 | 143 | ||
3185 | === modified file 'test/gtest/scopes/internal/RegistryConfig/Registry.ini.in' | |||
3186 | --- test/gtest/scopes/internal/RegistryConfig/Registry.ini.in 2014-05-08 07:25:37 +0000 | |||
3187 | +++ test/gtest/scopes/internal/RegistryConfig/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
3188 | @@ -1,7 +1,5 @@ | |||
3189 | 1 | [Registry] | 1 | [Registry] |
3190 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
3191 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
3192 | 4 | Zmq.EndpointDir = /tmp/socket_for_registry | ||
3193 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
3194 | 6 | Scope.InstallDir = /SomeDir | 4 | Scope.InstallDir = /SomeDir |
3195 | 7 | Scoperunner.Path = /SomeAbsolutePath | 5 | Scoperunner.Path = /SomeAbsolutePath |
3196 | 8 | 6 | ||
3197 | === modified file 'test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp' | |||
3198 | --- test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-05-08 07:25:37 +0000 | |||
3199 | +++ test/gtest/scopes/internal/RegistryConfig/RegistryConfig_test.cpp 2014-05-08 12:06:13 +0000 | |||
3200 | @@ -33,7 +33,6 @@ | |||
3201 | 33 | RegistryConfig c("Registry", TEST_REGISTRY_PATH); | 33 | RegistryConfig c("Registry", TEST_REGISTRY_PATH); |
3202 | 34 | EXPECT_EQ("Registry", c.identity()); | 34 | EXPECT_EQ("Registry", c.identity()); |
3203 | 35 | EXPECT_EQ("Zmq", c.mw_kind()); | 35 | EXPECT_EQ("Zmq", c.mw_kind()); |
3204 | 36 | EXPECT_EQ("ipc:///tmp/socket_for_registry", c.endpoint()); | ||
3205 | 37 | EXPECT_EQ("Zmq.ini", c.mw_configfile()); | 36 | EXPECT_EQ("Zmq.ini", c.mw_configfile()); |
3206 | 38 | } | 37 | } |
3207 | 39 | 38 | ||
3208 | 40 | 39 | ||
3209 | === modified file 'test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in' | |||
3210 | --- test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in 2013-11-19 02:51:46 +0000 | |||
3211 | +++ test/gtest/scopes/internal/RegistryConfig/ScoperunnerRelativePath.ini.in 2014-05-08 12:06:13 +0000 | |||
3212 | @@ -1,7 +1,6 @@ | |||
3213 | 1 | [Registry] | 1 | [Registry] |
3214 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
3215 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry |
3216 | 4 | Zmq.EndpointDir = /tmp/socket_for_registry | ||
3217 | 5 | Zmq.ConfigFile = Zmq.ini | 4 | Zmq.ConfigFile = Zmq.ini |
3218 | 6 | Scope.InstallDir = /SomeDir | 5 | Scope.InstallDir = /SomeDir |
3219 | 7 | Scoperunner.Path = SomeRelativePath | 6 | Scoperunner.Path = SomeRelativePath |
3220 | 8 | 7 | ||
3221 | === modified file 'test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in' | |||
3222 | --- test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in 2014-04-08 08:26:44 +0000 | |||
3223 | +++ test/gtest/scopes/internal/ResultReplyObject/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
3224 | @@ -1,7 +1,5 @@ | |||
3225 | 1 | [Registry] | 1 | [Registry] |
3226 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
3227 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
3228 | 4 | Zmq.EndpointDir = /tmp | ||
3229 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
3230 | 6 | Scope.InstallDir = /unused | 4 | Scope.InstallDir = /unused |
3231 | 7 | Click.InstallDir = /unused | 5 | Click.InstallDir = /unused |
3232 | 8 | 6 | ||
3233 | === modified file 'test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in' | |||
3234 | --- test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in 2014-02-24 14:56:26 +0000 | |||
3235 | +++ test/gtest/scopes/internal/ResultReplyObject/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3236 | @@ -1,3 +1,2 @@ | |||
3237 | 1 | [Zmq] | 1 | [Zmq] |
3240 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3239 | 3 | EndpointDir.Private = /tmp | ||
3241 | 4 | 3 | ||
3242 | === modified file 'test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp' | |||
3243 | --- test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-02-05 13:08:06 +0000 | |||
3244 | +++ test/gtest/scopes/internal/RuntimeConfig/RuntimeConfig_test.cpp 2014-05-08 12:06:13 +0000 | |||
3245 | @@ -35,35 +35,6 @@ | |||
3246 | 35 | EXPECT_EQ("Zmq", c.default_middleware()); | 35 | EXPECT_EQ("Zmq", c.default_middleware()); |
3247 | 36 | } | 36 | } |
3248 | 37 | 37 | ||
3249 | 38 | TEST(RuntimeConfig, BadRegistryID) | ||
3250 | 39 | { | ||
3251 | 40 | try | ||
3252 | 41 | { | ||
3253 | 42 | RuntimeConfig c("BadRegID.ini"); | ||
3254 | 43 | FAIL(); | ||
3255 | 44 | } | ||
3256 | 45 | catch (ConfigException const& e) | ||
3257 | 46 | { | ||
3258 | 47 | EXPECT_STREQ("unity::scopes::ConfigException: \"BadRegID.ini\": Illegal character in value for " | ||
3259 | 48 | "Registry.Identity: \"Regi/stry\": identity cannot contain '/'", | ||
3260 | 49 | e.what()); | ||
3261 | 50 | } | ||
3262 | 51 | } | ||
3263 | 52 | |||
3264 | 53 | TEST(RuntimeConfig, MiddlewareEmpty) | ||
3265 | 54 | { | ||
3266 | 55 | try | ||
3267 | 56 | { | ||
3268 | 57 | RuntimeConfig c("MWEmpty.ini"); | ||
3269 | 58 | FAIL(); | ||
3270 | 59 | } | ||
3271 | 60 | catch (ConfigException const& e) | ||
3272 | 61 | { | ||
3273 | 62 | EXPECT_STREQ("unity::scopes::ConfigException: \"MWEmpty.ini\": Illegal empty value for Default.Middleware", | ||
3274 | 63 | e.what()); | ||
3275 | 64 | } | ||
3276 | 65 | } | ||
3277 | 66 | |||
3278 | 67 | TEST(RuntimeConfig, BadMiddleware) | 38 | TEST(RuntimeConfig, BadMiddleware) |
3279 | 68 | { | 39 | { |
3280 | 69 | try | 40 | try |
3281 | 70 | 41 | ||
3282 | === modified file 'test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in' | |||
3283 | --- test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in 2014-04-08 08:26:44 +0000 | |||
3284 | +++ test/gtest/scopes/internal/RuntimeImpl/Registry.ini.in 2014-05-08 12:06:13 +0000 | |||
3285 | @@ -1,9 +1,7 @@ | |||
3286 | 1 | [Registry] | 1 | [Registry] |
3287 | 2 | Middleware = Zmq | 2 | Middleware = Zmq |
3288 | 3 | Zmq.Endpoint = ipc:///tmp/socket_for_registry | ||
3289 | 4 | Zmq.EndpointDir = /tmp | ||
3290 | 5 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
3291 | 6 | Scoperunner.Path = /SomePath | 4 | Scoperunner.Path = /SomePath |
3293 | 7 | Scope.ConfigDir = /tmp | 5 | Scope.InstallDir = /tmp |
3294 | 8 | Scope.InstallDir = /tmp | 6 | Scope.InstallDir = /tmp |
3295 | 9 | Click.InstallDir = /unused | 7 | Click.InstallDir = /unused |
3296 | 10 | 8 | ||
3297 | === modified file 'test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in' | |||
3298 | --- test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in 2013-11-29 12:20:25 +0000 | |||
3299 | +++ test/gtest/scopes/internal/RuntimeImpl/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3300 | @@ -1,3 +1,2 @@ | |||
3301 | 1 | [Zmq] | 1 | [Zmq] |
3304 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3303 | 3 | EndpointDir.Private = /tmp | ||
3305 | 4 | 3 | ||
3306 | === modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp' | |||
3307 | --- test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-04-15 04:53:44 +0000 | |||
3308 | +++ test/gtest/scopes/internal/ScopeMetadataImpl/ScopeMetadataImpl_test.cpp 2014-05-08 12:06:13 +0000 | |||
3309 | @@ -37,7 +37,7 @@ | |||
3310 | 37 | TEST(ScopeMetadataImpl, basic) | 37 | TEST(ScopeMetadataImpl, basic) |
3311 | 38 | { | 38 | { |
3312 | 39 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 39 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3314 | 40 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); | 40 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3315 | 41 | 41 | ||
3316 | 42 | unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw)); | 42 | unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw)); |
3317 | 43 | mi->set_scope_id("scope_id"); | 43 | mi->set_scope_id("scope_id"); |
3318 | @@ -231,7 +231,7 @@ | |||
3319 | 231 | TEST(ScopeMetadataImpl, serialize) | 231 | TEST(ScopeMetadataImpl, serialize) |
3320 | 232 | { | 232 | { |
3321 | 233 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 233 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3323 | 234 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); | 234 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3324 | 235 | 235 | ||
3325 | 236 | unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw)); | 236 | unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(&mw)); |
3326 | 237 | mi->set_scope_id("scope_id"); | 237 | mi->set_scope_id("scope_id"); |
3327 | @@ -280,7 +280,7 @@ | |||
3328 | 280 | TEST(ScopeMetadataImpl, serialize_exceptions) | 280 | TEST(ScopeMetadataImpl, serialize_exceptions) |
3329 | 281 | { | 281 | { |
3330 | 282 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 282 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3332 | 283 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); | 283 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3333 | 284 | 284 | ||
3334 | 285 | ScopeMetadataImpl mi(&mw); | 285 | ScopeMetadataImpl mi(&mw); |
3335 | 286 | try | 286 | try |
3336 | @@ -347,7 +347,7 @@ | |||
3337 | 347 | TEST(ScopeMetadataImpl, deserialize_exceptions) | 347 | TEST(ScopeMetadataImpl, deserialize_exceptions) |
3338 | 348 | { | 348 | { |
3339 | 349 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 349 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3341 | 350 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini", rt.get()); | 350 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini"); |
3342 | 351 | 351 | ||
3343 | 352 | VariantMap m; | 352 | VariantMap m; |
3344 | 353 | try | 353 | try |
3345 | 354 | 354 | ||
3346 | === modified file 'test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in' | |||
3347 | --- test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in 2013-11-28 00:27:48 +0000 | |||
3348 | +++ test/gtest/scopes/internal/ScopeMetadataImpl/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3349 | @@ -1,3 +1,2 @@ | |||
3350 | 1 | [Zmq] | 1 | [Zmq] |
3353 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3352 | 3 | EndpointDir.Private = /tmp | ||
3354 | 4 | 3 | ||
3355 | === modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in' | |||
3356 | --- test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-02-04 12:31:29 +0000 | |||
3357 | +++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/SSRegistryTest.ini.in 2014-05-08 12:06:13 +0000 | |||
3358 | @@ -1,10 +1,5 @@ | |||
3359 | 1 | [Runtime] | ||
3360 | 2 | Registry.Identity = SSRegistryTest | ||
3361 | 3 | |||
3362 | 4 | [Registry] | 1 | [Registry] |
3363 | 5 | Middleware = Zmq | 2 | Middleware = Zmq |
3364 | 6 | Zmq.Endpoint = ipc:///tmp/SSRegistryTest | ||
3365 | 7 | Zmq.EndpointDir = /tmp | ||
3366 | 8 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
3367 | 9 | Scope.InstallDir = /tmp | 4 | Scope.InstallDir = /tmp |
3368 | 10 | Scoperunner.Path = /tmp | 5 | Scoperunner.Path = /tmp |
3369 | 11 | 6 | ||
3370 | === modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in' | |||
3371 | --- test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in 2014-01-17 09:59:38 +0000 | |||
3372 | +++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3373 | @@ -1,3 +1,2 @@ | |||
3374 | 1 | [Zmq] | 1 | [Zmq] |
3377 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3376 | 3 | EndpointDir.Private = /tmp | ||
3378 | 4 | 3 | ||
3379 | === modified file 'test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp' | |||
3380 | --- test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-04-16 07:04:34 +0000 | |||
3381 | +++ test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp 2014-05-08 12:06:13 +0000 | |||
3382 | @@ -61,12 +61,14 @@ | |||
3383 | 61 | std::string mw_kind = reg_conf.mw_kind(); | 61 | std::string mw_kind = reg_conf.mw_kind(); |
3384 | 62 | std::string mw_configfile = reg_conf.mw_configfile(); | 62 | std::string mw_configfile = reg_conf.mw_configfile(); |
3385 | 63 | 63 | ||
3386 | 64 | SSConfig ss_config(reg_rt_->ss_configfile()); | ||
3387 | 65 | |||
3388 | 64 | // Get middleware handles from runtimes | 66 | // Get middleware handles from runtimes |
3389 | 65 | reg_mw_ = reg_rt_->factory()->find(reg_id_, mw_kind); | 67 | reg_mw_ = reg_rt_->factory()->find(reg_id_, mw_kind); |
3390 | 66 | scope_mw_ = scope_rt_->factory()->create(scope_id_, mw_kind, mw_configfile); | 68 | scope_mw_ = scope_rt_->factory()->create(scope_id_, mw_kind, mw_configfile); |
3391 | 67 | 69 | ||
3392 | 68 | // Instantiate a SS registry and scope objects | 70 | // Instantiate a SS registry and scope objects |
3394 | 69 | reg_ = SSRegistryObject::SPtr(new SSRegistryObject(reg_mw_, scope_mw_->get_scope_endpoint(), 20000, 60, | 71 | reg_ = SSRegistryObject::SPtr(new SSRegistryObject(reg_mw_, ss_config, scope_mw_->get_scope_endpoint(), |
3395 | 70 | "http://127.0.0.1:" + std::to_string(server_.port_), false)); | 72 | "http://127.0.0.1:" + std::to_string(server_.port_), false)); |
3396 | 71 | scope_ = SSScopeObject::UPtr(new SSScopeObject(scope_id_, scope_mw_, reg_)); | 73 | scope_ = SSScopeObject::UPtr(new SSScopeObject(scope_id_, scope_mw_, reg_)); |
3397 | 72 | 74 | ||
3398 | @@ -119,7 +121,7 @@ | |||
3399 | 119 | EXPECT_THROW(reg_->get_metadata("dummy.scope.3"), NotFoundException); | 121 | EXPECT_THROW(reg_->get_metadata("dummy.scope.3"), NotFoundException); |
3400 | 120 | 122 | ||
3401 | 121 | // locate should throw (via mw) | 123 | // locate should throw (via mw) |
3403 | 122 | MWRegistryProxy mw_reg = reg_mw_->create_registry_proxy(reg_id_, reg_mw_->get_scope_endpoint()); | 124 | MWRegistryProxy mw_reg = reg_mw_->registry_proxy(); |
3404 | 123 | EXPECT_THROW(mw_reg->locate("Dummy Demo Scope"), RegistryException); | 125 | EXPECT_THROW(mw_reg->locate("Dummy Demo Scope"), RegistryException); |
3405 | 124 | 126 | ||
3406 | 125 | // list scopes (via mw) | 127 | // list scopes (via mw) |
3407 | 126 | 128 | ||
3408 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp' | |||
3409 | --- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-04-28 06:24:24 +0000 | |||
3410 | +++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/ObjectAdapter_test.cpp 2014-05-08 12:06:13 +0000 | |||
3411 | @@ -18,6 +18,7 @@ | |||
3412 | 18 | 18 | ||
3413 | 19 | #include <unity/scopes/internal/zmq_middleware/ObjectAdapter.h> | 19 | #include <unity/scopes/internal/zmq_middleware/ObjectAdapter.h> |
3414 | 20 | 20 | ||
3415 | 21 | #include <scope-api-testconfig.h> | ||
3416 | 21 | #include <scopes/internal/zmq_middleware/capnproto/Message.capnp.h> | 22 | #include <scopes/internal/zmq_middleware/capnproto/Message.capnp.h> |
3417 | 22 | #include <unity/scopes/internal/RuntimeImpl.h> | 23 | #include <unity/scopes/internal/RuntimeImpl.h> |
3418 | 23 | #include <unity/scopes/internal/zmq_middleware/ServantBase.h> | 24 | #include <unity/scopes/internal/zmq_middleware/ServantBase.h> |
3419 | @@ -31,7 +32,6 @@ | |||
3420 | 31 | #include <boost/regex.hpp> // Use Boost implementation until http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631 is fixed. | 32 | #include <boost/regex.hpp> // Use Boost implementation until http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631 is fixed. |
3421 | 32 | #include <capnp/serialize.h> | 33 | #include <capnp/serialize.h> |
3422 | 33 | #include <gtest/gtest.h> | 34 | #include <gtest/gtest.h> |
3423 | 34 | #include <scope-api-testconfig.h> | ||
3424 | 35 | 35 | ||
3425 | 36 | using namespace std; | 36 | using namespace std; |
3426 | 37 | using namespace unity; | 37 | using namespace unity; |
3427 | @@ -54,8 +54,8 @@ | |||
3428 | 54 | 54 | ||
3429 | 55 | TEST(ObjectAdapter, basic) | 55 | TEST(ObjectAdapter, basic) |
3430 | 56 | { | 56 | { |
3433 | 57 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 57 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3434 | 58 | (RuntimeImpl*)0x1); | 58 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3435 | 59 | 59 | ||
3436 | 60 | // Instantiate and destroy oneway and twoway adapters with single and multiple threads. | 60 | // Instantiate and destroy oneway and twoway adapters with single and multiple threads. |
3437 | 61 | { | 61 | { |
3438 | @@ -133,8 +133,8 @@ | |||
3439 | 133 | 133 | ||
3440 | 134 | TEST(ObjectAdapter, state_change) | 134 | TEST(ObjectAdapter, state_change) |
3441 | 135 | { | 135 | { |
3444 | 136 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 136 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3445 | 137 | (RuntimeImpl*)0x1); | 137 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3446 | 138 | 138 | ||
3447 | 139 | { | 139 | { |
3448 | 140 | wait(); | 140 | wait(); |
3449 | @@ -228,8 +228,8 @@ | |||
3450 | 228 | 228 | ||
3451 | 229 | TEST(ObjectAdapter, wait_for_shutdown) | 229 | TEST(ObjectAdapter, wait_for_shutdown) |
3452 | 230 | { | 230 | { |
3455 | 231 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 231 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3456 | 232 | (RuntimeImpl*)0x1); | 232 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3457 | 233 | 233 | ||
3458 | 234 | // Start the adapter and call shutdown() from a different thread after a delay, and wait for the | 234 | // Start the adapter and call shutdown() from a different thread after a delay, and wait for the |
3459 | 235 | // shutdown to complete. We check that the shutdown happens after at least the delay that was specified, | 235 | // shutdown to complete. We check that the shutdown happens after at least the delay that was specified, |
3460 | @@ -276,7 +276,7 @@ | |||
3461 | 276 | TEST(ObjectAdapter, add_remove_find) | 276 | TEST(ObjectAdapter, add_remove_find) |
3462 | 277 | { | 277 | { |
3463 | 278 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 278 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3465 | 279 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 279 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3466 | 280 | 280 | ||
3467 | 281 | wait(); | 281 | wait(); |
3468 | 282 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 5); | 282 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 5); |
3469 | @@ -337,8 +337,8 @@ | |||
3470 | 337 | 337 | ||
3471 | 338 | TEST(ObjectAdapter, dispatch_oneway_to_twoway) | 338 | TEST(ObjectAdapter, dispatch_oneway_to_twoway) |
3472 | 339 | { | 339 | { |
3475 | 340 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 340 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3476 | 341 | (RuntimeImpl*)0x1); | 341 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3477 | 342 | 342 | ||
3478 | 343 | wait(); | 343 | wait(); |
3479 | 344 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 344 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3480 | @@ -373,8 +373,8 @@ | |||
3481 | 373 | 373 | ||
3482 | 374 | TEST(ObjectAdapter, dispatch_twoway_to_oneway) | 374 | TEST(ObjectAdapter, dispatch_twoway_to_oneway) |
3483 | 375 | { | 375 | { |
3486 | 376 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 376 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3487 | 377 | (RuntimeImpl*)0x1); | 377 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3488 | 378 | 378 | ||
3489 | 379 | wait(); | 379 | wait(); |
3490 | 380 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Oneway, 1); | 380 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Oneway, 1); |
3491 | @@ -400,8 +400,8 @@ | |||
3492 | 400 | 400 | ||
3493 | 401 | TEST(ObjectAdapter, dispatch_not_exist) | 401 | TEST(ObjectAdapter, dispatch_not_exist) |
3494 | 402 | { | 402 | { |
3497 | 403 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 403 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3498 | 404 | (RuntimeImpl*)0x1); | 404 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3499 | 405 | 405 | ||
3500 | 406 | wait(); | 406 | wait(); |
3501 | 407 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 407 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3502 | @@ -442,8 +442,8 @@ | |||
3503 | 442 | 442 | ||
3504 | 443 | TEST(ObjectAdapter, bad_header) | 443 | TEST(ObjectAdapter, bad_header) |
3505 | 444 | { | 444 | { |
3508 | 445 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 445 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3509 | 446 | (RuntimeImpl*)0x1); | 446 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3510 | 447 | 447 | ||
3511 | 448 | { | 448 | { |
3512 | 449 | wait(); | 449 | wait(); |
3513 | @@ -503,8 +503,8 @@ | |||
3514 | 503 | 503 | ||
3515 | 504 | TEST(ObjectAdapter, corrupt_header) | 504 | TEST(ObjectAdapter, corrupt_header) |
3516 | 505 | { | 505 | { |
3519 | 506 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 506 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3520 | 507 | (RuntimeImpl*)0x1); | 507 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3521 | 508 | 508 | ||
3522 | 509 | { | 509 | { |
3523 | 510 | wait(); | 510 | wait(); |
3524 | @@ -563,7 +563,7 @@ | |||
3525 | 563 | TEST(ObjectAdapter, invoke_ok) | 563 | TEST(ObjectAdapter, invoke_ok) |
3526 | 564 | { | 564 | { |
3527 | 565 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 565 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3529 | 566 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 566 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3530 | 567 | 567 | ||
3531 | 568 | wait(); | 568 | wait(); |
3532 | 569 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 569 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3533 | @@ -615,7 +615,7 @@ | |||
3534 | 615 | TEST(ObjectAdapter, invoke_object_not_exist) | 615 | TEST(ObjectAdapter, invoke_object_not_exist) |
3535 | 616 | { | 616 | { |
3536 | 617 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 617 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3538 | 618 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 618 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3539 | 619 | 619 | ||
3540 | 620 | wait(); | 620 | wait(); |
3541 | 621 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 621 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3542 | @@ -660,7 +660,7 @@ | |||
3543 | 660 | TEST(ObjectAdapter, invoke_operation_not_exist) | 660 | TEST(ObjectAdapter, invoke_operation_not_exist) |
3544 | 661 | { | 661 | { |
3545 | 662 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 662 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3547 | 663 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 663 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3548 | 664 | 664 | ||
3549 | 665 | wait(); | 665 | wait(); |
3550 | 666 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 666 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3551 | @@ -780,7 +780,7 @@ | |||
3552 | 780 | TEST(ObjectAdapter, twoway_threading) | 780 | TEST(ObjectAdapter, twoway_threading) |
3553 | 781 | { | 781 | { |
3554 | 782 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 782 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3556 | 783 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 783 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3557 | 784 | 784 | ||
3558 | 785 | // Single servant to which we send requests concurrently. | 785 | // Single servant to which we send requests concurrently. |
3559 | 786 | shared_ptr<CountingServant> o(new CountingServant(100)); | 786 | shared_ptr<CountingServant> o(new CountingServant(100)); |
3560 | @@ -814,7 +814,7 @@ | |||
3561 | 814 | TEST(ObjectAdapter, oneway_threading) | 814 | TEST(ObjectAdapter, oneway_threading) |
3562 | 815 | { | 815 | { |
3563 | 816 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 816 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3565 | 817 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 817 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3566 | 818 | 818 | ||
3567 | 819 | // Single servant to which we send requests concurrently. | 819 | // Single servant to which we send requests concurrently. |
3568 | 820 | shared_ptr<CountingServant> o(new CountingServant(100)); | 820 | shared_ptr<CountingServant> o(new CountingServant(100)); |
3569 | @@ -885,7 +885,7 @@ | |||
3570 | 885 | TEST(ObjectAdapter, servant_map_destructor) | 885 | TEST(ObjectAdapter, servant_map_destructor) |
3571 | 886 | { | 886 | { |
3572 | 887 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 887 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3574 | 888 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", rt.get()); | 888 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3575 | 889 | 889 | ||
3576 | 890 | { | 890 | { |
3577 | 891 | wait(); | 891 | wait(); |
3578 | @@ -1056,8 +1056,9 @@ | |||
3579 | 1056 | 1056 | ||
3580 | 1057 | wait(200); // Give zmq some time to finish the bind. | 1057 | wait(200); // Give zmq some time to finish the bind. |
3581 | 1058 | 1058 | ||
3584 | 1059 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 1059 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3585 | 1060 | (RuntimeImpl*)0x1); | 1060 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3586 | 1061 | |||
3587 | 1061 | wait(); | 1062 | wait(); |
3588 | 1062 | try | 1063 | try |
3589 | 1063 | { | 1064 | { |
3590 | @@ -1093,8 +1094,8 @@ | |||
3591 | 1093 | 1094 | ||
3592 | 1094 | wait(200); // Give zmq some time to finish the bind. | 1095 | wait(200); // Give zmq some time to finish the bind. |
3593 | 1095 | 1096 | ||
3596 | 1096 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 1097 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3597 | 1097 | (RuntimeImpl*)0x1); | 1098 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3598 | 1098 | wait(); | 1099 | wait(); |
3599 | 1099 | try | 1100 | try |
3600 | 1100 | { | 1101 | { |
3601 | @@ -1122,8 +1123,8 @@ | |||
3602 | 1122 | 1123 | ||
3603 | 1123 | TEST(ObjectAdapter, dflt_servant) | 1124 | TEST(ObjectAdapter, dflt_servant) |
3604 | 1124 | { | 1125 | { |
3607 | 1125 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 1126 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3608 | 1126 | (RuntimeImpl*)0x1); | 1127 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3609 | 1127 | 1128 | ||
3610 | 1128 | wait(); | 1129 | wait(); |
3611 | 1129 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 1130 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3612 | @@ -1177,8 +1178,8 @@ | |||
3613 | 1177 | 1178 | ||
3614 | 1178 | TEST(ObjectAdapter, dflt_servant_exceptions) | 1179 | TEST(ObjectAdapter, dflt_servant_exceptions) |
3615 | 1179 | { | 1180 | { |
3618 | 1180 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini", | 1181 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3619 | 1181 | (RuntimeImpl*)0x1); | 1182 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini"); |
3620 | 1182 | 1183 | ||
3621 | 1183 | wait(); | 1184 | wait(); |
3622 | 1184 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 1185 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3623 | 1185 | 1186 | ||
3624 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in' | |||
3625 | --- test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in 2013-11-28 00:27:48 +0000 | |||
3626 | +++ test/gtest/scopes/internal/zmq_middleware/ObjectAdapter/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3627 | @@ -1,3 +1,2 @@ | |||
3628 | 1 | [Zmq] | 1 | [Zmq] |
3631 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3630 | 3 | EndpointDir.Private = /tmp | ||
3632 | 4 | 3 | ||
3633 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp' | |||
3634 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-05-05 07:14:52 +0000 | |||
3635 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2014-05-08 12:06:13 +0000 | |||
3636 | @@ -96,7 +96,6 @@ | |||
3637 | 96 | string identity = runtime->registry_identity(); | 96 | string identity = runtime->registry_identity(); |
3638 | 97 | RegistryConfig c(identity, runtime->registry_configfile()); | 97 | RegistryConfig c(identity, runtime->registry_configfile()); |
3639 | 98 | string mw_kind = c.mw_kind(); | 98 | string mw_kind = c.mw_kind(); |
3640 | 99 | string mw_endpoint = c.endpoint(); | ||
3641 | 100 | string mw_configfile = c.mw_configfile(); | 99 | string mw_configfile = c.mw_configfile(); |
3642 | 101 | 100 | ||
3643 | 102 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); | 101 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3644 | @@ -120,7 +119,6 @@ | |||
3645 | 120 | string identity = runtime->registry_identity(); | 119 | string identity = runtime->registry_identity(); |
3646 | 121 | RegistryConfig c(identity, runtime->registry_configfile()); | 120 | RegistryConfig c(identity, runtime->registry_configfile()); |
3647 | 122 | string mw_kind = c.mw_kind(); | 121 | string mw_kind = c.mw_kind(); |
3648 | 123 | string mw_endpoint = c.endpoint(); | ||
3649 | 124 | string mw_configfile = c.mw_configfile(); | 122 | string mw_configfile = c.mw_configfile(); |
3650 | 125 | 123 | ||
3651 | 126 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); | 124 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3652 | @@ -170,7 +168,6 @@ | |||
3653 | 170 | string identity = runtime->registry_identity(); | 168 | string identity = runtime->registry_identity(); |
3654 | 171 | RegistryConfig c(identity, runtime->registry_configfile()); | 169 | RegistryConfig c(identity, runtime->registry_configfile()); |
3655 | 172 | string mw_kind = c.mw_kind(); | 170 | string mw_kind = c.mw_kind(); |
3656 | 173 | string mw_endpoint = c.endpoint(); | ||
3657 | 174 | string mw_configfile = c.mw_configfile(); | 171 | string mw_configfile = c.mw_configfile(); |
3658 | 175 | 172 | ||
3659 | 176 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); | 173 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3660 | @@ -223,7 +220,6 @@ | |||
3661 | 223 | string identity = runtime->registry_identity(); | 220 | string identity = runtime->registry_identity(); |
3662 | 224 | RegistryConfig c(identity, runtime->registry_configfile()); | 221 | RegistryConfig c(identity, runtime->registry_configfile()); |
3663 | 225 | string mw_kind = c.mw_kind(); | 222 | string mw_kind = c.mw_kind(); |
3664 | 226 | string mw_endpoint = c.endpoint(); | ||
3665 | 227 | string mw_configfile = c.mw_configfile(); | 223 | string mw_configfile = c.mw_configfile(); |
3666 | 228 | 224 | ||
3667 | 229 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); | 225 | MiddlewareBase::SPtr middleware = runtime->factory()->create(identity, mw_kind, mw_configfile); |
3668 | @@ -316,7 +312,6 @@ | |||
3669 | 316 | string identity = runtime->registry_identity(); | 312 | string identity = runtime->registry_identity(); |
3670 | 317 | RegistryConfig c(identity, runtime->registry_configfile()); | 313 | RegistryConfig c(identity, runtime->registry_configfile()); |
3671 | 318 | string mw_kind = c.mw_kind(); | 314 | string mw_kind = c.mw_kind(); |
3672 | 319 | string mw_endpoint = c.endpoint(); | ||
3673 | 320 | string mw_configfile = c.mw_configfile(); | 315 | string mw_configfile = c.mw_configfile(); |
3674 | 321 | RegistryObject::ScopeExecData dummy_exec_data; | 316 | RegistryObject::ScopeExecData dummy_exec_data; |
3675 | 322 | 317 | ||
3676 | @@ -500,7 +495,7 @@ | |||
3677 | 500 | // test locating the same scope multiple times | 495 | // test locating the same scope multiple times |
3678 | 501 | TEST_F(RegistryTest, locate_one) | 496 | TEST_F(RegistryTest, locate_one) |
3679 | 502 | { | 497 | { |
3681 | 503 | // locate all scopes (hense starting all scope processes) | 498 | // locate all scopes (hence starting all scope processes) |
3682 | 504 | for (auto const& scope_id : scope_ids) | 499 | for (auto const& scope_id : scope_ids) |
3683 | 505 | { | 500 | { |
3684 | 506 | EXPECT_EQ(proxies[scope_id], reg->locate(scope_id)); | 501 | EXPECT_EQ(proxies[scope_id], reg->locate(scope_id)); |
3685 | @@ -603,7 +598,7 @@ | |||
3686 | 603 | // test removing a scope | 598 | // test removing a scope |
3687 | 604 | TEST_F(RegistryTest, locate_remove) | 599 | TEST_F(RegistryTest, locate_remove) |
3688 | 605 | { | 600 | { |
3690 | 606 | // locate all scopes (hense starting all scope processes) | 601 | // locate all scopes (hence starting all scope processes) |
3691 | 607 | for (auto const& scope_id : scope_ids) | 602 | for (auto const& scope_id : scope_ids) |
3692 | 608 | { | 603 | { |
3693 | 609 | EXPECT_EQ(proxies[scope_id], reg->locate(scope_id)); | 604 | EXPECT_EQ(proxies[scope_id], reg->locate(scope_id)); |
3694 | @@ -612,7 +607,7 @@ | |||
3695 | 612 | // check that 6 new processes were started | 607 | // check that 6 new processes were started |
3696 | 613 | EXPECT_EQ(6, process_count()); | 608 | EXPECT_EQ(6, process_count()); |
3697 | 614 | 609 | ||
3699 | 615 | // remove a scope (hense killing the process) | 610 | // remove a scope (hence killing the process) |
3700 | 616 | EXPECT_TRUE(reg->remove_local_scope(scope_ids[0])); | 611 | EXPECT_TRUE(reg->remove_local_scope(scope_ids[0])); |
3701 | 617 | 612 | ||
3702 | 618 | // check that we now have 5 scopes running | 613 | // check that we now have 5 scopes running |
3703 | 619 | 614 | ||
3704 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in' | |||
3705 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in 2014-03-17 06:45:44 +0000 | |||
3706 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/TestRegistry.ini.in 2014-05-08 12:06:13 +0000 | |||
3707 | @@ -1,10 +1,5 @@ | |||
3708 | 1 | [Runtime] | ||
3709 | 2 | Registry.Identity = TestRegistry | ||
3710 | 3 | |||
3711 | 4 | [Registry] | 1 | [Registry] |
3712 | 5 | Middleware = Zmq | 2 | Middleware = Zmq |
3713 | 6 | Zmq.Endpoint = ipc:///tmp/TestRegistry | ||
3714 | 7 | Zmq.EndpointDir = /tmp | ||
3715 | 8 | Zmq.ConfigFile = Zmq.ini | 3 | Zmq.ConfigFile = Zmq.ini |
3716 | 9 | Scope.InstallDir = /tmp | 4 | Scope.InstallDir = /tmp |
3717 | 10 | Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner | 5 | Scoperunner.Path = @CMAKE_BINARY_DIR@/scoperunner/scoperunner |
3718 | 11 | 6 | ||
3719 | === modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in' | |||
3720 | --- test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in 2013-11-28 00:27:48 +0000 | |||
3721 | +++ test/gtest/scopes/internal/zmq_middleware/RegistryI/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3722 | @@ -1,3 +1,2 @@ | |||
3723 | 1 | [Zmq] | 1 | [Zmq] |
3726 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3725 | 3 | EndpointDir.Private = /tmp | ||
3727 | 4 | 3 | ||
3728 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp' | |||
3729 | --- test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp 2014-01-22 03:29:48 +0000 | |||
3730 | +++ test/gtest/scopes/internal/zmq_middleware/ServantBase/ServantBase_test.cpp 2014-05-08 12:06:13 +0000 | |||
3731 | @@ -93,8 +93,8 @@ | |||
3732 | 93 | 93 | ||
3733 | 94 | TEST(ServantBase, success) | 94 | TEST(ServantBase, success) |
3734 | 95 | { | 95 | { |
3737 | 96 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini", | 96 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3738 | 97 | (RuntimeImpl*)0x1); | 97 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini"); |
3739 | 98 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 98 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3740 | 99 | Current current; | 99 | Current current; |
3741 | 100 | current.op_name = "op"; | 100 | current.op_name = "op"; |
3742 | @@ -110,8 +110,8 @@ | |||
3743 | 110 | 110 | ||
3744 | 111 | TEST(ServantBase, ping) | 111 | TEST(ServantBase, ping) |
3745 | 112 | { | 112 | { |
3748 | 113 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini", | 113 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3749 | 114 | (RuntimeImpl*)0x1); | 114 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini"); |
3750 | 115 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 115 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3751 | 116 | Current current; | 116 | Current current; |
3752 | 117 | current.op_name = "ping"; | 117 | current.op_name = "ping"; |
3753 | @@ -127,8 +127,8 @@ | |||
3754 | 127 | 127 | ||
3755 | 128 | TEST(ServantBase, exceptions) | 128 | TEST(ServantBase, exceptions) |
3756 | 129 | { | 129 | { |
3759 | 130 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini", | 130 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3760 | 131 | (RuntimeImpl*)0x1); | 131 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini"); |
3761 | 132 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); | 132 | ObjectAdapter a(mw, "testscope", "ipc://testscope", RequestMode::Twoway, 1); |
3762 | 133 | Current current; | 133 | Current current; |
3763 | 134 | current.op_name = "op"; | 134 | current.op_name = "op"; |
3764 | 135 | 135 | ||
3765 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in' | |||
3766 | --- test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in 2013-11-28 00:27:48 +0000 | |||
3767 | +++ test/gtest/scopes/internal/zmq_middleware/ServantBase/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3768 | @@ -1,3 +1,2 @@ | |||
3769 | 1 | [Zmq] | 1 | [Zmq] |
3772 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3771 | 3 | EndpointDir.Private = /tmp | ||
3773 | 4 | 3 | ||
3774 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in' | |||
3775 | --- test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in 2013-11-28 00:27:48 +0000 | |||
3776 | +++ test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini.in 2014-05-08 12:06:13 +0000 | |||
3777 | @@ -1,3 +1,2 @@ | |||
3778 | 1 | [Zmq] | 1 | [Zmq] |
3781 | 2 | EndpointDir.Public = /tmp | 2 | EndpointDir = /tmp |
3780 | 3 | EndpointDir.Private = /tmp | ||
3782 | 4 | 3 | ||
3783 | === modified file 'test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp' | |||
3784 | --- test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp 2014-04-09 07:29:37 +0000 | |||
3785 | +++ test/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/ZmqMiddleware_test.cpp 2014-05-08 12:06:13 +0000 | |||
3786 | @@ -18,13 +18,13 @@ | |||
3787 | 18 | 18 | ||
3788 | 19 | #include <unity/scopes/internal/zmq_middleware/ZmqMiddleware.h> | 19 | #include <unity/scopes/internal/zmq_middleware/ZmqMiddleware.h> |
3789 | 20 | 20 | ||
3790 | 21 | #include <scope-api-testconfig.h> | ||
3791 | 21 | #include <unity/scopes/internal/RuntimeImpl.h> | 22 | #include <unity/scopes/internal/RuntimeImpl.h> |
3792 | 22 | #include <unity/scopes/internal/MWObjectProxy.h> | 23 | #include <unity/scopes/internal/MWObjectProxy.h> |
3793 | 23 | #include <unity/scopes/internal/zmq_middleware/ZmqObjectProxy.h> | 24 | #include <unity/scopes/internal/zmq_middleware/ZmqObjectProxy.h> |
3794 | 24 | #include <unity/scopes/ScopeExceptions.h> | 25 | #include <unity/scopes/ScopeExceptions.h> |
3795 | 25 | 26 | ||
3796 | 26 | #include <gtest/gtest.h> | 27 | #include <gtest/gtest.h> |
3797 | 27 | #include <scope-api-testconfig.h> | ||
3798 | 28 | 28 | ||
3799 | 29 | using namespace std; | 29 | using namespace std; |
3800 | 30 | using namespace unity::scopes; | 30 | using namespace unity::scopes; |
3801 | @@ -35,9 +35,8 @@ | |||
3802 | 35 | 35 | ||
3803 | 36 | TEST(ZmqMiddleware, basic) | 36 | TEST(ZmqMiddleware, basic) |
3804 | 37 | { | 37 | { |
3808 | 38 | ZmqMiddleware mw("testscope", | 38 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3809 | 39 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", | 39 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini"); |
3807 | 40 | (RuntimeImpl*)0x1); | ||
3810 | 41 | mw.start(); | 40 | mw.start(); |
3811 | 42 | sleep(1); | 41 | sleep(1); |
3812 | 43 | mw.stop(); | 42 | mw.stop(); |
3813 | @@ -46,7 +45,7 @@ | |||
3814 | 46 | TEST(ZmqMiddleware, string_to_proxy) | 45 | TEST(ZmqMiddleware, string_to_proxy) |
3815 | 47 | { | 46 | { |
3816 | 48 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); | 47 | auto rt = RuntimeImpl::create("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/RuntimeImpl/Runtime.ini"); |
3818 | 49 | ZmqMiddleware mw("testscope", TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", rt.get()); | 48 | ZmqMiddleware mw("testscope", rt.get(), TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini"); |
3819 | 50 | 49 | ||
3820 | 51 | ObjectProxy p; | 50 | ObjectProxy p; |
3821 | 52 | ScopeProxy sp; | 51 | ScopeProxy sp; |
3822 | @@ -84,9 +83,8 @@ | |||
3823 | 84 | 83 | ||
3824 | 85 | TEST(ZmqMiddleware, string_to_proxy_ex) | 84 | TEST(ZmqMiddleware, string_to_proxy_ex) |
3825 | 86 | { | 85 | { |
3829 | 87 | ZmqMiddleware mw("testscope", | 86 | ZmqMiddleware mw("testscope", (RuntimeImpl*)0x1, |
3830 | 88 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini", | 87 | TEST_BUILD_ROOT "/gtest/scopes/internal/zmq_middleware/ZmqMiddleware/Zmq.ini"); |
3828 | 89 | (RuntimeImpl*)0x1); | ||
3831 | 90 | 88 | ||
3832 | 91 | try | 89 | try |
3833 | 92 | { | 90 | { |
3834 | 93 | 91 | ||
3835 | === modified file 'test/whitespace/check_whitespace.py' | |||
3836 | --- test/whitespace/check_whitespace.py 2014-04-04 07:34:33 +0000 | |||
3837 | +++ test/whitespace/check_whitespace.py 2014-05-08 12:06:13 +0000 | |||
3838 | @@ -60,7 +60,7 @@ | |||
3839 | 60 | for lino, line in enumerate(ifile, start=1): | 60 | for lino, line in enumerate(ifile, start=1): |
3840 | 61 | if whitespace_pat.match(line) or tab_indent_pat.match(line): | 61 | if whitespace_pat.match(line) or tab_indent_pat.match(line): |
3841 | 62 | errors.append(lino) | 62 | errors.append(lino) |
3843 | 63 | if line == "\n": | 63 | if line == "\n" and lino != 1: # Don't complain about empty file with only a single line |
3844 | 64 | newlines_at_end += 1 | 64 | newlines_at_end += 1 |
3845 | 65 | else: | 65 | else: |
3846 | 66 | newlines_at_end = 0 | 66 | newlines_at_end = 0 |
3847 | 67 | 67 | ||
3848 | === modified file 'unity-scopes.map' | |||
3849 | --- unity-scopes.map 2014-04-10 14:39:05 +0000 | |||
3850 | +++ unity-scopes.map 2014-05-08 12:06:13 +0000 | |||
3851 | @@ -20,6 +20,7 @@ | |||
3852 | 20 | unity::scopes::internal::ScopeMetadataImpl::*; | 20 | unity::scopes::internal::ScopeMetadataImpl::*; |
3853 | 21 | unity::scopes::internal::ScopeObject::*; | 21 | unity::scopes::internal::ScopeObject::*; |
3854 | 22 | unity::scopes::internal::StateReceiverObject::*; | 22 | unity::scopes::internal::StateReceiverObject::*; |
3855 | 23 | unity::scopes::internal::smartscopes::SSConfig::*; | ||
3856 | 23 | unity::scopes::internal::smartscopes::SSRegistryObject::*; | 24 | unity::scopes::internal::smartscopes::SSRegistryObject::*; |
3857 | 24 | unity::scopes::internal::smartscopes::SSScopeObject::*; | 25 | unity::scopes::internal::smartscopes::SSScopeObject::*; |
3858 | 25 | }; | 26 | }; |
FAILED: Continuous integration, rev:303 jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- ci/452/ jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- utopic- amd64-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- utopic- armhf-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity-scopes- api-devel- utopic- i386-ci/ 4/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- scopes- api-devel- ci/452/ rebuild
http://