Convenience tasks and classes for automated testing of hydra heads.
Latest commit 862bb29 Jan 3, 2017 @cbeer cbeer committed on GitHub Merge pull request #64 from barmintor/stdlogger
do not require the logger gem
Failed to load latest commit information.
config Fixing tests to use new jetty Mar 8, 2013
gemfiles Update to rspec 3 Feb 7, 2015
lib Revert "Allow for OpenJDK rather than just Oracle Java" Oct 18, 2016
spec Check for java version using rubygems-style dependency matching Mar 14, 2015
tasks Use childprocess gem. Added java_opts parameter which allows us to pa… Sep 29, 2011
.gitignore Fixing tests to use new jetty Mar 8, 2013
.rspec Allow setting paths to downloads other than the hard-coded default Mar 15, 2013
.travis.yml Stop spamming IRC with Travis builds Oct 27, 2016 Updating as per Hydra v6.0.0 Sep 19, 2013
Gemfile Update simplecov now that we require ruby 1.9+ Mar 14, 2015
History.txt Bump version to 2.0.0 and update changelog Jan 16, 2015
LICENSE Adding license, fixes #28 Aug 29, 2014 Add end-of-life message to readme Apr 28, 2016
Rakefile Update simplecov now that we require ruby 1.9+ Mar 14, 2015
jettywrapper.gemspec do not require the logger gem Jan 3, 2017

Jettywrapper Version Build Status

NOTICE: Because of changes introduced in Solr 5, we can no longer update jettywrapper to use modern versions of Solr. Therefore we discourage you from using jettywrapper in new projects. No further development is anticipated for jettywrapper. Consider using solr_wrapper and fcrepo_wrapper instead.

This gem is designed to make it easier to integrate a jetty servlet container into a project with web service dependencies. This can be especially useful for developing and testing projects requiring, for example, a Solr and/or a Fedora server.

Jettywrapper provides rake tasks for starting and stopping jetty, as well as the method Jettywrapper.wrap that will start the server before the block and stop the server after the block, which is useful for automated testing.

Jettywrapper can be configured to work with any Jetty-based zip file, such as blacklight-jetty (Solr only) or hydra-jetty (Solr + Fedora). Jettywrapper uses hydra-jetty by default.


  1. ruby -- Jettywrapper supports the ruby versions in its .travis.yml file.
  2. bundler -- this ruby gem must be installed.
  3. java -- Jetty is a java based servlet container; the version of java required depends on the version of jetty you are using (in the jetty-based zip file).


Generally, you will only use a jetty instance for your project's web service dependencies during development and testing, not for production. So you would add this to your Gemfile:

group :development, :test do
  gem 'jettywrapper'

Or, if your project is a gem, you would add this to your .gemspec file: do |s|
  s.add_development_dependency 'jettywrapper'

Then execute:

$ bundle

Or install it yourself as:

$ gem install jettywrapper



See Configuring jettywrapper.

If you don't need both Solr and Fedora, we recommend you avoid the default hydra-jetty. If you only need Solr, use blacklight-jetty.


  • Jetty may take a while to spin up
  • Jetty may not shut down cleanly

See Using jettywrapper for more information and what to do.

Example Rake Task

See Using jettywrapper for more information.

require 'jettywrapper'

desc 'run the tests for continuous integration'
task ci: ['jetty:clean', 'myproj:configure_jetty'] do
  ENV['environment'] = 'test'
  jetty_params = Jettywrapper.load_config
  jetty_params[:startup_wait] = 60

  error = nil
  error = Jettywrapper.wrap(jetty_params) do
    # run the tests
  raise "test failures: #{error}" if error


See to help us make this project better.