activemessaging 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -0
- data/.travis.yml +1 -2
- data/Appraisals +4 -2
- data/Gemfile +1 -18
- data/Rakefile +3 -27
- data/activemessaging.gemspec +24 -138
- data/gemfiles/activesupport23.gemfile +3 -5
- data/gemfiles/activesupport30.gemfile +3 -5
- data/gemfiles/activesupport31.gemfile +3 -5
- data/gemfiles/activesupport32.gemfile +3 -5
- data/lib/activemessaging/test_helper.rb +11 -74
- data/lib/activemessaging/threaded_poller.rb +16 -16
- data/lib/activemessaging/version.rb +3 -0
- metadata +59 -55
- checksums.yaml +0 -7
- data/Gemfile.lock +0 -87
- data/VERSION +0 -1
- data/gemfiles/activesupport23.gemfile.lock +0 -51
- data/gemfiles/activesupport30.gemfile.lock +0 -53
- data/gemfiles/activesupport31.gemfile.lock +0 -55
- data/gemfiles/activesupport32.gemfile.lock +0 -55
- data/init.rb +0 -1
- data/poller.rb +0 -14
- data/test/all_tests.rb +0 -10
- data/test/app/config/broker.yml +0 -4
- data/test/asqs_test.rb +0 -125
- data/test/config_test.rb +0 -42
- data/test/filter_test.rb +0 -131
- data/test/gateway_test.rb +0 -220
- data/test/jms_test.rb +0 -64
- data/test/reliable_msg_test.rb +0 -83
- data/test/stomp_test.rb +0 -168
- data/test/test_helper.rb +0 -36
- data/test/tracer_test.rb +0 -57
data/test/test_helper.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
rails_environtment_file = File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment")
|
2
|
-
|
3
|
-
if File.exists? rails_environtment_file
|
4
|
-
require rails_environment_file
|
5
|
-
APP_ROOT = RAILS_ROOT
|
6
|
-
APP_ENV = Rails.env
|
7
|
-
else
|
8
|
-
ENV['APP_ENV'] = 'test'
|
9
|
-
APP_ENV = 'test'
|
10
|
-
APP_ROOT = File.dirname(__FILE__) + '/app'
|
11
|
-
|
12
|
-
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
13
|
-
require 'rubygems'
|
14
|
-
require 'active_support/all'
|
15
|
-
|
16
|
-
module ActiveMessaging
|
17
|
-
def self.app_root
|
18
|
-
APP_ROOT
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.app_env
|
22
|
-
APP_ENV
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
require 'activemessaging/message_sender'
|
27
|
-
require 'activemessaging/processor'
|
28
|
-
require 'activemessaging/gateway'
|
29
|
-
require 'activemessaging/filter'
|
30
|
-
require 'activemessaging/adapters/test'
|
31
|
-
end
|
32
|
-
|
33
|
-
# load other libraries
|
34
|
-
require 'test/unit'
|
35
|
-
|
36
|
-
require File.dirname(__FILE__) + '/../lib/activemessaging/test_helper'
|
data/test/tracer_test.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/test_helper'
|
2
|
-
require 'activemessaging/trace_filter'
|
3
|
-
|
4
|
-
module ActiveMessaging #:nodoc:
|
5
|
-
def self.reload_activemessaging
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
class TestProcessor < ActiveMessaging::Processor
|
10
|
-
def on_message message
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class TestSender < ActiveMessaging::Processor
|
15
|
-
end
|
16
|
-
|
17
|
-
class FakeMessage < ActiveMessaging::BaseMessage
|
18
|
-
def initialize
|
19
|
-
super("Ni hao ma?", 1, {'destination'=>'/queue/helloWorld'}, '/queue/helloWorld')
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class TracerTest < Test::Unit::TestCase
|
24
|
-
include ActiveMessaging::TestHelper
|
25
|
-
|
26
|
-
def setup
|
27
|
-
ActiveMessaging::Gateway.define do |s|
|
28
|
-
s.queue :hello_world, '/queue/helloWorld'
|
29
|
-
s.queue :trace, '/queue/trace'
|
30
|
-
|
31
|
-
s.filter :trace_filter, :queue=>:trace
|
32
|
-
end
|
33
|
-
|
34
|
-
TestProcessor.subscribes_to :hello_world
|
35
|
-
TestSender.publishes_to :hello_world
|
36
|
-
end
|
37
|
-
|
38
|
-
def teardown
|
39
|
-
ActiveMessaging::Gateway.reset
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_should_trace_sent_messages
|
43
|
-
message = "Ni hao ma?"
|
44
|
-
|
45
|
-
sender = TestSender.new
|
46
|
-
sender.publish :hello_world, message
|
47
|
-
|
48
|
-
assert_message :trace, "<sent><from>TestSender</from><queue>hello_world</queue><message>#{message}</message></sent>"
|
49
|
-
assert_message :hello_world, message
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_should_trace_received_messages
|
53
|
-
ActiveMessaging::Gateway.dispatch FakeMessage.new
|
54
|
-
|
55
|
-
assert_message :trace, "<received><by>TestProcessor</by><queue>hello_world</queue><message>Ni hao ma?</message></received>"
|
56
|
-
end
|
57
|
-
end
|