Commit 7714fccd authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

small changes on test syntax

parent a4c44d6e
...@@ -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")
......
...@@ -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 = 6600 @@subscriber_estimate_system_size = 6890
def global_configuration def global_configuration
@max_reserved_memory = "2m" @max_reserved_memory = "2m"
......
...@@ -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")
} }
......
...@@ -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']})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment