Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/jruby-1_7'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
headius committed Nov 23, 2014
2 parents a007df9 + e316ec7 commit 3bb5c15
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 5 deletions.
27 changes: 27 additions & 0 deletions maven/jruby-complete/src/it/integrity/pom.xml
Expand Up @@ -131,6 +131,33 @@
</arguments>
</configuration>
</execution>
<execution>
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<!-- automatically creates the classpath using all project dependencies,
also adding the project build directory -->
<classpath/>
<argument>org.jruby.Main</argument>
<argument>-e</argument>
<!-- make sure openssl loads -->
<argument>
begin
import_java "org.objectweb.asm.ClassWriter"
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
rescue NameError => e
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
end
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
5 changes: 5 additions & 0 deletions maven/jruby-complete/src/it/integrity/verify.bsh
Expand Up @@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
27 changes: 27 additions & 0 deletions maven/jruby-dist/src/it/integrity/pom.xml
Expand Up @@ -148,6 +148,33 @@
</arguments>
</configuration>
</execution>
<execution>
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<!-- automatically creates the classpath using all project dependencies,
also adding the project build directory -->
<classpath/>
<argument>org.jruby.Main</argument>
<argument>-e</argument>
<!-- make sure openssl loads -->
<argument>
begin
import_java "org.objectweb.asm.ClassWriter"
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
rescue NameError => e
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
end
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
15 changes: 10 additions & 5 deletions maven/jruby-dist/src/it/integrity/verify.bsh
@@ -1,17 +1,17 @@
import java.io.*;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.fileutils;


String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "rake (10.1.0)";
string log = fileutils.fileread( new file( basedir, "build.log" ) );
string expected = "rake (10.1.0)";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
throw new runtimeexception( "log file does not contain '" + expected + "'" );
}
expected = "4.1.0";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
throw new runtimeexception( "log file does not contain '" + expected + "'" );
}
expected = "json (1.8.0 java)";
if ( !log.contains( expected ) )
Expand All @@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
25 changes: 25 additions & 0 deletions maven/jruby-jars/src/it/integrity/pom.xml
Expand Up @@ -137,6 +137,31 @@
</arguments>
</configuration>
</execution>
<execution>
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<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>
<argument>org.jruby.Main</argument>
<argument>-e</argument>
<!-- make sure openssl loads -->
<argument>
begin
import_java "org.objectweb.asm.ClassWriter"
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
rescue NameError => e
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
end
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
5 changes: 5 additions & 0 deletions maven/jruby-jars/src/it/integrity/verify.bsh
Expand Up @@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
27 changes: 27 additions & 0 deletions maven/jruby-noasm/src/it/integrity/pom.xml
Expand Up @@ -131,6 +131,33 @@
</arguments>
</configuration>
</execution>
<execution>
<id>ensure there is no org.objectweb.asm.ClassWriter</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<!-- automatically creates the classpath using all project dependencies,
also adding the project build directory -->
<classpath/>
<argument>org.jruby.Main</argument>
<argument>-e</argument>
<!-- make sure openssl loads -->
<argument>
begin
import_java "org.objectweb.asm.ClassWriter"
raise "error there is org.objectweb.asm.ClassWriter on the classpath"
rescue NameError => e
puts "there is NO org.objectweb.asm.ClassWriter on the classpath"
end
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
5 changes: 5 additions & 0 deletions maven/jruby-noasm/src/it/integrity/verify.bsh
Expand Up @@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "there is NO org.objectweb.asm.ClassWriter on the classpath";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
27 changes: 27 additions & 0 deletions maven/jruby/src/it/integrity/pom.xml
Expand Up @@ -131,6 +131,33 @@
</arguments>
</configuration>
</execution>
<execution>
<id>there is org.objectweb.asm.ClassWriter</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<!-- automatically creates the classpath using all project dependencies,
also adding the project build directory -->
<classpath/>
<argument>org.jruby.Main</argument>
<argument>-e</argument>
<!-- make sure openssl loads -->
<argument>
begin
java_import "org.objectweb.asm.ClassWriter"
puts "there is org.objectweb.asm.ClassWriter on the classpath"
rescue NameError => e
raise "error there is NO org.objectweb.asm.ClassWriter on the classpath"
end
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
5 changes: 5 additions & 0 deletions maven/jruby/src/it/integrity/verify.bsh
Expand Up @@ -38,3 +38,8 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "there is org.objectweb.asm.ClassWriter on the classpath";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
@@ -0,0 +1,23 @@
require 'rspec'

if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
describe "GH-2008: multi args 'system' method on Windows" do
let(:test_dir_name){"this_is_test_dir"}
before :each do
if Dir.exists? test_dir_name
Dir.rmdir test_dir_name
end
end
after :each do
if Dir.exists? test_dir_name
Dir.rmdir test_dir_name
end
end

it "can create directory by intenal command" do
result = system("mkdir", test_dir_name)
result.should be_true
Dir.should be_exists(test_dir_name)
end
end
end
19 changes: 19 additions & 0 deletions test/test_adding_pem_to_x509store.rb
@@ -0,0 +1,19 @@
require 'test/unit'
require 'openssl'

class TestOpenssl < Test::Unit::TestCase
def test_adding_pem
# mimic what rubygems/request#add_rubygems_trusted_certs does
# to find the pem certificates
base = $LOAD_PATH.detect { |p| p =~ /shared/ }
pems = Dir[ File.join(base, 'rubygems/ssl_certs/*pem') ]
assert_equal( 7, pems.size )
pems.each do |pem|
store = OpenSSL::X509::Store.new
cert = OpenSSL::X509::Certificate.new(File.read(pem))
assert( !store.verify(cert) )
store.add_file(pem)
assert( store.verify(cert) )
end
end
end

0 comments on commit 3bb5c15

Please sign in to comment.