[ap4r-devel] [285] branches/200709_gihyo/async_shop/as_rails/vendor/plugins/ap4r/tasks/ap4r.rake: add rake tasks to start/stop AP4R and Rails processes

shino at rubyforge.org shino at rubyforge.org
Thu Aug 30 21:03:54 EDT 2007


Revision: 285
Author:   shino
Date:     2007-08-30 21:03:53 -0400 (Thu, 30 Aug 2007)

Log Message:
-----------
add rake tasks to start/stop AP4R and Rails processes

Modified Paths:
--------------
    branches/200709_gihyo/async_shop/as_rails/vendor/plugins/ap4r/tasks/ap4r.rake

Modified: branches/200709_gihyo/async_shop/as_rails/vendor/plugins/ap4r/tasks/ap4r.rake
===================================================================
--- branches/200709_gihyo/async_shop/as_rails/vendor/plugins/ap4r/tasks/ap4r.rake	2007-08-31 01:02:04 UTC (rev 284)
+++ branches/200709_gihyo/async_shop/as_rails/vendor/plugins/ap4r/tasks/ap4r.rake	2007-08-31 01:03:53 UTC (rev 285)
@@ -1,3 +1,5 @@
+require File.expand_path(File.dirname(__FILE__) + "/../lib/ap4r/service_handler.rb")
+
 namespace :test do
 
 #  task :asyncs do
@@ -6,11 +8,21 @@
 #  end
 
   namespace :asyncs do
+
     desc "Start Rails and AP4R servers to test:asyncs:exec"
-    task :setup do |t|
-      puts "setup task should be implemented here"
+    task :arrange do |t|
+      ap4r_handler = Ap4r::ServiceHandler.new
+      ap4r_handler.start_rails_service
+      ap4r_handler.start_ap4r_service
     end
 
+    desc "Start Rails and AP4R servers to test:asyncs:exec"
+    task :cleanup do |t|
+      ap4r_handler = Ap4r::ServiceHandler.new
+      ap4r_handler.stop_ap4r_service
+      ap4r_handler.stop_rails_service
+    end
+
     Rake::TestTask.new(:run => "db:test:prepare") do |t|
       t.libs << "test"
       t.pattern = 'test/async/**/*_test.rb'




More information about the ap4r-devel mailing list