Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build] extract the osgi and j2ee integration tests into their own pr…
…ofile

[build] reduce j2ee profile to minimum
[build] make the osgi more independent of jruby-openssl version used
  • Loading branch information
mkristian committed Oct 7, 2014
1 parent bba3e7c commit 57dfc0d
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 15 deletions.
12 changes: 12 additions & 0 deletions build.xml
Expand Up @@ -470,6 +470,18 @@
</exec>
</target>

<target name="osgi" description="run osgi tests">
<exec executable="mvn" failonerror="true">
<arg line="-Posgi"/>
</exec>
</target>

<target name="j2ee" description="run j2ee tests">
<exec executable="mvn" failonerror="true">
<arg line="-Pj2ee"/>
</exec>
</target>

<target name="complete" description="Create the jruby-complete.jar">
<exec executable="mvn" failonerror="true">
<arg line="-Pcomplete"/>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby-complete/pom.rb
Expand Up @@ -104,6 +104,6 @@
activation do
jdk '1.8'
end
plugin :invoker, :pomExcludes => ['osgi_many_bundles_with_embedded_gems_felix-3.2/pom.xml']
plugin :invoker, :pomExcludes => ['osgi_many_bundles_with_embedded_gems_felix-3.2/pom.xml', '${its.j2ee}', '${its.osgi}']
end
end
2 changes: 2 additions & 0 deletions maven/jruby-complete/pom.xml
Expand Up @@ -199,6 +199,8 @@
<configuration>
<pomExcludes>
<pomExclude>osgi_many_bundles_with_embedded_gems_felix-3.2/pom.xml</pomExclude>
<pomExclude>${its.j2ee}</pomExclude>
<pomExclude>${its.osgi}</pomExclude>
</pomExcludes>
</configuration>
</plugin>
Expand Down
Expand Up @@ -96,8 +96,8 @@ public void testJRubyCreate() throws Exception {
String list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\"]");

// ensure we can load openssl (with its bouncy-castle jars) and krypt
loaded = (Boolean) jruby.runScriptlet( "require 'openssl';require 'krypt'" );
// ensure we can load openssl (with its bouncy-castle jars)
loaded = (Boolean) jruby.runScriptlet( "require 'openssl'" );
assertEquals(true, loaded);

// ensure we can load ffi
Expand All @@ -108,14 +108,15 @@ public void testJRubyCreate() throws Exception {
gemPath = gemPath.replaceAll( "bundle[^:]*://[^/]*", "bundle:/" );
assertEquals( gemPath, "[\"uri:bundle://specifications\", \"uri:bundle://specifications\", \"uri:bundle://META-INF/jruby.home/lib/ruby/gems/shared/specifications\"]" );

list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");
jruby.runScriptlet( "require 'jar-dependencies'; require 'krypt'" );
list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");

// ensure we can load can load embedded gems
loaded = (Boolean) jruby.runScriptlet( "require 'virtus'" );
assertEquals(true, loaded);

list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
}
}
2 changes: 1 addition & 1 deletion maven/jruby/pom.rb
Expand Up @@ -58,7 +58,7 @@
activation do
jdk '1.8'
end
plugin :invoker, :pomExcludes => ['osgi_all_inclusive_felix-3.2/pom.xml']
plugin :invoker, :pomExcludes => ['osgi_all_inclusive_felix-3.2/pom.xml', '${its.j2ee}', '${its.osgi}']
end
profile :id => :jdk6 do
activation do
Expand Down
2 changes: 2 additions & 0 deletions maven/jruby/pom.xml
Expand Up @@ -119,6 +119,8 @@
<configuration>
<pomExcludes>
<pomExclude>osgi_all_inclusive_felix-3.2/pom.xml</pomExclude>
<pomExclude>${its.j2ee}</pomExclude>
<pomExclude>${its.osgi}</pomExclude>
</pomExcludes>
</configuration>
</plugin>
Expand Down
Expand Up @@ -95,14 +95,15 @@ public void testJRubyCreate() throws InterruptedException {
gemPath = gemPath.replaceAll( "bundle[^:]*://[^/]*", "bundle:/" );
assertEquals( gemPath, "[\"uri:bundle://specifications\", \"uri:bundle://META-INF/jruby.home/lib/ruby/gems/shared/specifications\"]" );

jruby.runScriptlet( "require 'jar-dependencies'; require 'krypt'" );
list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");

// ensure we can load can load embedded gems
loaded = (Boolean) jruby.runScriptlet( "require 'virtus'" );
assertEquals(true, loaded);

list = (String) jruby.runScriptlet( "Gem.loaded_specs.keys.inspect" );
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
}
}
8 changes: 4 additions & 4 deletions maven/pom.rb
Expand Up @@ -23,14 +23,14 @@
end

# module to profile map
map = { 'jruby' => [ :release, :main ],
'jruby-stdlib' => [ :release, :main, :complete, :dist, 'jruby-jars' ],
'jruby-complete' => [ :release, :complete ],
map = { 'jruby' => [ :release, :main, :osgi, :j2ee ],
'jruby-noasm' => [ :release, :main ],
'jruby-stdlib' => [ :release, :main, :complete, :dist, 'jruby-jars', :osgi, :j2ee ],
'jruby-complete' => [ :release, :complete, :osgi ],
'jruby-dist' => [ :release, :dist ],
'jruby-jars' => [ :release, 'jruby-jars' ],
'jruby-rake-plugin' => [ :release, 'jruby-rake-plugin']
}
map[ 'jruby-noasm' ] = map[ 'jruby' ]

profile :all do
modules map.keys
Expand Down
20 changes: 18 additions & 2 deletions maven/pom.xml
Expand Up @@ -50,32 +50,48 @@
<id>all</id>
<modules>
<module>jruby</module>
<module>jruby-noasm</module>
<module>jruby-stdlib</module>
<module>jruby-complete</module>
<module>jruby-dist</module>
<module>jruby-jars</module>
<module>jruby-rake-plugin</module>
<module>jruby-noasm</module>
</modules>
</profile>
<profile>
<id>release</id>
<modules>
<module>jruby</module>
<module>jruby-noasm</module>
<module>jruby-stdlib</module>
<module>jruby-complete</module>
<module>jruby-dist</module>
<module>jruby-jars</module>
<module>jruby-rake-plugin</module>
<module>jruby-noasm</module>
</modules>
</profile>
<profile>
<id>main</id>
<modules>
<module>jruby</module>
<module>jruby-noasm</module>
<module>jruby-stdlib</module>
</modules>
</profile>
<profile>
<id>osgi</id>
<modules>
<module>jruby</module>
<module>jruby-stdlib</module>
<module>jruby-noasm</module>
<module>jruby-complete</module>
</modules>
</profile>
<profile>
<id>j2ee</id>
<modules>
<module>jruby</module>
<module>jruby-stdlib</module>
</modules>
</profile>
<profile>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -53,6 +53,8 @@
</organization>

<properties>
<its.j2ee>j2ee*/pom.xml</its.j2ee>
<its.osgi>osgi*/pom.xml</its.osgi>
<invoker.skip>true</invoker.skip>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<jruby.plugins.version>1.0.7-SNAPSHOT</jruby.plugins.version>
Expand Down Expand Up @@ -358,6 +360,10 @@
<postBuildHookScript>verify.bsh</postBuildHookScript>
<streamLogs>true</streamLogs>
<goals><goal>install</goal></goals>
<pomExcludes>
<pomExclude>${its.j2ee}</pomExclude>
<pomExclude>${its.osgi}</pomExclude>
</pomExcludes>
</configuration>
</plugin>

Expand Down

0 comments on commit 57dfc0d

Please sign in to comment.