This repository was archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish active app list (compressed) thru nats
Change-Id: If0aa956ec55bdcd281525368b98a10860c8d47da
- Loading branch information
Anfernee Gui
committed
Jun 27, 2012
1 parent
721ea78
commit e7b8b5b
Showing
8 changed files
with
83 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,27 @@ | |
app.verify_unregistered | ||
end | ||
|
||
it 'should properly publish active applications set' do | ||
# setup the "app" | ||
app1 = TestApp.new('router_test1.vcap.me') | ||
app2 = TestApp.new('router_test2.vcap.me') | ||
dea = DummyDea.new(@nats_server.uri, '1234') | ||
dea.register_app(app1) | ||
dea.register_app(app2) | ||
app1.verify_registered | ||
app2.verify_registered | ||
original_apps_set = Set.new([app1.id, app2.id]) | ||
|
||
NATS.start(:uri => @nats_server.uri) do | ||
NATS.subscribe('router.active_apps') do |msg| | ||
apps_list = Yajl::Parser.parse(Zlib::Inflate.inflate(msg)) | ||
apps_set = Set.new(apps_list) | ||
apps_set.should == original_apps_set | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
anfernee
Contributor
|
||
NATS.stop | ||
end | ||
end | ||
end | ||
|
||
it 'should generate the same token as router v1 did' do | ||
Router.config({}) | ||
token = Router.generate_session_cookie(ROUTER_V1_DROPLET) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The gerrit test result says that: "expected: #<Set: {}>..."
Why do this test expect a empty set?