summaryrefslogtreecommitdiff
path: root/Rakefile
blob: 9d6afff3ca2558f87ab4d67d5df4ec21a94eafb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require 'rubygems'
require 'opentox-ruby'

=begin
=end
class Exception

  def message
    unless errorCause == nil
      errorCause.to_yaml
    else
      self.to_s
    end
  end

end

#if File.exists? "auth.rb"
  #require "auth"
#else
  #exit "Please create an authenticatio
    TEST_USER = "guest"
    TEST_PW   = "guest"
#end

task ARGV[0] do
  puts "Environment: #{ENV["RACK_ENV"]}"
  puts "Test: "+ARGV[0]+".rb"
  require "./"+ARGV[0]+".rb"
end

task :setup do
  @@subjectid = OpenTox::Authorization.authenticate(TEST_USER,TEST_PW) 
  @@classification_training_dataset = OpenTox::Dataset.create_from_csv_file("data/hamster_carcinogenicity.csv", @@subjectid)
  @@regression_training_dataset = OpenTox::Dataset.create_from_csv_file("data/EPAFHM.csv", @@subjectid)
end

task :teardown do
  @@classification_training_dataset.delete(@@subjectid)
  @@regression_training_dataset.delete(@@subjectid)
  OpenTox::Authorization.logout(@@subjectid)
end

[:all, :feature, :dataset, :fminer, :lazar, :authorization, :validation].each do |t|
#[:all, :feature, :dataset, :fminer, :lazar, :authorization].each do |t|
  task :teardown => t
  task t => :setup 
end