Skip to content

Commit 55b183e

Browse files
authored
Merge pull request #261 from chadlwilson/get-tests-working
Re-enable specs to run via JRuby-provided bundler
2 parents b5c44cf + 5748707 commit 55b183e

31 files changed

+207
-577
lines changed

.github/workflows/maven.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
- name: Set up JDK 8
25-
uses: actions/setup-java@v3
25+
uses: actions/setup-java@v4
2626
with:
2727
java-version: '8'
2828
distribution: 'temurin'

Gemfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group :default do
44
if rack_version = ENV['RACK_VERSION']
55
gem 'rack', rack_version
66
else
7-
gem 'rack'
7+
gem 'rack', '< 3.0'
88
end
99
end
1010

@@ -14,4 +14,3 @@ end
1414

1515
gem 'rake', '~> 13.2', :group => :test, :require => nil
1616
gem 'rspec', :group => :test
17-
gem 'jruby-openssl', :group => :test if JRUBY_VERSION < '1.7.0'

Gemfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ GEM
55
bundler
66
rake
77
diff-lcs (1.5.1)
8-
rack (3.0.11)
8+
rack (2.2.9)
99
rake (13.2.1)
1010
rspec (3.13.0)
1111
rspec-core (~> 3.13.0)
1212
rspec-expectations (~> 3.13.0)
1313
rspec-mocks (~> 3.13.0)
1414
rspec-core (3.13.0)
1515
rspec-support (~> 3.13.0)
16-
rspec-expectations (3.13.0)
16+
rspec-expectations (3.13.1)
1717
diff-lcs (>= 1.2.0, < 2.0)
1818
rspec-support (~> 3.13.0)
1919
rspec-mocks (3.13.1)
@@ -26,9 +26,9 @@ PLATFORMS
2626

2727
DEPENDENCIES
2828
appraisal (< 1.0)
29-
rack
29+
rack (< 3.0)
3030
rake (~> 13.2)
3131
rspec
3232

3333
BUNDLED WITH
34-
2.4.19
34+
2.3.26

Rakefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ task :unpack_gem => "target" do |t|
6464
mkdir_p "target/vendor"
6565
require 'rubygems/installer'
6666
rack_dir = File.basename(gem_file).sub(/\.gem$/, '')
67-
Gem::Installer.new(Gem::Package.new(gem_file), :unpack => true, :install_dir => rack_dir).unpack "#{target}/#{rack_dir}"
67+
Gem::Package.new(gem_file).extract_files("#{target}/#{rack_dir}")
6868
File.open("#{target}/vendor/rack.rb", "w") do |f|
6969
f << "dir = File.dirname(__FILE__)\n"
7070
f << "if dir =~ /.jar!/ && dir !~ /^file:/\n"
@@ -109,8 +109,9 @@ task :speconly => [ :resources, :test_resources ] do
109109
opts = ENV['SPEC_OPTS'] ? ENV['SPEC_OPTS'] : %q{ --format documentation --color }
110110
spec = ENV['SPEC'] || File.join(Dir.getwd, "src/spec/ruby/**/*_spec.rb")
111111
opts = opts.split(' ').push *FileList[spec].to_a
112-
exec = 'rspec'; exec = Gem.bin_path('rspec', exec) if ENV['FULL_BIN_PATH']
113-
ruby "-Isrc/spec/ruby", "-rbundler/setup", "-S", exec, *opts
112+
ruby = ENV['RUBY'] || 'jruby'
113+
args = ruby.split(' ') + %w{-Isrc/spec/ruby -rbundler/setup -S rspec}
114+
sh *args, *opts
114115
end
115116
end
116117

examples/camping/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source 'http://rubygems.org'
1+
source 'https://rubygems.org'
22

33
gem 'rack'
44
gem 'camping'

examples/rails3/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source 'http://rubygems.org'
1+
source 'https://rubygems.org'
22

33
gem 'rails', '3.1.0'
44

examples/sinatra/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
source :rubygems
1+
source 'https://rubygems.org'
22

33
gem 'sinatra'

pom.xml

+49-85
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,22 @@
1212
<artifactId>jruby-rack</artifactId>
1313
<version>1.2.3-SNAPSHOT</version>
1414
<name>JRuby-Rack</name>
15-
<url>http://github.com/jruby/jruby-rack/</url>
15+
<url>https://github.com/jruby/jruby-rack/</url>
1616
<description>
1717
A servlet bridge for (Ruby-based) Rack applications that allow them
1818
to run in Java Application servers using JRuby.
1919
</description>
2020

2121
<properties>
2222
<jruby.version>9.4.7.0</jruby.version>
23-
<vendor.gems.path>vendor/gems</vendor.gems.path>
24-
<bundler.version>2.4.19</bundler.version>
25-
<bundler.local>false</bundler.local> <!-- true by default -->
2623
<jruby.maven.plugins.version>3.0.3</jruby.maven.plugins.version>
2724
<gem.home>${project.build.directory}/rubygems</gem.home>
25+
<slf4j.version>2.0.12</slf4j.version>
2826
</properties>
2927

3028
<issueManagement>
3129
<system>Github</system>
32-
<url>http://github.com/jruby/jruby-rack/issues</url>
30+
<url>https://github.com/jruby/jruby-rack/issues</url>
3331
</issueManagement>
3432

3533
<distributionManagement>
@@ -46,14 +44,14 @@
4644
<scm>
4745
<connection>scm:git:git://github.com/jruby/jruby-rack.git</connection>
4846
<developerConnection>scm:git:[email protected]:jruby/jruby-rack.git</developerConnection>
49-
<url>http://github.com/jruby/jruby-rack/</url>
47+
<url>https://github.com/jruby/jruby-rack/</url>
5048
<tag>HEAD</tag>
5149
</scm>
5250

5351
<licenses>
5452
<license>
5553
<name>MIT License</name>
56-
<url>http://www.opensource.org/licenses/mit-license.php</url>
54+
<url>https://www.opensource.org/licenses/mit-license.php</url>
5755
<distribution>repo</distribution>
5856
</license>
5957
</licenses>
@@ -97,74 +95,54 @@
9795
<groupId>org.jruby</groupId>
9896
<artifactId>jruby-core</artifactId>
9997
<version>${jruby.version}</version>
100-
</dependency>
101-
<!-- JavaEE 6 APIs -->
102-
<dependency>
103-
<groupId>org.apache.geronimo.specs</groupId>
104-
<artifactId>geronimo-servlet_3.0_spec</artifactId>
105-
<version>1.0</version>
10698
<scope>provided</scope>
10799
</dependency>
108100
<dependency>
109-
<groupId>org.apache.geronimo.specs</groupId>
110-
<artifactId>geronimo-jsp_2.2_spec</artifactId>
111-
<version>1.2</version>
101+
<groupId>javax.servlet</groupId>
102+
<artifactId>javax.servlet-api</artifactId>
103+
<version>3.0.1</version>
112104
<scope>provided</scope>
113105
</dependency>
114106
<dependency>
115-
<groupId>org.apache.geronimo.specs</groupId>
116-
<artifactId>geronimo-el_2.2_spec</artifactId>
117-
<version>1.0.4</version>
107+
<groupId>jakarta.servlet.jsp</groupId>
108+
<artifactId>jakarta.servlet.jsp-api</artifactId>
109+
<version>2.3.6</version>
118110
<scope>provided</scope>
119111
</dependency>
120112
<dependency>
121-
<groupId>org.apache.geronimo.specs</groupId>
122-
<artifactId>geronimo-jms_1.1_spec</artifactId>
123-
<version>1.1.1</version>
113+
<groupId>jakarta.jms</groupId>
114+
<artifactId>jakarta.jms-api</artifactId>
115+
<version>2.0.3</version>
124116
<scope>provided</scope>
125117
</dependency>
126118
<dependency>
127119
<groupId>commons-logging</groupId>
128-
<artifactId>commons-logging-api</artifactId>
129-
<version>1.1</version>
120+
<artifactId>commons-logging</artifactId>
121+
<version>1.3.3</version>
130122
<scope>provided</scope>
131123
</dependency>
132124
<dependency>
133125
<groupId>org.slf4j</groupId>
134126
<artifactId>slf4j-api</artifactId>
135-
<version>1.7.2</version>
127+
<version>${slf4j.version}</version>
136128
<scope>provided</scope>
137129
</dependency>
138130
<dependency>
139-
<groupId>log4j</groupId>
140-
<artifactId>log4j</artifactId>
141-
<version>1.2.17</version>
142-
<scope>provided</scope>
131+
<groupId>org.slf4j</groupId>
132+
<artifactId>slf4j-simple</artifactId>
133+
<version>${slf4j.version}</version>
134+
<scope>test</scope>
143135
</dependency>
144136
<dependency>
145137
<groupId>org.springframework</groupId>
146138
<artifactId>spring-core</artifactId>
147-
<version>3.2.10.RELEASE</version>
139+
<version>3.2.18.RELEASE</version>
148140
<scope>test</scope>
149141
</dependency>
150142
<dependency>
151-
<groupId>rubygems</groupId>
152-
<artifactId>jruby-openssl</artifactId>
153-
<version>0.9.6</version>
154-
<type>gem</type>
155-
<scope>provided</scope>
156-
</dependency>
157-
<dependency>
158-
<groupId>rubygems</groupId>
159-
<artifactId>bundler</artifactId>
160-
<version>${bundler.version}</version>
161-
<type>gem</type>
162-
<scope>provided</scope>
163-
</dependency>
164-
<dependency>
165-
<groupId>javax.activation</groupId>
166-
<artifactId>activation</artifactId>
167-
<version>1.1</version>
143+
<groupId>jakarta.el</groupId>
144+
<artifactId>jakarta.el-api</artifactId>
145+
<version>3.0.3</version>
168146
<scope>test</scope>
169147
</dependency>
170148
</dependencies>
@@ -198,7 +176,7 @@
198176
<plugin>
199177
<groupId>org.apache.maven.plugins</groupId>
200178
<artifactId>maven-compiler-plugin</artifactId>
201-
<version>3.1</version>
179+
<version>3.13.0</version>
202180
<configuration>
203181
<source>8</source>
204182
<target>8</target>
@@ -209,17 +187,17 @@
209187
<plugin>
210188
<groupId>org.apache.maven.plugins</groupId>
211189
<artifactId>maven-surefire-plugin</artifactId>
212-
<version>2.17</version>
190+
<version>3.3.1</version>
213191
</plugin>
214192
<plugin>
215193
<groupId>org.apache.maven.plugins</groupId>
216194
<artifactId>maven-help-plugin</artifactId>
217-
<version>2.2</version>
195+
<version>3.4.1</version>
218196
</plugin>
219197
<plugin>
220198
<groupId>org.apache.maven.plugins</groupId>
221199
<artifactId>maven-dependency-plugin</artifactId>
222-
<version>2.9</version>
200+
<version>3.7.1</version>
223201
<executions>
224202
<execution>
225203
<phase>process-sources</phase>
@@ -234,26 +212,6 @@
234212
</execution>
235213
</executions>
236214
</plugin>
237-
<plugin>
238-
<groupId>org.jruby.maven</groupId>
239-
<artifactId>gem-maven-plugin</artifactId>
240-
<version>${jruby.maven.plugins.version}</version>
241-
<configuration>
242-
<includeOpenSSL>false</includeOpenSSL>
243-
<gemHomes>
244-
<provided>${gem.home}</provided>
245-
</gemHomes>
246-
</configuration>
247-
<executions>
248-
<execution>
249-
<id>gem-install-bundler</id>
250-
<phase>test</phase>
251-
<goals>
252-
<goal>initialize</goal>
253-
</goals>
254-
</execution>
255-
</executions>
256-
</plugin>
257215
<plugin>
258216
<groupId>org.jruby.maven</groupId>
259217
<artifactId>bundler-maven-plugin</artifactId>
@@ -264,9 +222,9 @@
264222
<phase>test</phase>
265223
<goals><goal>install</goal></goals>
266224
<configuration>
267-
<jruby.version>${jruby.version}</jruby.version>
268-
<!--<local>false</local>-->
269-
<bundlerVersion>${bundler.version}</bundlerVersion>
225+
<jrubyVersion>${jruby.version}</jrubyVersion>
226+
<local>false</local>
227+
<quiet>false</quiet>
270228
</configuration>
271229
</execution>
272230
</executions>
@@ -275,29 +233,35 @@
275233
<groupId>org.jruby.maven</groupId>
276234
<artifactId>rake-maven-plugin</artifactId>
277235
<version>${jruby.maven.plugins.version}</version>
236+
<configuration>
237+
<jrubyVersion>${jruby.version}</jrubyVersion>
238+
</configuration>
278239
<executions>
279-
<!-- <execution>-->
280-
<!-- <id>rake-spec</id>-->
281-
<!-- <phase>test</phase>-->
282-
<!-- <goals><goal>rake</goal></goals>-->
283-
<!-- <configuration>-->
284-
<!-- <jruby.version>${jruby.version}</jruby.version>-->
285-
<!-- <args>speconly SKIP_SPECS=${maven.test.skip} FULL_BIN_PATH=true</args>-->
286-
<!-- </configuration>-->
287-
<!-- </execution>-->
240+
<execution>
241+
<id>rake-spec</id>
242+
<phase>test</phase>
243+
<goals><goal>rake</goal></goals>
244+
<configuration>
245+
<args>speconly SKIP_SPECS=${maven.test.skip}</args>
246+
</configuration>
247+
</execution>
288248
<execution>
289249
<!-- additional (ruby) generated resources -->
290250
<id>rake-resources</id>
291251
<phase>prepare-package</phase>
292252
<!-- bind "late" so we do not run during compile/test-compile -->
293253
<goals><goal>rake</goal></goals>
294254
<configuration>
295-
<jruby.version>${jruby.version}</jruby.version>
296255
<args>resources VERSION=${project.version}</args>
297256
</configuration>
298257
</execution>
299258
</executions>
300259
</plugin>
260+
<plugin>
261+
<groupId>org.codehaus.mojo</groupId>
262+
<artifactId>versions-maven-plugin</artifactId>
263+
<version>2.17.1</version>
264+
</plugin>
301265
</plugins>
302266
</build>
303267

@@ -328,7 +292,7 @@
328292
<plugin>
329293
<groupId>org.apache.maven.plugins</groupId>
330294
<artifactId>maven-javadoc-plugin</artifactId>
331-
<version>2.10.1</version>
295+
<version>3.7.0</version>
332296
<executions>
333297
<execution>
334298
<id>attach-javadocs</id>

src/main/java/org/jruby/rack/DefaultRackConfig.java

-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ private static Map<String,String> getLoggerTypes() {
460460
final Map<String,String> loggerTypes = new HashMap<String, String>(8);
461461
loggerTypes.put("commons_logging", "org.jruby.rack.logging.CommonsLoggingLogger");
462462
loggerTypes.put("clogging", "org.jruby.rack.logging.CommonsLoggingLogger");
463-
loggerTypes.put("log4j", "org.jruby.rack.logging.Log4jLogger");
464463
loggerTypes.put("slf4j", "org.jruby.rack.logging.Slf4jLogger");
465464
loggerTypes.put("jul", "org.jruby.rack.logging.JulLogger");
466465
//loggerTypes.put("servlet_context", "org.jruby.rack.logging.ServletContextLogger");

0 commit comments

Comments
 (0)