Skip to content

Commit

Permalink
address the fact that the new jruby-openssl gem does not require kryp…
Browse files Browse the repository at this point in the history
…t any more

moved around the osgi integration tests to be easier managed
  • Loading branch information
mkristian committed Oct 3, 2014
1 parent 18232b2 commit b1df10c
Show file tree
Hide file tree
Showing 39 changed files with 90 additions and 459 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Expand Up @@ -78,11 +78,9 @@ dependency-reduced-pom.xml
install/updates.xml

# generated ITs
maven/jruby/src/it/osgi_*equinox*
maven/jruby/src/it/osgi_*felix-3*
maven/jruby/src/it/osgi_*knoplerfish
maven/jruby/src/it/osgi_*
maven/jruby/src/it/j2ee_wlp
maven/jruby-complete/src/it/osgi_many_bundles_with_embedded_gems_*
maven/jruby-complete/src/it/osgi*

# IntelliJ project files
.idea
Expand Down
15 changes: 12 additions & 3 deletions maven/jruby-complete/pom.rb
Expand Up @@ -52,16 +52,25 @@

execute 'setup other osgi frameworks', :phase => 'pre-integration-test' do |ctx|
require 'fileutils'
felix = File.join( ctx.basedir.to_pathname, 'src', 'it', 'osgi_many_bundles_with_embedded_gems' )
[ 'equinox-3.6', 'equinox-3.7', 'felix-3.2' ].each do |m|
source = File.join( ctx.basedir.to_pathname, 'src', 'templates', 'osgi_many_bundles_with_embedded_gems' )
[ 'equinox-3.6', 'equinox-3.7', 'felix-3.2', 'felix-4.4' ].each do |m|
target = File.join( ctx.basedir.to_pathname, 'src', 'it', 'osgi_many_bundles_with_embedded_gems_' + m )
FileUtils.cp_r( felix, target )
FileUtils.cp_r( source, target )
File.open( File.join( target, 'invoker.properties' ), 'w' ) do |f|
f.puts 'invoker.profiles = ' + m
end
end
end

plugin( :clean ) do
execute_goals( :clean,
:phase => :clean,
:id => 'clean-extra-osgi-ITs',
:filesets => [ { :directory => '${basedir}/src/it',
:includes => ['osgi*/**'] } ],
:failOnError => false )
end

profile 'sonatype-oss-release' do

# use the javadocs and sources from jruby-core !!!
Expand Down
23 changes: 23 additions & 0 deletions maven/jruby-complete/pom.xml
Expand Up @@ -72,6 +72,29 @@
<skipSource>true</skipSource>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>clean-extra-osgi-ITs</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/src/it</directory>
<includes>
<include>osgi*/**</include>
</includes>
</fileset>
</filesets>
<failOnError>false</failOnError>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.tesla.polyglot</groupId>
<artifactId>tesla-polyglot-maven-plugin</artifactId>
Expand Down
1 change: 1 addition & 0 deletions maven/jruby-complete/src/it/helloworld/pom.xml
Expand Up @@ -35,6 +35,7 @@
<argument>
puts 'hello world'
puts 'openssl loaded' if require 'openssl'
puts 'krypt loaded' if require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby-complete/src/it/helloworld/verify.bsh
Expand Up @@ -13,7 +13,7 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "ffi,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
Expand Down

This file was deleted.

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

// ensure we can load ffi
Expand All @@ -109,13 +109,13 @@ public void testJRubyCreate() throws Exception {
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\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"krypt\", \"krypt-core\", \"krypt-provider-jdk\"]");

// 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\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"krypt\", \"krypt-core\", \"krypt-provider-jdk\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
}
}
1 change: 1 addition & 0 deletions maven/jruby-jars/src/it/helloworld/pom.xml
Expand Up @@ -40,6 +40,7 @@
<argument>
puts 'hello world'
puts 'openssl loaded' if require 'openssl'
puts 'krypt loaded' if require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby-jars/src/it/helloworld/verify.bsh
Expand Up @@ -13,7 +13,7 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "ffi,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
Expand Down
1 change: 1 addition & 0 deletions maven/jruby-noasm/src/it/helloworld/pom.xml
Expand Up @@ -32,6 +32,7 @@
<argument>
puts 'hello world'
puts 'openssl loaded' if require 'openssl'
puts 'krypt loaded' if require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby-noasm/src/it/helloworld/verify.bsh
Expand Up @@ -13,7 +13,7 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "ffi,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
Expand Down
15 changes: 12 additions & 3 deletions maven/jruby/pom.rb
Expand Up @@ -35,16 +35,25 @@
plugin( :invoker )

execute 'setup other osgi frameworks', :phase => 'pre-integration-test' do |ctx|
felix = File.join( ctx.basedir.to_pathname, 'src', 'it', 'osgi_all_inclusive' )
[ 'equinox-3.6', 'equinox-3.7', 'felix-3.2'].each do |m|
source = File.join( ctx.basedir.to_pathname, 'src', 'templates', 'osgi_all_inclusive' )
[ 'equinox-3.6', 'equinox-3.7', 'felix-3.2', 'felix-4.4'].each do |m|
target = File.join( ctx.basedir.to_pathname, 'src', 'it', 'osgi_all_inclusive_' + m )
FileUtils.cp_r( felix, target )
FileUtils.cp_r( source, target )
File.open( File.join( target, 'invoker.properties' ), 'w' ) do |f|
f.puts 'invoker.profiles = ' + m
end
end
end

plugin( :clean ) do
execute_goals( :clean,
:phase => :clean,
:id => 'clean-extra-osgi-ITs',
:filesets => [ { :directory => '${basedir}/src/it',
:includes => ['osgi*/**'] } ],
:failOnError => false )
end

profile :id => :jdk8 do
activation do
jdk '1.8'
Expand Down
23 changes: 23 additions & 0 deletions maven/jruby/pom.xml
Expand Up @@ -56,6 +56,29 @@
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>clean-extra-osgi-ITs</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/src/it</directory>
<includes>
<include>osgi*/**</include>
</includes>
</fileset>
</filesets>
<failOnError>false</failOnError>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.tesla.polyglot</groupId>
<artifactId>tesla-polyglot-maven-plugin</artifactId>
Expand Down
1 change: 1 addition & 0 deletions maven/jruby/src/it/helloworld/pom.xml
Expand Up @@ -32,6 +32,7 @@
<argument>
puts 'hello world'
puts 'openssl loaded' if require 'openssl'
puts 'krypt loaded' if require 'krypt'
puts Gem.loaded_specs.keys.sort.join(',')
</argument>
</arguments>
Expand Down
2 changes: 1 addition & 1 deletion maven/jruby/src/it/helloworld/verify.bsh
Expand Up @@ -13,7 +13,7 @@ if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
}
expected = "ffi,jar-dependencies,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
expected = "ffi,jruby-openssl,krypt,krypt-core,krypt-provider-jdk";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
Expand Down
Expand Up @@ -96,13 +96,13 @@ public void testJRubyCreate() throws InterruptedException {
assertEquals( gemPath, "[\"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\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\"]");

// 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\", \"jar-dependencies\", \"ffi\", \"krypt-provider-jdk\", \"krypt-core\", \"krypt\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
assertEquals(list, "[\"rake\", \"jruby-openssl\", \"thread_safe\", \"descendants_tracker\", \"equalizer\", \"coercible\", \"ice_nine\", \"axiom-types\", \"virtus\"]");
}
}
4 changes: 4 additions & 0 deletions pom.xml
Expand Up @@ -346,6 +346,9 @@
<configuration>
<settingsFile>${basedir}/src/it/settings.xml</settingsFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<properties>
<project.version>${project.version}</project.version>
</properties>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
Expand All @@ -354,6 +357,7 @@
<preBuildHookScript>setup.bsh</preBuildHookScript>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<streamLogs>true</streamLogs>
<goals><goal>install</goal></goals>
</configuration>
</plugin>

Expand Down

0 comments on commit b1df10c

Please sign in to comment.