|
87 | 87 |
|
88 | 88 | let(:servlet_context) { new_servlet_context(base_path) } |
89 | 89 |
|
90 | | - it "initializes (pooling by default)" do |
| 90 | + it "initializes pooling when min/max set" do |
| 91 | + servlet_context.addInitParameter('jruby.min.runtimes', '1') |
| 92 | + servlet_context.addInitParameter('jruby.max.runtimes', '2') |
| 93 | + |
91 | 94 | listener = org.jruby.rack.rails.RailsServletContextListener.new |
92 | 95 | listener.contextInitialized javax.servlet.ServletContextEvent.new(servlet_context) |
93 | 96 |
|
94 | 97 | rack_factory = servlet_context.getAttribute("rack.factory") |
95 | 98 | rack_factory.should be_a(RackApplicationFactory) |
96 | 99 | rack_factory.should be_a(PoolingRackApplicationFactory) |
97 | | - rack_factory.should respond_to(:realFactory) |
98 | 100 | rack_factory.realFactory.should be_a(RailsRackApplicationFactory) |
99 | 101 |
|
100 | 102 | servlet_context.getAttribute("rack.context").should be_a(RackContext) |
|
103 | 105 | rack_factory.getApplication.should be_a(DefaultRackApplication) |
104 | 106 | end |
105 | 107 |
|
106 | | - it "initializes threadsafe!" do |
| 108 | + it "initializes shared (thread-safe) by default" do |
| 109 | + listener = org.jruby.rack.rails.RailsServletContextListener.new |
| 110 | + listener.contextInitialized javax.servlet.ServletContextEvent.new(servlet_context) |
| 111 | + |
| 112 | + rack_factory = servlet_context.getAttribute("rack.factory") |
| 113 | + rack_factory.should be_a(RackApplicationFactory) |
| 114 | + rack_factory.should be_a(SharedRackApplicationFactory) |
| 115 | + rack_factory.realFactory.should be_a(RailsRackApplicationFactory) |
| 116 | + |
| 117 | + rack_factory.getApplication.should be_a(DefaultRackApplication) |
| 118 | + end |
| 119 | + |
| 120 | + it "initializes shared (thread-safe) whem max runtimes is 1" do |
107 | 121 | servlet_context.addInitParameter('jruby.max.runtimes', '1') |
108 | 122 |
|
109 | 123 | listener = org.jruby.rack.rails.RailsServletContextListener.new |
|
0 commit comments