jasperserver-rails 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/jasperserver-rails/jasperserver-dsl.rb +25 -11
- data/lib/jasperserver-rails/version.rb +1 -1
- data/test/dummy/config/initializers/jasperserver.rb +7 -1
- data/test/dummy/log/development.log +138 -0
- data/test/dummy/log/test.log +213 -2
- data/test/jasperserver-rails_test.rb +43 -31
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a27409a5e6a91607cc06bf3336ac971cefa828f8
|
4
|
+
data.tar.gz: c93a4b4ba67c65675a05c2acda3d8b1b93bd7f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c490ff5b313c350ad6ad971c66406442b51ee2245f194c2e3dcb642df9fe57f4b385175021ec0557300c6555d2139d151b70fd26c089bd47dc7c6215f659c5a
|
7
|
+
data.tar.gz: 4e38c6a358f65ca65b0ee05c5a9a5bc0165195e008b45ff49b54111ee9c57bc9930908f38ae0a7972d9745824de93c314b4d8f2f09ad4d6fa8bf160500459e65
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
# JasperserverRails
|
1
|
+
# JasperserverRails
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/jasperserver-rails.png)](http://badge.fury.io/rb/jasperserver-rails)
|
3
|
+
[![Build Status](https://travis-ci.org/cmckni3/rails-jasperserver.svg?branch=master)](https://travis-ci.org/cmckni3/rails-jasperserver)
|
4
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/cmckni3/jasperserver-rails)
|
2
5
|
|
3
6
|
Download reports in various formats from jasperserver
|
4
7
|
|
@@ -3,8 +3,7 @@ require 'uri'
|
|
3
3
|
require 'rest-client'
|
4
4
|
module JasperserverRails
|
5
5
|
class Jasperserver
|
6
|
-
|
7
|
-
self.class_eval do
|
6
|
+
class_eval do
|
8
7
|
[:report, :format, :params].each do |method|
|
9
8
|
define_method method do |arg|
|
10
9
|
arg = arg.collect { |key, value| [key, value] } if method == :params
|
@@ -26,31 +25,46 @@ module JasperserverRails
|
|
26
25
|
instance_eval(&block) if block_given?
|
27
26
|
login
|
28
27
|
# Run report
|
29
|
-
|
30
|
-
|
28
|
+
report_path = [
|
29
|
+
'rest_v2',
|
30
|
+
'reports',
|
31
|
+
"#{self.get_report}.#{self.get_format}?#{URI.encode_www_form(self.get_params)}"
|
32
|
+
].join '/'
|
33
|
+
report_data = RestClient.get(
|
34
|
+
URI.join(
|
35
|
+
config[:url],
|
36
|
+
report_path
|
37
|
+
).to_s,
|
31
38
|
{ cookies: @cookie }
|
32
39
|
)
|
33
40
|
|
34
41
|
# Write file
|
35
42
|
FileUtils.mkdir_p(File.expand_path(filename).split('/')[0..-2].join('/'))
|
36
43
|
f = File.new(filename, 'wb')
|
37
|
-
f.write(
|
44
|
+
f.write(report_data.body)
|
38
45
|
f.close
|
39
46
|
end
|
40
47
|
|
41
48
|
private
|
42
49
|
|
50
|
+
def config
|
51
|
+
Rails.configuration.jasperserver[Rails.env.to_sym]
|
52
|
+
end
|
53
|
+
|
43
54
|
def login
|
44
55
|
# login
|
45
56
|
unless @cookie
|
46
|
-
|
47
|
-
|
57
|
+
@cookie = RestClient.post(
|
58
|
+
[
|
59
|
+
config[:url],
|
60
|
+
'rest',
|
61
|
+
'login'
|
62
|
+
].join('/').to_s,
|
48
63
|
{
|
49
|
-
j_username:
|
50
|
-
j_password:
|
64
|
+
j_username: config[:username],
|
65
|
+
j_password: config[:password]
|
51
66
|
}
|
52
|
-
)
|
53
|
-
@cookie = response.cookies
|
67
|
+
).cookies
|
54
68
|
end
|
55
69
|
end
|
56
70
|
end
|
@@ -1,3 +1,9 @@
|
|
1
1
|
Rails.configuration.after_initialize do
|
2
|
-
Rails.configuration.jasperserver = {
|
2
|
+
Rails.configuration.jasperserver = {
|
3
|
+
test: {
|
4
|
+
url: 'http://localhost:3000',
|
5
|
+
username: 'username',
|
6
|
+
password: 'password'
|
7
|
+
}
|
8
|
+
}
|
3
9
|
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
DEPRECATION WARNING: config.active_record.whitelist_attributes is deprecated and have no effect. Remove its call from the configuration. (called from block in tsort_each at /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:226)
|
2
|
+
DEPRECATION WARNING: You didn't set `secret_key_base`. Read the upgrade documentation to learn more about this new config option. (called from require at script/rails:6)
|
3
|
+
|
4
|
+
|
5
|
+
Started POST "/login" for 127.0.0.1 at 2015-10-02 12:59:39 -0500
|
6
|
+
|
7
|
+
NoMethodError (undefined method `auto_explain_threshold_in_seconds=' for #<Class:0x007fb2aab5f158>):
|
8
|
+
activerecord (4.2.4) lib/active_record/dynamic_matchers.rb:26:in `method_missing'
|
9
|
+
activerecord (4.2.4) lib/active_record/railtie.rb:108:in `block (3 levels) in <class:Railtie>'
|
10
|
+
activerecord (4.2.4) lib/active_record/railtie.rb:107:in `each'
|
11
|
+
activerecord (4.2.4) lib/active_record/railtie.rb:107:in `block (2 levels) in <class:Railtie>'
|
12
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
|
13
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
|
14
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
|
15
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `each'
|
16
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
|
17
|
+
activerecord (4.2.4) lib/active_record/base.rb:315:in `<module:ActiveRecord>'
|
18
|
+
activerecord (4.2.4) lib/active_record/base.rb:26:in `<top (required)>'
|
19
|
+
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:660:in `rescue in call'
|
20
|
+
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:651:in `call'
|
21
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
|
22
|
+
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
|
23
|
+
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
|
24
|
+
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
|
25
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
|
26
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
|
27
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
|
28
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
|
29
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
|
30
|
+
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
|
31
|
+
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
|
32
|
+
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
|
33
|
+
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
|
34
|
+
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
|
35
|
+
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
|
36
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
|
37
|
+
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
|
38
|
+
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
|
39
|
+
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
|
40
|
+
rack (1.6.4) lib/rack/lock.rb:17:in `call'
|
41
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
|
42
|
+
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
|
43
|
+
railties (4.2.4) lib/rails/engine.rb:518:in `call'
|
44
|
+
railties (4.2.4) lib/rails/application.rb:165:in `call'
|
45
|
+
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
|
46
|
+
thin (1.6.4) lib/thin/connection.rb:86:in `block in pre_process'
|
47
|
+
thin (1.6.4) lib/thin/connection.rb:84:in `catch'
|
48
|
+
thin (1.6.4) lib/thin/connection.rb:84:in `pre_process'
|
49
|
+
thin (1.6.4) lib/thin/connection.rb:53:in `process'
|
50
|
+
thin (1.6.4) lib/thin/connection.rb:39:in `receive_data'
|
51
|
+
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run_machine'
|
52
|
+
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run'
|
53
|
+
thin (1.6.4) lib/thin/backends/base.rb:73:in `start'
|
54
|
+
thin (1.6.4) lib/thin/server.rb:162:in `start'
|
55
|
+
rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
|
56
|
+
rack (1.6.4) lib/rack/server.rb:286:in `start'
|
57
|
+
railties (4.2.4) lib/rails/commands/server.rb:80:in `start'
|
58
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:80:in `block in server'
|
59
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `tap'
|
60
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `server'
|
61
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
|
62
|
+
railties (4.2.4) lib/rails/commands.rb:17:in `<top (required)>'
|
63
|
+
script/rails:6:in `require'
|
64
|
+
script/rails:6:in `<main>'
|
65
|
+
|
66
|
+
|
67
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.1ms)
|
68
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.1ms)
|
69
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
|
70
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (56.9ms)
|
71
|
+
|
72
|
+
|
73
|
+
Started POST "/login" for 127.0.0.1 at 2015-10-02 12:59:39 -0500
|
74
|
+
|
75
|
+
NoMethodError (undefined method `auto_explain_threshold_in_seconds=' for #<Class:0x007fb2aab5f158>):
|
76
|
+
activerecord (4.2.4) lib/active_record/dynamic_matchers.rb:26:in `method_missing'
|
77
|
+
activerecord (4.2.4) lib/active_record/railtie.rb:108:in `block (3 levels) in <class:Railtie>'
|
78
|
+
activerecord (4.2.4) lib/active_record/railtie.rb:107:in `each'
|
79
|
+
activerecord (4.2.4) lib/active_record/railtie.rb:107:in `block (2 levels) in <class:Railtie>'
|
80
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
|
81
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
|
82
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
|
83
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `each'
|
84
|
+
activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
|
85
|
+
activerecord (4.2.4) lib/active_record/base.rb:315:in `<module:ActiveRecord>'
|
86
|
+
activerecord (4.2.4) lib/active_record/base.rb:26:in `<top (required)>'
|
87
|
+
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:660:in `rescue in call'
|
88
|
+
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:651:in `call'
|
89
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
|
90
|
+
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
|
91
|
+
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
|
92
|
+
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
|
93
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
|
94
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
|
95
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
|
96
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
|
97
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
|
98
|
+
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
|
99
|
+
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
|
100
|
+
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
|
101
|
+
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
|
102
|
+
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
|
103
|
+
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
|
104
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
|
105
|
+
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
|
106
|
+
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
|
107
|
+
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
|
108
|
+
rack (1.6.4) lib/rack/lock.rb:17:in `call'
|
109
|
+
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
|
110
|
+
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
|
111
|
+
railties (4.2.4) lib/rails/engine.rb:518:in `call'
|
112
|
+
railties (4.2.4) lib/rails/application.rb:165:in `call'
|
113
|
+
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
|
114
|
+
thin (1.6.4) lib/thin/connection.rb:86:in `block in pre_process'
|
115
|
+
thin (1.6.4) lib/thin/connection.rb:84:in `catch'
|
116
|
+
thin (1.6.4) lib/thin/connection.rb:84:in `pre_process'
|
117
|
+
thin (1.6.4) lib/thin/connection.rb:53:in `process'
|
118
|
+
thin (1.6.4) lib/thin/connection.rb:39:in `receive_data'
|
119
|
+
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run_machine'
|
120
|
+
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run'
|
121
|
+
thin (1.6.4) lib/thin/backends/base.rb:73:in `start'
|
122
|
+
thin (1.6.4) lib/thin/server.rb:162:in `start'
|
123
|
+
rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
|
124
|
+
rack (1.6.4) lib/rack/server.rb:286:in `start'
|
125
|
+
railties (4.2.4) lib/rails/commands/server.rb:80:in `start'
|
126
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:80:in `block in server'
|
127
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `tap'
|
128
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `server'
|
129
|
+
railties (4.2.4) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
|
130
|
+
railties (4.2.4) lib/rails/commands.rb:17:in `<top (required)>'
|
131
|
+
script/rails:6:in `require'
|
132
|
+
script/rails:6:in `<main>'
|
133
|
+
|
134
|
+
|
135
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.1ms)
|
136
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.3ms)
|
137
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
|
138
|
+
Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (54.9ms)
|
data/test/dummy/log/test.log
CHANGED
@@ -1,18 +1,229 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2
|
+
-------------------------------------------------------------------------
|
3
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
4
|
+
-------------------------------------------------------------------------
|
5
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
6
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
7
|
+
-------------------------------------------------
|
8
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
9
|
+
-------------------------------------------------
|
10
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
+
--------------------------------------------------
|
13
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
14
|
+
--------------------------------------------------
|
15
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
17
|
+
--------------------------------------------------
|
18
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
19
|
+
--------------------------------------------------
|
20
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
21
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22
|
+
-------------------------------------------------------------------------
|
23
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
24
|
+
-------------------------------------------------------------------------
|
25
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
26
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
27
|
+
-------------------------------------------------
|
28
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
29
|
+
-------------------------------------------------
|
30
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
31
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
32
|
+
--------------------------------------------------
|
33
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
34
|
+
--------------------------------------------------
|
35
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
36
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
37
|
+
--------------------------------------------------
|
38
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
39
|
+
--------------------------------------------------
|
40
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
41
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
42
|
+
-------------------------------------------------------------------------
|
43
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
44
|
+
-------------------------------------------------------------------------
|
45
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
46
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
47
|
+
-------------------------------------------------
|
48
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
49
|
+
-------------------------------------------------
|
50
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
51
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
52
|
+
--------------------------------------------------
|
53
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
54
|
+
--------------------------------------------------
|
55
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
56
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
57
|
+
--------------------------------------------------
|
58
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
59
|
+
--------------------------------------------------
|
60
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
61
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
62
|
+
-------------------------------------------------------------------------
|
63
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
64
|
+
-------------------------------------------------------------------------
|
65
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
66
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
67
|
+
-------------------------------------------------
|
68
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
69
|
+
-------------------------------------------------
|
70
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
71
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
72
|
+
--------------------------------------------------
|
73
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
74
|
+
--------------------------------------------------
|
75
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
76
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
77
|
+
--------------------------------------------------
|
78
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
79
|
+
--------------------------------------------------
|
80
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
81
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
82
|
+
-------------------------------------------------------------------------
|
83
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
84
|
+
-------------------------------------------------------------------------
|
85
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
86
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
87
|
+
-------------------------------------------------
|
88
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
89
|
+
-------------------------------------------------
|
90
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
91
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
92
|
+
--------------------------------------------------
|
93
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
94
|
+
--------------------------------------------------
|
95
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
96
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
97
|
+
--------------------------------------------------
|
98
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
99
|
+
--------------------------------------------------
|
100
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
101
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
102
|
+
-------------------------------------------------------------------------
|
103
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
104
|
+
-------------------------------------------------------------------------
|
105
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
106
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
107
|
+
-------------------------------------------------
|
108
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
109
|
+
-------------------------------------------------
|
3
110
|
[1m[35m (0.1ms)[0m rollback transaction
|
4
111
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
112
|
+
--------------------------------------------------
|
113
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
114
|
+
--------------------------------------------------
|
115
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
116
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
117
|
+
--------------------------------------------------
|
118
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
119
|
+
--------------------------------------------------
|
5
120
|
[1m[35m (0.1ms)[0m rollback transaction
|
121
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
122
|
+
-------------------------------------------------------------------------
|
123
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
124
|
+
-------------------------------------------------------------------------
|
125
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
126
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
127
|
+
-------------------------------------------------
|
128
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
129
|
+
-------------------------------------------------
|
130
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
6
131
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
132
|
+
--------------------------------------------------
|
133
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
134
|
+
--------------------------------------------------
|
135
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
136
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
137
|
+
--------------------------------------------------
|
138
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
139
|
+
--------------------------------------------------
|
140
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
141
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
142
|
+
-------------------------------------------------------------------------
|
143
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
144
|
+
-------------------------------------------------------------------------
|
145
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
146
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
147
|
+
-------------------------------------------------
|
148
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
149
|
+
-------------------------------------------------
|
150
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
151
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
152
|
+
--------------------------------------------------
|
153
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
154
|
+
--------------------------------------------------
|
155
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
156
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
157
|
+
--------------------------------------------------
|
158
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
159
|
+
--------------------------------------------------
|
7
160
|
[1m[35m (0.1ms)[0m rollback transaction
|
8
161
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
162
|
+
-------------------------------------------------------------------------
|
163
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
164
|
+
-------------------------------------------------------------------------
|
165
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
166
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
167
|
+
-------------------------------------------------
|
168
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
169
|
+
-------------------------------------------------
|
170
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
171
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
172
|
+
--------------------------------------------------
|
173
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
174
|
+
--------------------------------------------------
|
9
175
|
[1m[35m (0.0ms)[0m rollback transaction
|
176
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
177
|
+
--------------------------------------------------
|
178
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
179
|
+
--------------------------------------------------
|
180
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
10
181
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
11
182
|
-------------------------------------------------------------------------
|
12
183
|
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
13
184
|
-------------------------------------------------------------------------
|
185
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
186
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
187
|
+
-------------------------------------------------
|
188
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
189
|
+
-------------------------------------------------
|
190
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
191
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
192
|
+
--------------------------------------------------
|
193
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
194
|
+
--------------------------------------------------
|
14
195
|
[1m[35m (0.1ms)[0m rollback transaction
|
15
196
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
197
|
+
--------------------------------------------------
|
198
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
199
|
+
--------------------------------------------------
|
200
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
201
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
202
|
+
-------------------------------------------------------------------------
|
203
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
204
|
+
-------------------------------------------------------------------------
|
205
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
206
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
207
|
+
-------------------------------------------------
|
208
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
209
|
+
-------------------------------------------------
|
210
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
211
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
212
|
+
--------------------------------------------------
|
213
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
214
|
+
--------------------------------------------------
|
215
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
216
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
217
|
+
--------------------------------------------------
|
218
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
219
|
+
--------------------------------------------------
|
220
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
221
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
222
|
+
-------------------------------------------------------------------------
|
223
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
224
|
+
-------------------------------------------------------------------------
|
225
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
226
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
16
227
|
-------------------------------------------------
|
17
228
|
JasperserverRailsTest: test_test.pdf_is_generated
|
18
229
|
-------------------------------------------------
|
@@ -3,76 +3,88 @@ require 'test_helper'
|
|
3
3
|
require 'vcr'
|
4
4
|
|
5
5
|
VCR.configure do |c|
|
6
|
+
jasper_config = Rails.configuration.jasperserver[Rails.env.to_sym]
|
6
7
|
c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
|
7
8
|
c.hook_into :webmock
|
8
|
-
c.default_cassette_options = { record: :
|
9
|
-
c.filter_sensitive_data('<USERNAME>') {
|
10
|
-
c.filter_sensitive_data('<PASSWORD>') {
|
11
|
-
c.filter_sensitive_data('<URL>') {
|
9
|
+
c.default_cassette_options = { record: :none, erb: true }
|
10
|
+
c.filter_sensitive_data('<USERNAME>') { jasper_config[:username] }
|
11
|
+
c.filter_sensitive_data('<PASSWORD>') { jasper_config[:password] }
|
12
|
+
c.filter_sensitive_data('<URL>') { jasper_config[:url] }
|
12
13
|
c.filter_sensitive_data('<SET-COOKIE>') do |interaction|
|
13
|
-
|
14
|
+
if interaction.response.headers['Set-Cookie']
|
15
|
+
interaction.response.headers['Set-Cookie'].first
|
16
|
+
end
|
14
17
|
end
|
15
18
|
c.filter_sensitive_data('<COOKIE>') do |interaction|
|
16
|
-
|
19
|
+
if interaction.request.headers['Cookie']
|
20
|
+
interaction.request.headers['Cookie'].first
|
21
|
+
end
|
17
22
|
end
|
18
23
|
c.filter_sensitive_data('<SERVER>') do |interaction|
|
19
|
-
|
24
|
+
if interaction.response.headers['Server']
|
25
|
+
interaction.response.headers['Server'].first
|
26
|
+
end
|
20
27
|
end
|
21
28
|
end
|
22
29
|
|
23
30
|
class JasperserverRailsTest < ActiveSupport::TestCase
|
24
|
-
test
|
25
|
-
|
31
|
+
test 'test.pdf is generated' do
|
32
|
+
report_file = 'test/dummy/tmp/reports/test.pdf'
|
33
|
+
VCR.use_cassette 'test1' do
|
26
34
|
JasperserverRails::Jasperserver.new do
|
27
35
|
format 'pdf'
|
28
|
-
report 'samples/Department'
|
36
|
+
report 'reports/samples/Department'
|
29
37
|
params({ Value1: 'Value1', Value2: 'Value2' })
|
30
|
-
run_report
|
38
|
+
run_report report_file
|
31
39
|
end
|
32
40
|
end
|
33
|
-
File.
|
41
|
+
File.exist? report_file
|
34
42
|
end
|
35
43
|
|
36
|
-
test
|
37
|
-
|
44
|
+
test 'test2.pdf is generated' do
|
45
|
+
report_file = 'test/dummy/tmp/reports/test2.pdf'
|
46
|
+
VCR.use_cassette 'test2' do
|
38
47
|
JasperserverRails::Jasperserver.new do
|
39
48
|
format 'pdf'
|
40
|
-
report 'samples/Department'
|
49
|
+
report 'reports/samples/Department'
|
41
50
|
params({ Value1: 'Value1' })
|
42
|
-
run_report
|
51
|
+
run_report report_file
|
43
52
|
end
|
44
53
|
end
|
45
|
-
File.
|
54
|
+
File.exist? report_file
|
46
55
|
end
|
47
56
|
|
48
|
-
test
|
49
|
-
|
50
|
-
|
57
|
+
test 'test3.pdf is generated' do
|
58
|
+
report_file = 'test/dummy/tmp/reports/test3.pdf'
|
59
|
+
VCR.use_cassette 'test3' do
|
60
|
+
JasperserverRails::Jasperserver.new.run_report report_file do
|
51
61
|
format 'pdf'
|
52
|
-
report 'samples/Department'
|
62
|
+
report 'reports/samples/Department'
|
53
63
|
params({ Value1: 'Value1' })
|
54
64
|
end
|
55
65
|
end
|
56
|
-
File.
|
66
|
+
File.exist? report_file
|
57
67
|
end
|
58
68
|
|
59
|
-
test
|
60
|
-
|
61
|
-
|
69
|
+
test 'stays logged in when running multiple reports' do
|
70
|
+
report_file = 'test/dummy/tmp/reports/test4.pdf'
|
71
|
+
VCR.use_cassette 'test4' do
|
72
|
+
JasperserverRails::Jasperserver.new.run_report report_file do
|
62
73
|
format 'pdf'
|
63
|
-
report 'samples/Department'
|
74
|
+
report 'reports/samples/Department'
|
64
75
|
params({ Value1: 'Value1' })
|
65
76
|
end
|
66
77
|
end
|
67
|
-
File.
|
78
|
+
File.exist? report_file
|
68
79
|
|
69
|
-
|
70
|
-
|
80
|
+
report_file = 'test/dummy/tmp/reports/test5.pdf'
|
81
|
+
VCR.use_cassette 'test5' do
|
82
|
+
JasperserverRails::Jasperserver.new.run_report report_file do
|
71
83
|
format 'pdf'
|
72
|
-
report 'samples/Department'
|
84
|
+
report 'reports/samples/Department'
|
73
85
|
params({ Value1: 'Value1' })
|
74
86
|
end
|
75
87
|
end
|
76
|
-
File.
|
88
|
+
File.exist? report_file
|
77
89
|
end
|
78
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasperserver-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris McKnight
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- test/dummy/config/locales/en.yml
|
84
84
|
- test/dummy/config/routes.rb
|
85
85
|
- test/dummy/db/test.sqlite3
|
86
|
+
- test/dummy/log/development.log
|
86
87
|
- test/dummy/log/test.log
|
87
88
|
- test/dummy/public/404.html
|
88
89
|
- test/dummy/public/422.html
|
@@ -120,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
121
|
version: '0'
|
121
122
|
requirements: []
|
122
123
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.4.5
|
124
|
+
rubygems_version: 2.4.5.1
|
124
125
|
signing_key:
|
125
126
|
specification_version: 4
|
126
127
|
summary: Download reports in various formats from jasperserver
|
@@ -148,6 +149,7 @@ test_files:
|
|
148
149
|
- test/dummy/config/routes.rb
|
149
150
|
- test/dummy/config.ru
|
150
151
|
- test/dummy/db/test.sqlite3
|
152
|
+
- test/dummy/log/development.log
|
151
153
|
- test/dummy/log/test.log
|
152
154
|
- test/dummy/public/404.html
|
153
155
|
- test/dummy/public/422.html
|