trace-util-adv 0.2.4 → 0.3.0
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/TODO.txt +18 -2
- data/VERSION +1 -1
- data/lib/appenders/appender.rb +1 -1
- data/lib/appenders/base_appender.rb +18 -20
- data/lib/appenders/include.rb +2 -2
- data/lib/appenders/types/html_appender.rb +1 -1
- data/lib/appenders/types/logger_appender.rb +1 -1
- data/lib/appenders/types/xml_appender.rb +1 -1
- data/lib/extensions/hash_extensions.rb +41 -19
- data/lib/extensions/hash_rule_extensions.rb +4 -0
- data/lib/extensions/symbol_extensions.rb +7 -5
- data/lib/filters/composite/composite_class_filter.rb +1 -0
- data/lib/filters/composite/composite_module_filter.rb +1 -0
- data/lib/filters/executor/filter_exec.rb +6 -2
- data/lib/filters/filter.rb +12 -17
- data/lib/filters/filter_factory.rb +1 -1
- data/lib/filters/filter_mappings.rb +4 -2
- data/lib/filters/include.rb +4 -8
- data/lib/filters/list/list_instance_var_filter.rb +1 -0
- data/lib/filters/name_filter.rb +13 -0
- data/lib/filters/simple/argument_filter.rb +2 -1
- data/lib/filters/simple/class_filter.rb +1 -1
- data/lib/filters/simple/instance_var_filter.rb +9 -6
- data/lib/filters/simple/method_filter.rb +1 -0
- data/lib/filters/simple/module_filter.rb +6 -3
- data/lib/rules/rule_match.rb +5 -4
- data/lib/targets/file_target.rb +11 -0
- data/lib/templates/base_template.rb +11 -12
- data/lib/templates/html_template.rb +35 -36
- data/lib/templates/string_template.rb +0 -1
- data/lib/templates/template_mappings.rb +4 -4
- data/lib/templates/xml_template.rb +0 -1
- data/lib/trace-util-adv.rb +36 -20
- data/lib/trace_calls/trace_ext.rb +4 -17
- data/test/action_handler/include.rb +4 -0
- data/test/action_handler/test_action_handler.rb +1 -2
- data/test/action_handler/test_create_action_handler.rb +6 -9
- data/test/appenders/include.rb +4 -0
- data/test/appenders/test_appender_templates.rb +57 -0
- data/test/appenders/test_create_appender.rb +9 -10
- data/test/extensions/include.rb +4 -0
- data/test/extensions/test_filters_creation.rb +4 -28
- data/test/extensions/test_hash_extensions.rb +44 -47
- data/test/extensions/test_hash_filter_extensions.rb +46 -29
- data/test/extensions/test_set_context.rb +9 -11
- data/test/extensions/test_string_extensions.rb +1 -3
- data/test/extensions/test_symbol_extensions.rb +2 -4
- data/test/filters/chain/test_filters_chain.rb +1 -51
- data/test/filters/composite/test_composite_class_filter.rb +1 -3
- data/test/filters/composite/test_composite_module_filter.rb +1 -3
- data/test/filters/composite/test_composite_var_filter.rb +8 -11
- data/test/filters/executor/test_filter_exec.rb +1 -3
- data/test/filters/include.rb +8 -0
- data/test/filters/msg_context/test_custom_filters.rb +13 -14
- data/test/filters/simple/test_base_filter.rb +8 -6
- data/test/filters/simple/test_class_filter.rb +1 -3
- data/test/filters/simple/test_instancevar_filter.rb +5 -9
- data/test/filters/simple/test_method_filter.rb +4 -9
- data/test/filters/simple/test_module_filter.rb +13 -10
- data/test/samples/sample_composite_filters.rb +15 -12
- data/test/targets/test_create_targets.rb +21 -0
- data/test/templates/include.rb +4 -0
- data/test/templates/test_create_templates.rb +23 -0
- data/test/templates/test_exec_templates.rb +6 -0
- data/test/trace_calls/include.rb +4 -0
- data/test/trace_calls/test_configure_.rb +17 -14
- data/test/trace_calls/tracing/test_html_tracing.rb +2 -3
- data/test/trace_calls/tracing/test_logger_tracing.rb +5 -4
- data/test/trace_calls/tracing/test_stream_tracing.rb +2 -3
- data/test/trace_calls/tracing/test_teamplate_log_tracing.rb +2 -3
- data/test/trace_calls/tracing/test_xml_tracing.rb +2 -3
- data/trace-util-adv.gemspec +14 -6
- metadata +13 -5
- data/test/appenders/test_appender_tracers.rb +0 -56
- data/test/tracers/test_create_tracers.rb +0 -46
- data/test/tracers/test_exec_tracers.rb +0 -11
@@ -33,18 +33,21 @@ Module_composite_filter_A = {
|
|
33
33
|
# for specific instance_vars, match on values (after .to_s on var)
|
34
34
|
Var_composite_filter_A = {
|
35
35
|
:name => 'template_path',
|
36
|
-
:vars => [
|
37
|
-
|
38
|
-
|
39
|
-
:include => [/.*\/taglib\/.*/],
|
40
|
-
:exclude => [/.*\/rapid_.*/]
|
41
|
-
}
|
42
|
-
},
|
43
|
-
{
|
44
|
-
:name => 'template_path',
|
36
|
+
:vars => [
|
37
|
+
{
|
38
|
+
:name => 'template_path', :type => :string,
|
45
39
|
:var_rules => {
|
46
|
-
:
|
47
|
-
:
|
40
|
+
:include => [/.*\/taglib\/.*/],
|
41
|
+
:exclude => [/.*\/rapid_.*/]
|
48
42
|
}
|
49
|
-
|
43
|
+
},
|
44
|
+
{
|
45
|
+
:name => 'template_path',
|
46
|
+
:var_rules => {
|
47
|
+
:exclude => [/.*\/rapid_.*/],
|
48
|
+
:default => :include
|
49
|
+
}
|
50
|
+
}
|
51
|
+
],
|
52
|
+
:default => :yield
|
50
53
|
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
# def test_create_xml_tracer
|
4
|
+
# xml_tracer = {:type => :xml, :to_file => 'log_files/xml/traced.xml'}.template
|
5
|
+
# assert_equal Tracing::XmlTemplate, xml_tracer.class, "Should create instance of XmlTemplate"
|
6
|
+
# end
|
7
|
+
#
|
8
|
+
# def test_create_html_tracer
|
9
|
+
# html_tracer = {:type => :html, :default_path => 'log_files/html'}.template
|
10
|
+
# assert_equal Tracing::HtmlTemplate, html_tracer.class, "Should create instance of HtmlTemplate"
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# def test_create_log_tracer
|
14
|
+
# log_tracer = {:type => :log, :default_path => 'log_files'}.template
|
15
|
+
# assert_equal Tracing::LogTemplate, log_tracer.class, "Should create instance of LogTemplate"
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# def test_create_log_tracer
|
19
|
+
# stream_tracer = {:type => :stream, :stream => :STDOUT}.template
|
20
|
+
# assert_equal Tracing::StreamTemplate, log_tracer.class, "Should create instance of StreamTemplate"
|
21
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "include"
|
2
|
+
|
3
|
+
|
4
|
+
class TestCreateTemplates < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def test_tracer
|
7
|
+
rule = {:template => :html}
|
8
|
+
result = rule.template
|
9
|
+
assert_equal result.class, Tracing::HtmlTemplate, "Should result in HtmlTemplate"
|
10
|
+
|
11
|
+
rule = {:template => :xml}
|
12
|
+
result = rule.template
|
13
|
+
assert_equal result.class, Tracing::XmlTemplate, "Should result in XmlTemplate"
|
14
|
+
|
15
|
+
rule = {:template => :string}
|
16
|
+
result = rule.template
|
17
|
+
assert_equal result.class, Tracing::StringTemplate, "Should result in StringTemplate"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
@@ -1,8 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require 'filters/base_filters'
|
3
|
-
require 'rules/hash_rule_extensions'
|
4
|
-
require "test/unit"
|
5
|
-
|
1
|
+
require "include"
|
6
2
|
|
7
3
|
class TestTraceCallsConfigure < Test::Unit::TestCase
|
8
4
|
|
@@ -14,28 +10,35 @@ class TestTraceCallsConfigure < Test::Unit::TestCase
|
|
14
10
|
|
15
11
|
@ah1_filter_1 = {:x_class_filter => "Dryml"}
|
16
12
|
@ah1_filter_1 = {:i_class_filter => "Template"}
|
13
|
+
|
14
|
+
@ah_filters = [@ah1_filter_1, @ah1_filter_2]
|
15
|
+
|
16
|
+
@ah1_app_1 = :xml
|
17
|
+
@ah1_app2 = :html
|
18
|
+
|
19
|
+
@appenders = [@ah1_app_1, @ah1_app2]
|
17
20
|
end
|
18
21
|
|
19
22
|
|
20
23
|
def test_register_action_handler_from_hash
|
21
24
|
# Action handler
|
22
|
-
ah1 = {:filters =>
|
25
|
+
ah1 = {:filters => @ah_filters, :appenders => @appenders}.action_handlers
|
23
26
|
action_handlers = ah1
|
24
27
|
# Trace configuration
|
25
|
-
configuration = Tracing::Configuration.new
|
28
|
+
configuration = Tracing::Configuration.new :action_handlers => action_handlers, :filters => @filters, :final_yield_action => :exclude
|
26
29
|
# configure
|
27
30
|
TraceCalls.configure(configuration)
|
28
31
|
end
|
29
32
|
|
30
33
|
def test_register_action_handler_from_hash
|
31
34
|
# Action handlers
|
32
|
-
ah1 = {:filters =>
|
35
|
+
ah1 = {:filters => @filters}.action_handlers
|
33
36
|
app_1 = :xml
|
34
37
|
# Trace configuration
|
35
|
-
configuration = Tracing::Configuration.new
|
38
|
+
configuration = Tracing::Configuration.new :appenders => app_1, :filters => @ah_filters, :final_yield_action => :exclude
|
36
39
|
|
37
40
|
# configure
|
38
|
-
|
41
|
+
Tracing::TraceExt.configure(configuration)
|
39
42
|
|
40
43
|
end
|
41
44
|
|
@@ -49,8 +52,8 @@ class TestTraceCallsConfigure < Test::Unit::TestCase
|
|
49
52
|
|
50
53
|
def test_register_multiple_action_handler_from_hash
|
51
54
|
# Action handlers
|
52
|
-
ah1 = {:filters =>
|
53
|
-
ah2 = {:filters =>
|
55
|
+
ah1 = {:filters => @ah_filters, :appenders => @appenders}
|
56
|
+
ah2 = {:filters => @ah_filters, :appenders => @appenders}
|
54
57
|
|
55
58
|
action_handlers = [ah1, ah2]
|
56
59
|
|
@@ -60,10 +63,10 @@ class TestTraceCallsConfigure < Test::Unit::TestCase
|
|
60
63
|
filters = [im_filter_1, xym_class_1]
|
61
64
|
|
62
65
|
# Trace configuration
|
63
|
-
configuration = Tracing::Configuration.new
|
66
|
+
configuration = Tracing::Configuration.new :action_handlers => action_handlers, :filters => @ah_filters, :final_yield_action => :exclude
|
64
67
|
|
65
68
|
# configure
|
66
|
-
|
69
|
+
Tracing::TraceExt.configure(configuration)
|
67
70
|
end
|
68
71
|
|
69
72
|
end
|
@@ -1,12 +1,11 @@
|
|
1
|
-
require "
|
2
|
-
require "samples/include"
|
1
|
+
require "../include"
|
3
2
|
|
4
3
|
class TestHtmlTracing < Test::Unit::TestCase
|
5
4
|
|
6
5
|
def test_html_tracing
|
7
6
|
classes_to_trace = [ 'My']
|
8
7
|
Tracing::HtmlAppender.default_path = 'log_files/html'
|
9
|
-
Tracing::
|
8
|
+
Tracing::TraceExt.configure(:type => :html, :to_file => 'traced_dryml.html', :filters => Method_filter_hello)
|
10
9
|
my = Me::My.new
|
11
10
|
my.hello
|
12
11
|
my.hi_there
|
@@ -1,12 +1,13 @@
|
|
1
|
-
require "
|
2
|
-
require "samples/include"
|
1
|
+
require "../include"
|
3
2
|
|
4
3
|
class TestLoggerTracing < Test::Unit::TestCase
|
5
4
|
|
6
5
|
def test_logger_tracing
|
7
6
|
classes_to_trace = [ 'My']
|
8
|
-
|
9
|
-
Tracing::
|
7
|
+
# Should be for LogFileAppender
|
8
|
+
# Tracing::LoggerAppender.default_path = 'log_files'
|
9
|
+
|
10
|
+
Tracing::TraceExt.configure(:type => :log, :filters => Method_filter_hello)
|
10
11
|
my = Me::My.new
|
11
12
|
my.hello
|
12
13
|
my.hi_there
|
@@ -1,11 +1,10 @@
|
|
1
|
-
require "
|
2
|
-
require "samples/include"
|
1
|
+
require "../include"
|
3
2
|
|
4
3
|
class TestStreamTracing < Test::Unit::TestCase
|
5
4
|
|
6
5
|
def test_stream_tracing
|
7
6
|
classes_to_trace = [ 'My']
|
8
|
-
Tracing::
|
7
|
+
Tracing::TraceExt.configure(:type => :stream, :filters => Method_filter_hello)
|
9
8
|
my = Me::My.new
|
10
9
|
my.hello
|
11
10
|
my.hi_there
|
@@ -1,12 +1,11 @@
|
|
1
|
-
require "
|
2
|
-
require "samples/include"
|
1
|
+
require "../include"
|
3
2
|
|
4
3
|
class TestDrymlTemplateLogTracing < Test::Unit::TestCase
|
5
4
|
|
6
5
|
def test_dryml_template_tracing
|
7
6
|
classes_to_trace = [ 'My']
|
8
7
|
Tracing::TemplateLogAppender.default_path = 'log_files/templates'
|
9
|
-
Tracing::
|
8
|
+
Tracing::TraceExt.configure(:type => :template_log, :filters => Method_filter_dryml)
|
10
9
|
my = Me::My.new
|
11
10
|
my.hello
|
12
11
|
my.hi_there
|
@@ -1,12 +1,11 @@
|
|
1
|
-
require "
|
2
|
-
require "samples/include"
|
1
|
+
require "../include"
|
3
2
|
|
4
3
|
class TestXmlTracing < Test::Unit::TestCase
|
5
4
|
|
6
5
|
def test_xml_tracing
|
7
6
|
classes_to_trace = [ 'My']
|
8
7
|
Tracing::XmlAppender.default_path = 'log_files/xml'
|
9
|
-
Tracing::
|
8
|
+
Tracing::TraceExt.configure(:type => :xml, :to_file => 'traced_dryml.html', :filters => Method_filter_hello)
|
10
9
|
my = Me::My.new
|
11
10
|
my.hello
|
12
11
|
my.hi_there
|
data/trace-util-adv.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{trace-util-adv}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2009-11-
|
12
|
+
s.date = %q{2009-11-21}
|
13
13
|
s.description = %q{
|
14
14
|
Configure tracing using context sensitive filters, appenders, output templates in a completely non-intrusive fashion.
|
15
15
|
Tracing can even be applied runtime as a response when certain conditions occur}
|
@@ -63,6 +63,7 @@ Gem::Specification.new do |s|
|
|
63
63
|
"lib/filters/list/README-NOTE.txt",
|
64
64
|
"lib/filters/list/list_instance_var_filter.rb",
|
65
65
|
"lib/filters/msg_context/message_context_filters.rb",
|
66
|
+
"lib/filters/name_filter.rb",
|
66
67
|
"lib/filters/simple/argument_filter.rb",
|
67
68
|
"lib/filters/simple/class_filter.rb",
|
68
69
|
"lib/filters/simple/instance_var_filter.rb",
|
@@ -102,15 +103,18 @@ Gem::Specification.new do |s|
|
|
102
103
|
s.test_files = [
|
103
104
|
"spec/spec_helper.rb",
|
104
105
|
"spec/trace-util-adv_spec.rb",
|
106
|
+
"test/action_handler/include.rb",
|
105
107
|
"test/action_handler/test_action_handler.rb",
|
106
108
|
"test/action_handler/test_create_action_handler.rb",
|
109
|
+
"test/appenders/include.rb",
|
107
110
|
"test/appenders/test_appender_filters.rb",
|
108
|
-
"test/appenders/
|
111
|
+
"test/appenders/test_appender_templates.rb",
|
109
112
|
"test/appenders/test_create_appender.rb",
|
110
113
|
"test/appenders/test_html_appender.rb",
|
111
114
|
"test/appenders/test_stream_appender.rb",
|
112
115
|
"test/appenders/test_template_log_appender.rb",
|
113
116
|
"test/appenders/test_xml_appender.rb",
|
117
|
+
"test/extensions/include.rb",
|
114
118
|
"test/extensions/test_filters_creation.rb",
|
115
119
|
"test/extensions/test_hash_extensions.rb",
|
116
120
|
"test/extensions/test_hash_filter_extensions.rb",
|
@@ -122,6 +126,7 @@ Gem::Specification.new do |s|
|
|
122
126
|
"test/filters/composite/test_composite_module_filter.rb",
|
123
127
|
"test/filters/composite/test_composite_var_filter.rb",
|
124
128
|
"test/filters/executor/test_filter_exec.rb",
|
129
|
+
"test/filters/include.rb",
|
125
130
|
"test/filters/msg_context/test_custom_filters.rb",
|
126
131
|
"test/filters/simple/test_base_filter.rb",
|
127
132
|
"test/filters/simple/test_class_filter.rb",
|
@@ -135,14 +140,17 @@ Gem::Specification.new do |s|
|
|
135
140
|
"test/sandbox/matcher.rb",
|
136
141
|
"test/sandbox/sandbox.rb",
|
137
142
|
"test/sandbox/test_xml_gen.rb",
|
143
|
+
"test/targets/test_create_targets.rb",
|
144
|
+
"test/templates/include.rb",
|
145
|
+
"test/templates/test_create_templates.rb",
|
146
|
+
"test/templates/test_exec_templates.rb",
|
147
|
+
"test/trace_calls/include.rb",
|
138
148
|
"test/trace_calls/test_configure_.rb",
|
139
149
|
"test/trace_calls/tracing/test_html_tracing.rb",
|
140
150
|
"test/trace_calls/tracing/test_logger_tracing.rb",
|
141
151
|
"test/trace_calls/tracing/test_stream_tracing.rb",
|
142
152
|
"test/trace_calls/tracing/test_teamplate_log_tracing.rb",
|
143
|
-
"test/trace_calls/tracing/test_xml_tracing.rb"
|
144
|
-
"test/tracers/test_create_tracers.rb",
|
145
|
-
"test/tracers/test_exec_tracers.rb"
|
153
|
+
"test/trace_calls/tracing/test_xml_tracing.rb"
|
146
154
|
]
|
147
155
|
|
148
156
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace-util-adv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristian Mandrup
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-21 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- lib/filters/list/README-NOTE.txt
|
80
80
|
- lib/filters/list/list_instance_var_filter.rb
|
81
81
|
- lib/filters/msg_context/message_context_filters.rb
|
82
|
+
- lib/filters/name_filter.rb
|
82
83
|
- lib/filters/simple/argument_filter.rb
|
83
84
|
- lib/filters/simple/class_filter.rb
|
84
85
|
- lib/filters/simple/instance_var_filter.rb
|
@@ -140,15 +141,18 @@ summary: adds advancing tracing capability to your ruby code
|
|
140
141
|
test_files:
|
141
142
|
- spec/spec_helper.rb
|
142
143
|
- spec/trace-util-adv_spec.rb
|
144
|
+
- test/action_handler/include.rb
|
143
145
|
- test/action_handler/test_action_handler.rb
|
144
146
|
- test/action_handler/test_create_action_handler.rb
|
147
|
+
- test/appenders/include.rb
|
145
148
|
- test/appenders/test_appender_filters.rb
|
146
|
-
- test/appenders/
|
149
|
+
- test/appenders/test_appender_templates.rb
|
147
150
|
- test/appenders/test_create_appender.rb
|
148
151
|
- test/appenders/test_html_appender.rb
|
149
152
|
- test/appenders/test_stream_appender.rb
|
150
153
|
- test/appenders/test_template_log_appender.rb
|
151
154
|
- test/appenders/test_xml_appender.rb
|
155
|
+
- test/extensions/include.rb
|
152
156
|
- test/extensions/test_filters_creation.rb
|
153
157
|
- test/extensions/test_hash_extensions.rb
|
154
158
|
- test/extensions/test_hash_filter_extensions.rb
|
@@ -160,6 +164,7 @@ test_files:
|
|
160
164
|
- test/filters/composite/test_composite_module_filter.rb
|
161
165
|
- test/filters/composite/test_composite_var_filter.rb
|
162
166
|
- test/filters/executor/test_filter_exec.rb
|
167
|
+
- test/filters/include.rb
|
163
168
|
- test/filters/msg_context/test_custom_filters.rb
|
164
169
|
- test/filters/simple/test_base_filter.rb
|
165
170
|
- test/filters/simple/test_class_filter.rb
|
@@ -173,11 +178,14 @@ test_files:
|
|
173
178
|
- test/sandbox/matcher.rb
|
174
179
|
- test/sandbox/sandbox.rb
|
175
180
|
- test/sandbox/test_xml_gen.rb
|
181
|
+
- test/targets/test_create_targets.rb
|
182
|
+
- test/templates/include.rb
|
183
|
+
- test/templates/test_create_templates.rb
|
184
|
+
- test/templates/test_exec_templates.rb
|
185
|
+
- test/trace_calls/include.rb
|
176
186
|
- test/trace_calls/test_configure_.rb
|
177
187
|
- test/trace_calls/tracing/test_html_tracing.rb
|
178
188
|
- test/trace_calls/tracing/test_logger_tracing.rb
|
179
189
|
- test/trace_calls/tracing/test_stream_tracing.rb
|
180
190
|
- test/trace_calls/tracing/test_teamplate_log_tracing.rb
|
181
191
|
- test/trace_calls/tracing/test_xml_tracing.rb
|
182
|
-
- test/tracers/test_create_tracers.rb
|
183
|
-
- test/tracers/test_exec_tracers.rb
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'extensions/core_extensions'
|
2
|
-
require 'filters/base_filters'
|
3
|
-
require 'rules/hash_rule_extensions'
|
4
|
-
require "test/unit"
|
5
|
-
|
6
|
-
|
7
|
-
class TestAppenderTracers < Test::Unit::TestCase
|
8
|
-
|
9
|
-
def setup
|
10
|
-
# Trace filters
|
11
|
-
im_filter_1 = {:i_method_filter => "a,b"}
|
12
|
-
xym_class_1 = {:xy_class_filter => "C,D"}
|
13
|
-
@filters = [im_filter_1, xym_class_1]
|
14
|
-
|
15
|
-
@app_filter_1 = {:x_class_filter => "Dryml"}
|
16
|
-
@app_filter_2 = {:i_class_filter => "Template"}
|
17
|
-
|
18
|
-
@xml_tracer = {:type => :xml, :to_file => 'log_files/xml/traced.xml'}.tracer
|
19
|
-
@html_tracer = {:type => :html, :default_path => 'log_files/html/'}.tracer
|
20
|
-
@log_tracer = {:type => :log}.tracer
|
21
|
-
@stream_tracer = {:type => :stream}.tracer
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
|
-
def test_appender_register_tracer
|
26
|
-
# Trace configuration
|
27
|
-
appender_1 = {:tracer => @xml_tracer}.appender
|
28
|
-
assert_equal Tracing::XmlAppender, appender_1.class, "Should create instance of XmlAppender"
|
29
|
-
|
30
|
-
appender_2 = {:tracer => @html_tracer}.appender
|
31
|
-
assert_equal Tracing::HtmlAppender, appender_2.class, "Should create instance of HtmlAppender"
|
32
|
-
|
33
|
-
appender_3 = {:tracer => @log_tracer}.appender
|
34
|
-
assert_equal Tracing::HtmlAppender, appender_3.class, "Should create instance of LogAppender"
|
35
|
-
|
36
|
-
appender_4 = {:tracer => @stream_tracer}.appender
|
37
|
-
assert_equal Tracing::StreamAppender, appender_4.class, "Should create instance of Streamppender"
|
38
|
-
end
|
39
|
-
|
40
|
-
|
41
|
-
def test_appender_register_tracer_and_filters
|
42
|
-
# Trace configuration
|
43
|
-
appender_1 = {:tracer => @xml_tracer, :filters => @app_filter_1}.appender
|
44
|
-
assert_equal Tracing::XmlAppender, appender_1.class, "Should create instance of XmlAppender"
|
45
|
-
|
46
|
-
appender_2 = {:tracer => @html_tracer, :filters => @app_filter_1}.appender
|
47
|
-
assert_equal Tracing::HtmlAppender, appender_2.class, "Should create instance of HtmlAppender"
|
48
|
-
|
49
|
-
appender_3 = {:tracer => @log_tracer, :filters => @app_filter_1}.appender
|
50
|
-
assert_equal Tracing::HtmlAppender, appender_3.class, "Should create instance of LogAppender"
|
51
|
-
|
52
|
-
appender_4 = {:tracer => @stream_tracer, :filters => @app_filter_1}.appender
|
53
|
-
assert_equal Tracing::StreamAppender, appender_4.class, "Should create instance of Streamppender"
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|