Skip to content

Commit 3bb5c15

Browse files
committed
Merge remote-tracking branch 'origin/jruby-1_7'
Conflicts: maven/jruby-complete/src/it/integrity/verify.bsh maven/jruby-dist/src/it/integrity/verify.bsh maven/jruby-jars/src/it/integrity/verify.bsh maven/jruby-noasm/src/it/integrity/verify.bsh maven/jruby/src/it/integrity/verify.bsh test/jruby.1.9.index
2 parents a007df9 + e316ec7 commit 3bb5c15

File tree

12 files changed

+205
-5
lines changed

12 files changed

+205
-5
lines changed

maven/jruby-complete/src/it/integrity/pom.xml

+27
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@
131131
</arguments>
132132
</configuration>
133133
</execution>
134+
<execution>
135+
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
136+
<phase>test</phase>
137+
<goals>
138+
<goal>exec</goal>
139+
</goals>
140+
<configuration>
141+
<executable>java</executable>
142+
<arguments>
143+
<argument>-classpath</argument>
144+
<!-- automatically creates the classpath using all project dependencies,
145+
also adding the project build directory -->
146+
<classpath/>
147+
<argument>org.jruby.Main</argument>
148+
<argument>-e</argument>
149+
<!-- make sure openssl loads -->
150+
<argument>
151+
begin
152+
import_java "org.objectweb.asm.ClassWriter"
153+
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
154+
rescue NameError => e
155+
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
156+
end
157+
</argument>
158+
</arguments>
159+
</configuration>
160+
</execution>
134161
</executions>
135162
</plugin>
136163
</plugins>

maven/jruby-complete/src/it/integrity/verify.bsh

+5
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
3838
{
3939
throw new RuntimeException( "log file does not contain '" + expected + "'" );
4040
}
41+
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
42+
if ( !log.contains( expected ) )
43+
{
44+
throw new RuntimeException( "log file does not contain '" + expected + "'" );
45+
}

maven/jruby-dist/src/it/integrity/pom.xml

+27
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,33 @@
148148
</arguments>
149149
</configuration>
150150
</execution>
151+
<execution>
152+
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
153+
<phase>test</phase>
154+
<goals>
155+
<goal>exec</goal>
156+
</goals>
157+
<configuration>
158+
<executable>java</executable>
159+
<arguments>
160+
<argument>-classpath</argument>
161+
<!-- automatically creates the classpath using all project dependencies,
162+
also adding the project build directory -->
163+
<classpath/>
164+
<argument>org.jruby.Main</argument>
165+
<argument>-e</argument>
166+
<!-- make sure openssl loads -->
167+
<argument>
168+
begin
169+
import_java "org.objectweb.asm.ClassWriter"
170+
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
171+
rescue NameError => e
172+
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
173+
end
174+
</argument>
175+
</arguments>
176+
</configuration>
177+
</execution>
151178
</executions>
152179
</plugin>
153180
</plugins>

maven/jruby-dist/src/it/integrity/verify.bsh

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import java.io.*;
2-
import org.codehaus.plexus.util.FileUtils;
2+
import org.codehaus.plexus.util.fileutils;
33

44

5-
String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
6-
String expected = "rake (10.1.0)";
5+
string log = fileutils.fileread( new file( basedir, "build.log" ) );
6+
string expected = "rake (10.1.0)";
77
if ( !log.contains( expected ) )
88
{
9-
throw new RuntimeException( "log file does not contain '" + expected + "'" );
9+
throw new runtimeexception( "log file does not contain '" + expected + "'" );
1010
}
1111
expected = "4.1.0";
1212
if ( !log.contains( expected ) )
1313
{
14-
throw new RuntimeException( "log file does not contain '" + expected + "'" );
14+
throw new runtimeexception( "log file does not contain '" + expected + "'" );
1515
}
1616
expected = "json (1.8.0 java)";
1717
if ( !log.contains( expected ) )
@@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
3838
{
3939
throw new RuntimeException( "log file does not contain '" + expected + "'" );
4040
}
41+
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
42+
if ( !log.contains( expected ) )
43+
{
44+
throw new RuntimeException( "log file does not contain '" + expected + "'" );
45+
}

maven/jruby-jars/src/it/integrity/pom.xml

+25
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,31 @@
137137
</arguments>
138138
</configuration>
139139
</execution>
140+
<execution>
141+
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
142+
<phase>test</phase>
143+
<goals>
144+
<goal>exec</goal>
145+
</goals>
146+
<configuration>
147+
<executable>java</executable>
148+
<arguments>
149+
<argument>-classpath</argument>
150+
<argument>${gem.home}/gems/jruby-jars-${ruby.version}/lib/jruby-core-@project.version@.jar${path.separator}${gem.home}/gems/jruby-jars-${ruby.version}/lib/jruby-stdlib-@project.version@.jar</argument>
151+
<argument>org.jruby.Main</argument>
152+
<argument>-e</argument>
153+
<!-- make sure openssl loads -->
154+
<argument>
155+
begin
156+
import_java "org.objectweb.asm.ClassWriter"
157+
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
158+
rescue NameError => e
159+
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
160+
end
161+
</argument>
162+
</arguments>
163+
</configuration>
164+
</execution>
140165
</executions>
141166
</plugin>
142167
</plugins>

maven/jruby-jars/src/it/integrity/verify.bsh

+5
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
3838
{
3939
throw new RuntimeException( "log file does not contain '" + expected + "'" );
4040
}
41+
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
42+
if ( !log.contains( expected ) )
43+
{
44+
throw new RuntimeException( "log file does not contain '" + expected + "'" );
45+
}

maven/jruby-noasm/src/it/integrity/pom.xml

+27
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@
131131
</arguments>
132132
</configuration>
133133
</execution>
134+
<execution>
135+
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
136+
<phase>test</phase>
137+
<goals>
138+
<goal>exec</goal>
139+
</goals>
140+
<configuration>
141+
<executable>java</executable>
142+
<arguments>
143+
<argument>-classpath</argument>
144+
<!-- automatically creates the classpath using all project dependencies,
145+
also adding the project build directory -->
146+
<classpath/>
147+
<argument>org.jruby.Main</argument>
148+
<argument>-e</argument>
149+
<!-- make sure openssl loads -->
150+
<argument>
151+
begin
152+
import_java "org.objectweb.asm.ClassWriter"
153+
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
154+
rescue NameError => e
155+
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
156+
end
157+
</argument>
158+
</arguments>
159+
</configuration>
160+
</execution>
134161
</executions>
135162
</plugin>
136163
</plugins>

maven/jruby-noasm/src/it/integrity/verify.bsh

+5
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
3838
{
3939
throw new RuntimeException( "log file does not contain '" + expected + "'" );
4040
}
41+
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
42+
if ( !log.contains( expected ) )
43+
{
44+
throw new RuntimeException( "log file does not contain '" + expected + "'" );
45+
}

maven/jruby/src/it/integrity/pom.xml

+27
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@
131131
</arguments>
132132
</configuration>
133133
</execution>
134+
<execution>
135+
<id>there is org.objectweb.asm.ClassWriter</id>
136+
<phase>test</phase>
137+
<goals>
138+
<goal>exec</goal>
139+
</goals>
140+
<configuration>
141+
<executable>java</executable>
142+
<arguments>
143+
<argument>-classpath</argument>
144+
<!-- automatically creates the classpath using all project dependencies,
145+
also adding the project build directory -->
146+
<classpath/>
147+
<argument>org.jruby.Main</argument>
148+
<argument>-e</argument>
149+
<!-- make sure openssl loads -->
150+
<argument>
151+
begin
152+
java_import "org.objectweb.asm.ClassWriter"
153+
puts "there is org.objectweb.asm.ClassWriter on the classpath"
154+
rescue NameError => e
155+
raise "error there is NO org.objectweb.asm.ClassWriter on the classpath"
156+
end
157+
</argument>
158+
</arguments>
159+
</configuration>
160+
</execution>
134161
</executions>
135162
</plugin>
136163
</plugins>

maven/jruby/src/it/integrity/verify.bsh

+5
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
3838
{
3939
throw new RuntimeException( "log file does not contain '" + expected + "'" );
4040
}
41+
expected = "there is org.objectweb.asm.ClassWriter on the classpath";
42+
if ( !log.contains( expected ) )
43+
{
44+
throw new RuntimeException( "log file does not contain '" + expected + "'" );
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'rspec'
2+
3+
if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
4+
describe "GH-2008: multi args 'system' method on Windows" do
5+
let(:test_dir_name){"this_is_test_dir"}
6+
before :each do
7+
if Dir.exists? test_dir_name
8+
Dir.rmdir test_dir_name
9+
end
10+
end
11+
after :each do
12+
if Dir.exists? test_dir_name
13+
Dir.rmdir test_dir_name
14+
end
15+
end
16+
17+
it "can create directory by intenal command" do
18+
result = system("mkdir", test_dir_name)
19+
result.should be_true
20+
Dir.should be_exists(test_dir_name)
21+
end
22+
end
23+
end

test/test_adding_pem_to_x509store.rb

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'test/unit'
2+
require 'openssl'
3+
4+
class TestOpenssl < Test::Unit::TestCase
5+
def test_adding_pem
6+
# mimic what rubygems/request#add_rubygems_trusted_certs does
7+
# to find the pem certificates
8+
base = $LOAD_PATH.detect { |p| p =~ /shared/ }
9+
pems = Dir[ File.join(base, 'rubygems/ssl_certs/*pem') ]
10+
assert_equal( 7, pems.size )
11+
pems.each do |pem|
12+
store = OpenSSL::X509::Store.new
13+
cert = OpenSSL::X509::Certificate.new(File.read(pem))
14+
assert( !store.verify(cert) )
15+
store.add_file(pem)
16+
assert( store.verify(cert) )
17+
end
18+
end
19+
end

0 commit comments

Comments
 (0)