Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
7714fccd
Commit
7714fccd
authored
Jun 05, 2012
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small changes on test syntax
parent
a4c44d6e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
test_channel_statistics.rb
test/test_channel_statistics.rb
+2
-2
test_measure_memory.rb
test/test_measure_memory.rb
+1
-1
test_subscriber_long_polling.rb
test/test_subscriber_long_polling.rb
+4
-4
test_subscriber_polling.rb
test/test_subscriber_polling.rb
+10
-10
No files found.
test/test_channel_statistics.rb
View file @
7714fccd
...
@@ -559,7 +559,7 @@ class TestChannelStatistics < Test::Unit::TestCase
...
@@ -559,7 +559,7 @@ class TestChannelStatistics < Test::Unit::TestCase
assert
(
response
.
has_key?
(
"uptime"
)
&&
!
response
[
"uptime"
].
empty?
,
"Hasn't a key uptime"
)
assert
(
response
.
has_key?
(
"uptime"
)
&&
!
response
[
"uptime"
].
empty?
,
"Hasn't a key uptime"
)
assert
(
response
.
has_key?
(
"infos"
)
&&
!
response
[
"infos"
].
empty?
,
"Hasn't a key infos"
)
assert
(
response
.
has_key?
(
"infos"
)
&&
!
response
[
"infos"
].
empty?
,
"Hasn't a key infos"
)
sleep
(
2
)
sleep
(
2
)
pub_3
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats?id=ALL'
).
get
:head
=>
headers
,
:timeout
=>
30
pub_3
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats?id=ALL'
).
get
:head
=>
headers
,
:timeout
=>
30
pub_3
.
callback
{
pub_3
.
callback
{
assert_equal
(
200
,
pub_3
.
response_header
.
status
,
"Request was not accepted"
)
assert_equal
(
200
,
pub_3
.
response_header
.
status
,
"Request was not accepted"
)
...
@@ -599,7 +599,7 @@ class TestChannelStatistics < Test::Unit::TestCase
...
@@ -599,7 +599,7 @@ class TestChannelStatistics < Test::Unit::TestCase
assert
(
response
[
"by_worker"
][
0
].
has_key?
(
"uptime"
)
&&
!
response
[
"by_worker"
][
0
][
"uptime"
].
empty?
,
"Hasn't a key uptime on worker info"
)
assert
(
response
[
"by_worker"
][
0
].
has_key?
(
"uptime"
)
&&
!
response
[
"by_worker"
][
0
][
"uptime"
].
empty?
,
"Hasn't a key uptime on worker info"
)
sleep
(
2
)
sleep
(
2
)
pub_3
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats'
).
get
:head
=>
headers
,
:timeout
=>
30
pub_3
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/channels-stats'
).
get
:head
=>
headers
,
:timeout
=>
30
pub_3
.
callback
{
pub_3
.
callback
{
assert_equal
(
200
,
pub_3
.
response_header
.
status
,
"Request was not accepted"
)
assert_equal
(
200
,
pub_3
.
response_header
.
status
,
"Request was not accepted"
)
...
...
test/test_measure_memory.rb
View file @
7714fccd
...
@@ -6,7 +6,7 @@ class TestMeasureMemory < Test::Unit::TestCase
...
@@ -6,7 +6,7 @@ class TestMeasureMemory < Test::Unit::TestCase
@@message_estimate_size
=
174
@@message_estimate_size
=
174
@@channel_estimate_size
=
536
@@channel_estimate_size
=
536
@@subscriber_estimate_size
=
230
@@subscriber_estimate_size
=
230
@@subscriber_estimate_system_size
=
6
60
0
@@subscriber_estimate_system_size
=
6
89
0
def
global_configuration
def
global_configuration
@max_reserved_memory
=
"2m"
@max_reserved_memory
=
"2m"
...
...
test/test_subscriber_long_polling.rb
View file @
7714fccd
...
@@ -142,11 +142,11 @@ class TestSubscriberLongPolling < Test::Unit::TestCase
...
@@ -142,11 +142,11 @@ class TestSubscriberLongPolling < Test::Unit::TestCase
EventMachine
.
stop
EventMachine
.
stop
}
}
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
}
}
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
}
}
...
@@ -303,11 +303,11 @@ class TestSubscriberLongPolling < Test::Unit::TestCase
...
@@ -303,11 +303,11 @@ class TestSubscriberLongPolling < Test::Unit::TestCase
EventMachine
.
stop
EventMachine
.
stop
}
}
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
}
}
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
}
}
...
...
test/test_subscriber_polling.rb
View file @
7714fccd
...
@@ -94,7 +94,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -94,7 +94,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"1"
)
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"1"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -139,7 +139,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -139,7 +139,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -185,7 +185,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -185,7 +185,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -230,7 +230,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -230,7 +230,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -249,7 +249,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -249,7 +249,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_3
.
response_header
[
'LAST_MODIFIED'
],
sub_4
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_3
.
response_header
[
'LAST_MODIFIED'
],
sub_4
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_3
.
response_header
[
'ETAG'
],
sub_4
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_3
.
response_header
[
'ETAG'
],
sub_4
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_4
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_4
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_4
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_4
.
response_header
[
'ETAG'
]})
...
@@ -370,7 +370,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -370,7 +370,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"1"
)
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"1"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -419,7 +419,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -419,7 +419,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -469,7 +469,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -469,7 +469,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
publish_message_inline
(
channel
,
{
'accept'
=>
'text/html'
},
body
+
"3"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -518,7 +518,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -518,7 +518,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'LAST_MODIFIED'
],
sub_2
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_1
.
response_header
[
'ETAG'
],
sub_2
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
publish_message_inline
(
channel_1
,
{
'accept'
=>
'text/html'
},
body
+
"1_1"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_2
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_2
.
response_header
[
'ETAG'
]})
...
@@ -537,7 +537,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
...
@@ -537,7 +537,7 @@ class TestSubscriberPolling < Test::Unit::TestCase
assert_equal
(
sub_3
.
response_header
[
'LAST_MODIFIED'
],
sub_4
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_3
.
response_header
[
'LAST_MODIFIED'
],
sub_4
.
response_header
[
'LAST_MODIFIED'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_3
.
response_header
[
'ETAG'
],
sub_4
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
assert_equal
(
sub_3
.
response_header
[
'ETAG'
],
sub_4
.
response_header
[
'ETAG'
].
to_s
,
"Wrong header"
)
sleep
(
1
)
# to publish the second message in a different second from the first
sleep
(
1
)
# to publish the second message in a different second from the first
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
publish_message_inline
(
channel_2
,
{
'accept'
=>
'text/html'
},
body
+
"1_2"
)
headers
.
merge!
({
'If-Modified-Since'
=>
sub_4
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_4
.
response_header
[
'ETAG'
]})
headers
.
merge!
({
'If-Modified-Since'
=>
sub_4
.
response_header
[
'LAST_MODIFIED'
],
'If-None-Match'
=>
sub_4
.
response_header
[
'ETAG'
]})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment