jettywrapper 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -6,23 +6,28 @@ h2. Instructions for the impatient:
6
6
 
7
7
  bc..
8
8
  require 'jettywrapper'
9
- desc "New way of running tests"
10
- task :newtest do
11
- Rake::Task["rake:db:test:clone_structure"].invoke
12
- Rake::Task["rake:hydra:jetty:config_fedora"].invoke
13
- Rake::Task["rake:hydra:jetty:config"].invoke
14
- jetty_params = {
15
- :jetty_home => "/usr/local/projects/hydra-hydrus/jetty",
16
- :quiet => false,
17
- :jetty_port => 8983,
18
- :solr_home => "/usr/local/projects/hydra-hydrus/jetty/solr/test-core",
19
- :startup_wait => 30
20
- }
21
- error = Jettywrapper.wrap(jetty_params) do
22
- # Rake::Task["libra_oa:default_fixtures:refresh"].invoke
23
- Rake::Task["rake:hydra:default_fixtures:load"].invoke
24
- Rake::Task["rake:spec"].invoke
25
- Rake::Task["rake:cucumber"].invoke
26
- end
27
- raise "test failures: #{error}" if error
9
+ desc "Hudson build"
10
+ task :hudson do
11
+ if (ENV['RAILS_ENV'] == "test")
12
+ jetty_params = {
13
+ :jetty_home => File.expand_path(File.dirname(__FILE__) + '/../../jetty'),
14
+ :quiet => false,
15
+ :jetty_port => 8983,
16
+ :solr_home => File.expand_path(File.dirname(__FILE__) + '/../../jetty/solr'),
17
+ :fedora_home => File.expand_path(File.dirname(__FILE__) + '/../../jetty/fedora/default'),
18
+ :startup_wait => 30
19
+ }
20
+ Rake::Task["db:drop"].invoke
21
+ Rake::Task["db:migrate"].invoke
22
+ Rake::Task["db:migrate:plugins"].invoke
23
+ error = Jettywrapper.wrap(jetty_params) do
24
+ Rake::Task["libra_oa:default_fixtures:refresh"].invoke
25
+ Rake::Task["hydra:fixtures:refresh"].invoke
26
+ Rake::Task["spec"].invoke
27
+ Rake::Task["cucumber"].invoke
28
+ end
29
+ raise "test failures: #{error}" if error
30
+ else
31
+ system("rake hudson RAILS_ENV=test")
32
+ end
28
33
  end
data/jettywrapper.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Bess Sadler"]
11
11
  s.email = ["bess@stanford.edu"]
12
- s.homepage = ""
12
+ s.homepage = "https://github.com/projecthydra/jettywrapper"
13
13
  s.summary = %q{Convenience tasks for working with jetty from within a ruby project.}
14
14
  s.description = %q{Spin up a jetty instance (e.g., the one at https://github.com/projecthydra/hydra-jetty) and wrap test in it. This lets us run tests against a real copy of solr and fedora.}
15
15
  s.files = `git ls-files`.split("\n")
data/lib/jettywrapper.rb CHANGED
@@ -25,7 +25,7 @@ class Jettywrapper
25
25
  # @param [Symbol] :jetty_port What port should jetty start on? Default is 8888
26
26
  # @param [Symbol] :startup_wait After jetty starts, how long to wait before running tests? If you don't let jetty start all the way before running the tests, they'll fail because they can't reach jetty.
27
27
  # @param [Symbol] :solr_home Where is solr? Default is jetty_home/solr
28
- # @param [Symbol] :fedora_home Where is fedora? Default is jetty_home/fedora
28
+ # @param [Symbol] :fedora_home Where is fedora? Default is jetty_home/fedora/default
29
29
  # @param [Symbol] :quiet Keep quiet about jetty output? Default is true.
30
30
  def configure(params = {})
31
31
  hydra_server = self.instance
@@ -91,12 +91,13 @@ class Jettywrapper
91
91
 
92
92
  # What command is being run to invoke jetty?
93
93
  def jetty_command
94
- "java -Djetty.port=#{@port} -Dsolr.solr.home=#{@solr_home} -jar start.jar"
94
+ "java -Djetty.port=#{@port} -Dsolr.solr.home=#{@solr_home} -Dfedora.home=#{@fedora_home} -jar start.jar"
95
95
  end
96
96
 
97
97
  def start
98
98
  puts "jetty_home: #{@jetty_home}"
99
99
  puts "solr_home: #{@solr_home}"
100
+ puts "fedora_home: #{@fedora_home}"
100
101
  puts "jetty_command: #{jetty_command}"
101
102
  platform_specific_start
102
103
  end
@@ -1 +1 @@
1
- GEMVERSION = "0.0.2"
1
+ GEMVERSION = "0.0.3"
@@ -54,6 +54,16 @@ module Hydra
54
54
  ts.fedora_home.should == File.join(ts.jetty_home, "fedora","default")
55
55
  ts.startup_wait.should == 5
56
56
  end
57
+
58
+ it "passes all the expected values to jetty during startup" do
59
+ ts = Jettywrapper.configure(@jetty_params)
60
+ command = ts.jetty_command
61
+ command.should include("-Dfedora.home=#{@jetty_params[:fedora_home]}")
62
+ command.should include("-Dsolr.solr.home=#{@jetty_params[:solr_home]}")
63
+ command.should include("-Djetty.port=#{@jetty_params[:jetty_port]}")
64
+
65
+ end
66
+
57
67
  end # end of instantiation context
58
68
 
59
69
  context "wrapping a task" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jettywrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bess Sadler
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-13 00:00:00 -07:00
18
+ date: 2011-04-21 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -200,7 +200,7 @@ files:
200
200
  - spec/lib/jettywrapper_spec.rb
201
201
  - spec/spec_helper.rb
202
202
  has_rdoc: true
203
- homepage: ""
203
+ homepage: https://github.com/projecthydra/jettywrapper
204
204
  licenses: []
205
205
 
206
206
  post_install_message: