diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-08-11 10:58:59 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-08-11 10:58:59 +0200 |
commit | 566786bdd7e253880b7fe6c00cb40fbc46f771a2 (patch) | |
tree | 69cf68c7b479b8f99b9248d92ae91a4f7f24cd34 /reach_reports/reach_test.rb | |
parent | 148e4eaccf2e406586914150cf2f953fa5f12ece (diff) |
move to wrapper 1.6.2, remove report-dir-check, initial commit of reach reporting stuff
Diffstat (limited to 'reach_reports/reach_test.rb')
-rw-r--r-- | reach_reports/reach_test.rb | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/reach_reports/reach_test.rb b/reach_reports/reach_test.rb new file mode 100644 index 0000000..c96340a --- /dev/null +++ b/reach_reports/reach_test.rb @@ -0,0 +1,62 @@ +require "uri" +require "yaml" +ENV['RACK_ENV'] = 'test' +require 'application.rb' +require 'test/unit' +require 'rack/test' +require 'lib/test_util.rb' +require 'test/test_examples.rb' + +LOGGER = MyLogger.new(STDOUT) +LOGGER.datetime_format = "%Y-%m-%d %H:%M:%S " +LOGGER.formatter = Logger::Formatter.new + + +class ReachTest < Test::Unit::TestCase + include Rack::Test::Methods + include Lib::TestUtil + + + def app + Sinatra::Application + end + + def test_it + #$test_case = self + + post '/reach_report/qmrf',:model_uri=>"http://localhost/model/16" + ##post '/reach_report/qprf',:compound_uri=>"http://localhost/compound/XYZ" + uri = last_response.body + id = uri.split("/")[-1] + puts uri + + #get '/reach_report/qmrf' + #puts last_response.body + + get '/reach_report/qmrf/'+id.to_s,nil,'HTTP_ACCEPT'=>"application/x-yaml" + puts "YAML" + puts last_response.body + +# get '/reach_report/qmrf/'+id.to_s,nil,'HTTP_ACCEPT'=>"application/rdf+xml" +# puts "RDF" +# puts last_response.body + + get '/reach_report/qmrf/'+id,nil,'HTTP_ACCEPT' => "application/qmrf-xml" + puts "XML" + puts last_response.body + + + end +end + + +# query = <<EOF +#PREFIX ot:<http://www.opentox.org/api/1.1#> +#PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> +#select ?model +#where { +#?model rdf:type ot:Model +#} +#EOF +# puts OpenTox::RestClientWrapper.post("http://apps.ideaconsult.net:8080/ontology/",{:accept => "application/rdf+xml", :query => query}) +# exit
\ No newline at end of file |