diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-11-19 17:31:27 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-11-19 17:31:27 +0100 |
commit | 2824a2fdb2aa308ad77ead17ee6c7cba9c69ab46 (patch) | |
tree | 807aa180a7edd24c044bb8f651adeb72e8e37d13 /algorithm.rb | |
parent | 533e1b918a80d23af78a886442d4c82d853f829f (diff) |
Initial sketch of unit tests, cucumber tests are obsolete
Diffstat (limited to 'algorithm.rb')
-rw-r--r-- | algorithm.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/algorithm.rb b/algorithm.rb new file mode 100644 index 0000000..a3eaa91 --- /dev/null +++ b/algorithm.rb @@ -0,0 +1,44 @@ +require 'rubygems' +require 'opentox-ruby-api-wrapper' +require 'test/unit' +require "./validate-owl.rb" + +class AlgorithmTest < Test::Unit::TestCase + + def setup + @algorithms = [ + "http://localhost/algorithm/fminer/bbrc", + "http://localhost/algorithm/fminer/last", + "http://localhost/algorithm/lazar", + #"http://apps.ideaconsult.net:8080/ambit2/algorithm/J48", + ] + end + + def teardown + end + +=begin + def test_metadata + @algorithms.each do |algorithm| + puts algorithm + validate_owl(algorithm) + end + end +=end + + def test_run_external + { + #"http://opentox.informatik.tu-muenchen.de:8080/OpenTox-dev/algorithm/J48" => {:dataset_uri => "http://apps.ideaconsult.net:8080/ambit2/dataset/10", :prediction_feature => "http://apps.ideaconsult.net:8080/ambit2/feature/21595"}, + #"http://apps.ideaconsult.net:8080/ambit2/algorithm/toxtreeskinirritation" => {:dataset_uri => "http://apps.ideaconsult.net:8080/ambit2/dataset/2698" }, # TASK redirects to model + "http://opentox.informatik.tu-muenchen.de:8080/OpenTox-dev/algorithm/CDKPhysChem" => {:dataset_uri => "http://apps.ideaconsult.net:8080/ambit2/dataset/2698" }, + #"http://apps.ideaconsult.net:8080/ambit2/algorithm/org.openscience.cdk.qsar.descriptors.molecular.ALOGPDescriptor" => {:dataset_uri => "http://apps.ideaconsult.net:8080/ambit2/dataset/2698" } + #"http://opentox.ntua.gr:3000/algorithm/svm" + }.each do |uri,params| + algorithm = OpenTox::Algorithm::Generic.new uri + dataset_uri = algorithm.run(params) + dataset = OpenTox::Dataset.find dataset_uri + puts dataset.to_yaml + end + end + +end |