Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:gxbe/torquespec into gxbe-master

  • Loading branch information...
commit 63a8322094b72a1722cbaeeb44bc24dee0d3f2dd 2 parents 75e42e7 + 4f32113
@jcrossley3 jcrossley3 authored
View
1  README.org
@@ -206,6 +206,7 @@
| ~jvm_args~ | Arguments to the JVM running JBoss | /see below/ |
| ~drb_port~ | The in-container spec runner listens on this port for requests | 7772 |
| ~lazy~ | Whether to use a running JBoss and leave it running when done | false |
+ | ~default_deploy~ | Where inside of ~knob_root~ to check for an optional default deployment descriptor | default_deploy.yml |
By default, TorqueSpec is initialized thusly:
View
26 lib/rspec/core/torquespec-extensions.rb
@@ -38,22 +38,36 @@ def deploy(*descriptors)
require 'torquespec/server'
+ default_desc = nil
+ if dpath = File.join(TorqueSpec.knob_root, TorqueSpec.default_deploy)
+ if File.exist?(dpath)
+ default_desc = TorqueSpec::DeploymentDescriptor.new(File.open(dpath).read, "default_deploy", false).path
+ end
+ end
+
TorqueSpec::Configurator.configure do |config|
config.before(:suite) do
Thread.current[:app_server] = TorqueSpec::Server.new
Thread.current[:app_server].start(:wait => 120)
+ Thread.current[:app_server].deploy(default_desc) if default_desc
end
config.before(:all) do
- self.class.deploy_paths.each do |path|
- Thread.current[:app_server].deploy(path)
- end if self.class.respond_to?( :deploy_paths )
+ if self.class.respond_to?( :deploy_paths )
+ Thread.current[:app_server].undeploy(default_desc) if default_desc && self.class.deploy_paths.size > 0
+ self.class.deploy_paths.each do |path|
+ Thread.current[:app_server].deploy(path)
+ end
+ end
end
config.after(:all) do
- self.class.deploy_paths.each do |path|
- Thread.current[:app_server].undeploy(path)
- end if self.class.respond_to?( :deploy_paths )
+ if self.class.respond_to?( :deploy_paths )
+ self.class.deploy_paths.each do |path|
+ Thread.current[:app_server].undeploy(path)
+ end
+ Thread.current[:app_server].deploy(default_desc) if default_desc && self.class.deploy_paths.size > 0
+ end
end
config.after(:suite) do
View
3  lib/torquespec/torquespec.rb
@@ -34,7 +34,7 @@ def deploy(*descriptors, &block)
end
class << self
- attr_accessor :knob_root, :jboss_home, :jvm_args, :max_heap, :lazy, :drb_port, :spec_dir, :domain_mode, :verbose
+ attr_accessor :knob_root, :jboss_home, :jvm_args, :max_heap, :lazy, :drb_port, :spec_dir, :domain_mode, :verbose, :default_deploy
def configure
yield self
end
@@ -108,6 +108,7 @@ def self.local
TorqueSpec.configure do |config|
config.drb_port = 7772
config.knob_root = ".torquespec"
+ config.default_deploy = 'default_deploy.yml'
config.domain_mode = %w(yes true 1).include?(java.lang.System.getProperty('domain.mode') || ENV['DOMAIN_MODE'])
config.jvm_args = "-Xms64m -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -Djruby.home=#{config.jruby_home}"
config.verbose = true
Please sign in to comment.
Something went wrong with that request. Please try again.