-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: VERSION core/pom.xml core/src/main/java/org/jruby/RubyString.java core/src/main/java/org/jruby/RubyStruct.java core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java docs/man/pom.xml docs/pom.xml ext/pom.xml ext/readline/pom.xml ext/ripper/pom.xml lib/pom.rb lib/pom.xml maven/jruby-complete/pom.xml maven/jruby-complete/src/it/integrity/verify.bsh maven/jruby-dist/pom.xml maven/jruby-dist/src/it/integrity/verify.bsh maven/jruby-jars/pom.xml maven/jruby-jars/src/it/integrity/verify.bsh maven/jruby-noasm/pom.xml maven/jruby-noasm/src/it/integrity/verify.bsh maven/jruby-rake-plugin/pom.xml maven/jruby-stdlib/pom.xml maven/jruby/pom.rb maven/jruby/pom.xml maven/jruby/src/it/integrity/verify.bsh maven/jruby/src/it/runnable/pom.xml maven/pom.xml pom.xml rakelib/test.rake spec/regression/GH-2524_bigdecimal_loss_of_precision_with_different_excution_order_spec.rb test/externals/ruby1.9/excludes/OpenSSL/TestASN1.rb test/externals/ruby1.9/excludes/OpenSSL/TestCipher.rb test/externals/ruby1.9/excludes/OpenSSL/TestDigest.rb test/externals/ruby1.9/excludes/OpenSSL/TestX509Name.rb test/externals/ruby1.9/excludes/OpenSSL/TestX509Request.rb test/externals/ruby1.9/openssl/test_asn1.rb test/pom.xml test/test_adding_pem_to_x509store.rb
Showing
34 changed files
with
2,333 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
core/src/test/java/org/jruby/embed/IsolatedScriptingContainerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.jruby.embed; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.fail; | ||
|
||
import java.net.URL; | ||
import java.net.URLClassLoader; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
public class IsolatedScriptingContainerTest { | ||
|
||
static ClassLoader cl; | ||
|
||
@BeforeClass | ||
public static void setupClassLoader() { | ||
cl = Thread.currentThread().getContextClassLoader(); | ||
// make sure we have classloader which does not find jruby | ||
ClassLoader c = new URLClassLoader( new URL[] {}, null ); | ||
try { | ||
c.loadClass( "org.jruby.embed.ScriptingContainer" ); | ||
fail( "this classloader shall not find jruby" ); | ||
} | ||
catch( ClassNotFoundException expected){} | ||
// set it as context classloader | ||
Thread.currentThread().setContextClassLoader( c ); | ||
} | ||
|
||
@AfterClass | ||
public static void restClassLoader() { | ||
Thread.currentThread().setContextClassLoader( cl ); | ||
} | ||
|
||
@Test | ||
public void testIsolatedScriptingContainer() throws Exception { | ||
// we do have an instance of "jruby" loaded via some other classloader | ||
//System.setProperty("jruby.debug.loadService", "true"); | ||
ScriptingContainer instance = new IsolatedScriptingContainer(); | ||
String result = instance.runScriptlet( "$LOAD_PATH" ).toString(); | ||
assertNotNull(result); | ||
|
||
assertEquals(instance.runScriptlet("JRuby.runtime.jruby_class_loader.parent" ), cl ); | ||
assertEquals(ScriptingContainer.class.getClassLoader(), cl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# dummy to run IsolatedScriptingContainerTest | ||
module Gem | ||
class Specification | ||
def self.reset | ||
end | ||
def self.add_dir *args | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
. | ||
config.ru | ||
gems | ||
specifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#-*- mode: ruby -*- | ||
|
||
# it is war-file | ||
packaging 'war' | ||
|
||
# get jruby dependencies | ||
properties( 'jruby.version' => '@project.version@', | ||
'jruby.plugins.version' => '1.0.7', | ||
'project.build.sourceEncoding' => 'utf-8', | ||
'public.dir' => '${basedir}/public' ) | ||
|
||
pom( 'org.jruby:jruby', '${jruby.version}' ) | ||
|
||
jar( 'org.jruby.rack:jruby-rack', '1.1.18', | ||
:exclusions => [ 'org.jruby:jruby-complete' ] ) | ||
|
||
|
||
# ruby-maven will dump an equivalent pom.xml | ||
properties[ 'tesla.dump.pom' ] = 'pom.xml' | ||
|
||
# a gem to be used | ||
gem 'flickraw', '0.9.7' | ||
|
||
repository( :url => 'http://rubygems-proxy.torquebox.org/releases', | ||
:id => 'rubygems-releases' ) | ||
|
||
jruby_plugin :gem, :includeRubygemsInResources => true, :includeLibDirectoryInResources => true do | ||
execute_goal :initialize | ||
end | ||
|
||
# not really needed but for completeness: | ||
# pack the war with that ruby-like directory layout | ||
plugin( :war, '2.2', | ||
:warSourceDirectory => '${public.dir}' ) | ||
|
||
resource :directory => '${basedir}', :includes => [ 'config.ru', '.jrubydir' ] | ||
|
||
# start jetty for the tests | ||
plugin( 'org.eclipse.jetty:jetty-maven-plugin', '9.1.3.v20140225', | ||
:path => '/', | ||
:webAppSourceDirectory => '${public.dir}', | ||
:stopPort => 9999, | ||
:stopKey => 'foo' ) do | ||
execute_goal( 'start', :id => 'start jetty', :phase => 'pre-integration-test', :daemon => true ) | ||
execute_goal( 'stop', :id => 'stop jetty', :phase => 'post-integration-test' ) | ||
end | ||
|
||
# download files during the tests | ||
result = nil | ||
execute 'download', :phase => 'integration-test' do | ||
require 'open-uri' | ||
result = open( 'http://localhost:8080' ).string | ||
puts result | ||
end | ||
|
||
# verify the downloads | ||
execute 'check download', :phase => :verify do | ||
expected = 'hello world:' | ||
unless result.match( /^#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'self: uri:classloader://config.ru' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'PWD: uri:classloader://' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'Gem.path: ."uri:classloader://",' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
# TODO get rid off this over normalization | ||
expected = 'uri:classloader:/gems/flickraw-0.9.7' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
end | ||
# vim: syntax=Ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#-*- mode: ruby -*- | ||
|
||
use Rack::ShowExceptions | ||
|
||
require 'hello_world' | ||
|
||
run lambda { |env| | ||
require 'flickraw' | ||
[ | ||
200, | ||
{ | ||
'Content-Type' => 'text/html', | ||
'Cache-Control' => 'public, max-age=86400' | ||
}, | ||
[ "self: #{__FILE__}\n", "PWD: #{Dir.pwd}\n", "Gem.path: #{Gem.path.inspect}\n", Gem.loaded_specs['flickraw'].gem_dir + "\n", HelloWorld.new + "\n" ] | ||
] | ||
} | ||
|
||
# vim: syntax=Ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'openssl' | ||
|
||
class HelloWorld < String | ||
def initialize | ||
super "hello world: #{OpenSSL::Random.random_bytes( 16 ).inspect}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>no_group_id_given</groupId> | ||
<artifactId>j2ee_jetty_rack</artifactId> | ||
<version>0.0.0</version> | ||
<packaging>war</packaging> | ||
<name>j2ee_jetty_rack</name> | ||
<properties> | ||
<jruby.version>@project.version@</jruby.version> | ||
<jruby.plugins.version>1.0.7</jruby.plugins.version> | ||
<tesla.dump.pom>pom.xml</tesla.dump.pom> | ||
<public.dir>${basedir}/public</public.dir> | ||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding> | ||
<tesla.version>0.1.1</tesla.version> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby</artifactId> | ||
<version>${jruby.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby.rack</groupId> | ||
<artifactId>jruby-rack</artifactId> | ||
<version>1.1.18</version> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jruby-complete</artifactId> | ||
<groupId>org.jruby</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>flickraw</artifactId> | ||
<version>0.9.7</version> | ||
<type>gem</type> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>rubygems-releases</id> | ||
<url>http://rubygems-proxy.torquebox.org/releases</url> | ||
</repository> | ||
</repositories> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}</directory> | ||
<includes> | ||
<include>config.ru</include> | ||
<include>.jrubydir</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-maven-plugin</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>initialize</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<includeRubygemsInResources>true</includeRubygemsInResources> | ||
<includeLibDirectoryInResources>true</includeLibDirectoryInResources> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.2</version> | ||
<configuration> | ||
<warSourceDirectory>${public.dir}</warSourceDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<version>9.1.3.v20140225</version> | ||
<executions> | ||
<execution> | ||
<id>start jetty</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
<configuration> | ||
<daemon>true</daemon> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>stop jetty</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>stop</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<path>/</path> | ||
<webAppSourceDirectory>${public.dir}</webAppSourceDirectory> | ||
<stopPort>9999</stopPort> | ||
<stopKey>foo</stopKey> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-maven-plugin</artifactId> | ||
<version>${tesla.version}</version> | ||
<executions> | ||
<execution> | ||
<id>download</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>download</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>check download</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>check download</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-ruby</artifactId> | ||
<version>${tesla.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
classes | ||
config.ru |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE web-app PUBLIC | ||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | ||
"http://java.sun.com/dtd/web-app_2_3.dtd"> | ||
<web-app> | ||
<context-param> | ||
<param-name>jruby.rack.layout_class</param-name> | ||
<param-value>JRuby::Rack::ClassPathLayout</param-value> | ||
</context-param> | ||
|
||
<filter> | ||
<filter-name>RackFilter</filter-name> | ||
<filter-class>org.jruby.rack.RackFilter</filter-class> | ||
</filter> | ||
<filter-mapping> | ||
<filter-name>RackFilter</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<listener> | ||
<listener-class>org.jruby.rack.RackServletContextListener</listener-class> | ||
</listener> | ||
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
. | ||
config.ru | ||
gems | ||
specifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#-*- mode: ruby -*- | ||
|
||
# it is war-file | ||
packaging 'war' | ||
|
||
# get jruby dependencies | ||
properties( 'jruby.version' => '@project.version@', | ||
'jruby.home' => '../../../../../', | ||
'jruby.plugins.version' => '1.0.3', | ||
'project.build.sourceEncoding' => 'utf-8', | ||
'public.dir' => '${basedir}/public' ) | ||
|
||
pom( 'org.jruby:jruby', '${jruby.version}' ) | ||
|
||
jar( 'org.jruby.rack:jruby-rack', '1.1.18', | ||
:exclusions => [ 'org.jruby:jruby-complete' ] ) | ||
|
||
|
||
# ruby-maven will dump an equivalent pom.xml | ||
properties[ 'tesla.dump.pom' ] = 'pom.xml' | ||
|
||
# a gem to be used | ||
gem 'flickraw', '0.9.7' | ||
|
||
repository( :url => 'http://rubygems-proxy.torquebox.org/releases', | ||
:id => 'rubygems-releases' ) | ||
|
||
jruby_plugin :gem, :includeRubygemsInResources => true, :includeLibDirectoryInResources => true do | ||
execute_goal :initialize | ||
end | ||
|
||
# not really needed but for completeness: | ||
# pack the war with that ruby-like directory layout | ||
plugin( :war, '2.2', | ||
:warSourceDirectory => '${public.dir}' ) | ||
|
||
resource :directory => '${basedir}', :includes => [ 'config.ru', '.jrubydir' ] | ||
|
||
# start tomcat for the tests | ||
plugin( 'org.codehaus.mojo:tomcat-maven-plugin', '1.1', | ||
:fork => true, :path => '/', | ||
:warSourceDirectory => '${public.dir}' ) do | ||
execute_goals( 'run', | ||
:id => 'run-tomcat', | ||
:phase => 'pre-integration-test' ) | ||
end | ||
|
||
# download files during the tests | ||
execute 'download', :phase => 'integration-test' do | ||
require 'open-uri' | ||
result = open( 'http://localhost:8080' ).string | ||
File.open( 'result', 'w' ) { |f| f.puts result } | ||
puts result | ||
end | ||
|
||
# verify the downloads | ||
execute 'check download', :phase => :verify do | ||
result = File.read( 'result' ) | ||
expected = 'hello world:' | ||
unless result.match( /^#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'self: uri:classloader://config.ru' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'PWD: uri:classloader://' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'Gem.path: ."uri:classloader://",' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
# TODO get rid off this over normalization | ||
#expected = 'uri:classloader:/gems/flickraw-0.9.7' | ||
# TODO find out why travis find the gem on filesystem | ||
expected = 'target/classes/gems/flickraw-0.9.7' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
end | ||
# vim: syntax=Ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#-*- mode: ruby -*- | ||
|
||
use Rack::ShowExceptions | ||
|
||
require 'hello_world' | ||
|
||
run lambda { |env| | ||
require 'flickraw' | ||
[ | ||
200, | ||
{ | ||
'Content-Type' => 'text/html', | ||
'Cache-Control' => 'public, max-age=86400' | ||
}, | ||
[ "self: #{__FILE__}\n", "PWD: #{Dir.pwd}\n", "Gem.path: #{Gem.path.inspect}\n","Gem::Specification.dirs: #{Gem::Specification.dirs.inspect}\n", Gem.loaded_specs['flickraw'].gem_dir + "\n", HelloWorld.new + "\n" ] | ||
] | ||
} | ||
|
||
# vim: syntax=Ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'openssl' | ||
|
||
class HelloWorld < String | ||
def initialize | ||
super "hello world: #{OpenSSL::Random.random_bytes( 16 ).inspect}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>no_group_id_given</groupId> | ||
<artifactId>j2ee_tomcat_rack</artifactId> | ||
<version>0.0.0</version> | ||
<packaging>war</packaging> | ||
<name>j2ee_tomcat_rack</name> | ||
<properties> | ||
<jruby.home>../../../../../</jruby.home> | ||
<jruby.version>@project.version@</jruby.version> | ||
<jruby.plugins.version>1.0.3</jruby.plugins.version> | ||
<tesla.dump.pom>pom.xml</tesla.dump.pom> | ||
<public.dir>${basedir}/public</public.dir> | ||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding> | ||
<tesla.version>0.1.1</tesla.version> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby</artifactId> | ||
<version>${jruby.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby.rack</groupId> | ||
<artifactId>jruby-rack</artifactId> | ||
<version>1.1.18</version> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jruby-complete</artifactId> | ||
<groupId>org.jruby</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>flickraw</artifactId> | ||
<version>0.9.7</version> | ||
<type>gem</type> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>rubygems-releases</id> | ||
<url>http://rubygems-proxy.torquebox.org/releases</url> | ||
</repository> | ||
</repositories> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}</directory> | ||
<includes> | ||
<include>config.ru</include> | ||
<include>.jrubydir</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-maven-plugin</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>initialize</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<includeRubygemsInResources>true</includeRubygemsInResources> | ||
<includeLibDirectoryInResources>true</includeLibDirectoryInResources> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.2</version> | ||
<configuration> | ||
<warSourceDirectory>${public.dir}</warSourceDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>tomcat-maven-plugin</artifactId> | ||
<version>1.1</version> | ||
<executions> | ||
<execution> | ||
<id>run-tomcat</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<fork>true</fork> | ||
<path>/</path> | ||
<warSourceDirectory>${public.dir}</warSourceDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-maven-plugin</artifactId> | ||
<version>${tesla.version}</version> | ||
<executions> | ||
<execution> | ||
<id>download</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>download</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>check download</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>check download</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-ruby</artifactId> | ||
<version>${tesla.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
maven/jruby/src/it/j2ee_tomcat_rack/public/WEB-INF/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
classes | ||
config.ru |
22 changes: 22 additions & 0 deletions
22
maven/jruby/src/it/j2ee_tomcat_rack/public/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE web-app PUBLIC | ||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | ||
"http://java.sun.com/dtd/web-app_2_3.dtd"> | ||
<web-app> | ||
<context-param> | ||
<param-name>jruby.rack.layout_class</param-name> | ||
<param-value>JRuby::Rack::ClassPathLayout</param-value> | ||
</context-param> | ||
|
||
<filter> | ||
<filter-name>RackFilter</filter-name> | ||
<filter-class>org.jruby.rack.RackFilter</filter-class> | ||
</filter> | ||
<filter-mapping> | ||
<filter-name>RackFilter</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<listener> | ||
<listener-class>org.jruby.rack.RackServletContextListener</listener-class> | ||
</listener> | ||
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,335 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>no_group_id_given</groupId> | ||
<artifactId>runnable</artifactId> | ||
<version>0.0.0</version> | ||
<name>runnable</name> | ||
<properties> | ||
<tesla.dump.readOnly>true</tesla.dump.readOnly> | ||
<jruby.version>@project.version@</jruby.version> | ||
<jruby.plugins.version>1.0.3</jruby.plugins.version> | ||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding> | ||
<tesla.dump.pom>pom.xml</tesla.dump.pom> | ||
<tesla.version>0.1.1</tesla.version> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>bundler</artifactId> | ||
<version>1.7.7</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby</artifactId> | ||
<version>${jruby.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>rubygems-releases</id> | ||
<url>http://rubygems-proxy.torquebox.org/releases</url> | ||
</repository> | ||
</repositories> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}</directory> | ||
<includes> | ||
<include>config.ru</include> | ||
<include>*file</include> | ||
<include>*file.lock</include> | ||
<include>.jbundler/classpath.rb</include> | ||
<include>lib/**</include> | ||
<include>app/**</include> | ||
<include>config/**</include> | ||
<include>vendor/**</include> | ||
<include>spec/**</include> | ||
</includes> | ||
</resource> | ||
<resource> | ||
<targetPath>META-INF/jruby.home/bin</targetPath> | ||
<directory>${project.build.directory}/rubygems/bin</directory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
<directory>pkg</directory> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.4</version> | ||
<executions> | ||
<execution> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<outputDirectory>.</outputDirectory> | ||
<finalName>runnable</finalName> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>2.4</version> | ||
<configuration> | ||
<filesets> | ||
<fileset> | ||
<directory>.</directory> | ||
<includes> | ||
<include>runnable.jar</include> | ||
<include>*/**/*.jar</include> | ||
</includes> | ||
</fileset> | ||
</filesets> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-maven-plugin</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<executions> | ||
<execution> | ||
<id>install gems</id> | ||
<goals> | ||
<goal>initialize</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<jrubyVersion>1.7.19</jrubyVersion> | ||
<includeRubygemsInResources>true</includeRubygemsInResources> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy jar dependencies</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.bouncycastle</groupId> | ||
<artifactId>bcpkix-jdk15on</artifactId> | ||
<type>jar</type> | ||
<version>1.49</version> | ||
<classifier /> | ||
<outputDirectory>${project.build.outputDirectory}/org/bouncycastle/bcpkix-jdk15on/1.49</outputDirectory> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<type>jar</type> | ||
<version>1.6.4</version> | ||
<classifier /> | ||
<outputDirectory>${project.build.outputDirectory}/org/slf4j/slf4j-simple/1.6.4</outputDirectory> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.bouncycastle</groupId> | ||
<artifactId>bcprov-jdk15on</artifactId> | ||
<type>jar</type> | ||
<version>1.49</version> | ||
<classifier /> | ||
<outputDirectory>${project.build.outputDirectory}/org/bouncycastle/bcprov-jdk15on/1.49</outputDirectory> | ||
</artifactItem> | ||
<artifactItem> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<type>jar</type> | ||
<version>1.6.4</version> | ||
<classifier /> | ||
<outputDirectory>${project.build.outputDirectory}/org/slf4j/slf4j-api/1.6.4</outputDirectory> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>pack</id> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<artifactSet> | ||
<excludes> | ||
<exclude>rubygems:*</exclude> | ||
</excludes> | ||
</artifactSet> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>Main</mainClass> | ||
</transformer> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2</version> | ||
<executions> | ||
<execution> | ||
<id>rake -T</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<arguments> | ||
<argument>-jar</argument> | ||
<argument>runnable.jar</argument> | ||
<argument>-S</argument> | ||
<argument>rake</argument> | ||
<argument>-T</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>rspec</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<arguments> | ||
<argument>-jar</argument> | ||
<argument>runnable.jar</argument> | ||
<argument>-S</argument> | ||
<argument>rspec</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<executable>java</executable> | ||
<environmentVariables> | ||
<PATH>${basedir}</PATH> | ||
<HOME>${basedir}</HOME> | ||
<GEM_PATH>${basedir}</GEM_PATH> | ||
<GEM_HOME>${basedir}</GEM_HOME> | ||
</environmentVariables> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-maven-plugin</artifactId> | ||
<version>${tesla.version}</version> | ||
<executions> | ||
<execution> | ||
<id>create jrubydir info</id> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>create jrubydir info</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-ruby</artifactId> | ||
<version>${tesla.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>gemfile</id> | ||
<activation> | ||
<file> | ||
<missing>Gemfile.lock</missing> | ||
</file> | ||
</activation> | ||
<dependencies> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>rspec</artifactId> | ||
<version>[2.14,2.99999]</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>rake</artifactId> | ||
<version>[10.3,10.99999]</version> | ||
<type>gem</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>jbundler</artifactId> | ||
<version>0.7.1</version> | ||
<type>gem</type> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
<profile> | ||
<id>gemfile_lock</id> | ||
<activation> | ||
<file> | ||
<exists>Gemfile.lock</exists> | ||
</file> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-maven-plugin</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<executions> | ||
<execution> | ||
<id>install gem sets for compile</id> | ||
<phase>initialize</phase> | ||
<goals> | ||
<goal>sets</goal> | ||
</goals> | ||
<configuration> | ||
<scope>compile</scope> | ||
<gems> | ||
<rspec>2.99.0</rspec> | ||
<rspec-core>2.99.2</rspec-core> | ||
<rspec-expectations>2.99.2</rspec-expectations> | ||
<diff-lcs>1.2.5</diff-lcs> | ||
<rspec-mocks>2.99.2</rspec-mocks> | ||
<rake>10.3.2</rake> | ||
<jbundler>0.7.1</jbundler> | ||
<jar-dependencies>0.1.7</jar-dependencies> | ||
<maven-tools>1.0.7</maven-tools> | ||
<virtus>1.0.3</virtus> | ||
<axiom-types>0.1.1</axiom-types> | ||
<descendants_tracker>0.0.4</descendants_tracker> | ||
<thread_safe>0.3.4</thread_safe> | ||
<ice_nine>0.11.0</ice_nine> | ||
<coercible>1.0.0</coercible> | ||
<equalizer>0.0.9</equalizer> | ||
<ruby-maven>3.1.1.0.8</ruby-maven> | ||
<ruby-maven-libs>3.1.1</ruby-maven-libs> | ||
</gems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
spec/regression/GH-2182_struct_inspect_has_ascii_encoding_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
# https://github.com/jruby/jruby/issues/2182 | ||
if RUBY_VERSION > '1.9' | ||
describe 'Struct#inspect' do | ||
it 'returns correct value' do | ||
s1 = Struct.new(:aa).new("ΆἅἇἈ") | ||
s1.inspect.should == "#<struct aa=\"ΆἅἇἈ\">" | ||
s1.inspect.encoding.should == Encoding::UTF_8 | ||
|
||
s2 = Struct.new(:a, :b).new("ΆἅἇἈ", "abc") | ||
s2.inspect.should == "#<struct a=\"ΆἅἇἈ\", b=\"abc\">" | ||
s2.inspect.encoding.should == Encoding::UTF_8 | ||
|
||
s3 = Struct.new(:b).new("abc") | ||
s3.inspect.should == "#<struct b=\"abc\">" | ||
s3.inspect.encoding.should == Encoding::ASCII_8BIT | ||
|
||
s4 = Struct.new(:"ΆἅἇἈ").new("aa") | ||
s4.inspect.should == "#<struct ΆἅἇἈ=\"aa\">" | ||
s4.inspect.encoding.should == Encoding::UTF_8 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ | |
expect(r1).to eq(r2) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,35 @@ | ||
# encoding: UTF-8 | ||
require 'test/unit' | ||
require 'java' | ||
|
||
class TestPrimitiveToJava < Test::Unit::TestCase | ||
|
||
def setup; super; require 'java' end | ||
|
||
def test_primitive_conversion | ||
t = Time.now | ||
date = t.to_java(java.util.Date) | ||
|
||
assert_equal(t.to_i, date.time / 1000, "Ruby time #{t} not converted to java date correctly: #{date}") | ||
end | ||
|
||
def test_char_conversion | ||
str = 'a' | ||
char = str.to_java(:char) | ||
assert_instance_of Java::JavaLang::Character, char | ||
|
||
str = ' ' | ||
char = str.to_java(Java::char) | ||
assert_equal 32, char.charValue | ||
|
||
str = '0' | ||
char = str.to_java(java.lang.Character) | ||
assert_equal 48.to_java(:char), char | ||
|
||
assert_equal 228, 'ä'.to_java(:char).charValue unless RUBY_VERSION.index('1.8') == 0 | ||
|
||
assert_raises(ArgumentError) { ''.to_java(:char) } | ||
assert_raises(ArgumentError) { 'už'.to_java('java.lang.Character') } | ||
'už'[1].to_java('java.lang.Character') unless RUBY_VERSION.index('1.8') == 0 | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters