diff options
author | gebele <gebele@in-silico.ch> | 2012-04-02 18:06:15 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2012-04-02 18:06:15 +0200 |
commit | 9d67e1c80b8854f45032c46aa8c21c8e3a236e54 (patch) | |
tree | 75eb99ba63b48422eda06826bb880d139c654ac2 | |
parent | 6de3dff6249e80ac1303d1dab69a29475dde6e1d (diff) |
test with changed graph
-rw-r--r-- | test/store_query.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/store_query.rb b/test/store_query.rb index f0b5b35..2ba3665 100644 --- a/test/store_query.rb +++ b/test/store_query.rb @@ -1,6 +1,8 @@ require File.join(File.expand_path(File.dirname(__FILE__)),"setup.rb") class UploadTest < Test::Unit::TestCase + + URI = "https://localhost/BII-I-1.n3" def setup end @@ -17,10 +19,10 @@ class UploadTest < Test::Unit::TestCase def test_02_add_data # upload invalid data - response = `curl -0 -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -T '#{File.join File.dirname(__FILE__),"data/toxbank-investigation/invalid/BII-invalid.n3"}' '#{$four_store[:uri]}/data/?graph=#{$four_store[:uri]}/data/#{$four_store[:user]}/BII-I-1.n3'`.chomp + response = `curl -0 -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -T '#{File.join File.dirname(__FILE__),"data/toxbank-investigation/invalid/BII-invalid.n3"}' -H 'Content-type:text/turtle' '#{$four_store[:uri]}/data/?graph=#{URI}'`.chomp assert_match /400/, response # upload valid data - response = `curl -0 -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -T '#{File.join File.dirname(__FILE__),"data/toxbank-investigation/valid/BII-I-1.n3"}' '#{$four_store[:uri]}/data/?graph=#{$four_store[:uri]}/data/#{$four_store[:user]}/BII-I-1.n3'`.chomp + response = `curl -0 -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -T '#{File.join File.dirname(__FILE__),"data/toxbank-investigation/valid/BII-I-1.n3"}' -H 'Content-type:text/turtle' '#{$four_store[:uri]}/data/?graph=#{URI}'`.chomp assert_match /201/, response end @@ -37,7 +39,7 @@ class UploadTest < Test::Unit::TestCase def test_04_query_sparqle response = `curl -i -k -u #{$four_store[:user]}:#{$four_store[:password]} '#{$four_store[:uri]}/sparql/'`.chomp assert_match /500/, response - response = `curl -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -H 'Accept:application/sparql-results+xml' -d "query=CONSTRUCT { ?s ?p ?o } FROM <#{$four_store[:uri]}/data/#{$four_store[:user]}/BII-I-1.n3> WHERE {?s ?p ?o} LIMIT 10" '#{$four_store[:uri]}/sparql/'`.chomp + response = `curl -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -H 'Accept:application/rdf+xml' -d "query=CONSTRUCT { ?s ?p ?o } FROM <#{URI}> WHERE {?s ?p ?o} LIMIT 10" '#{$four_store[:uri]}/sparql/'`.chomp assert_match /200/, response assert_match /rdf\:RDF/, response assert_match /rdf\:Description/, response @@ -46,7 +48,7 @@ class UploadTest < Test::Unit::TestCase def test_05_delete_data #response = `curl -i -k -u #{FOUR_STORE_USER}:#{FOUR_STORE_PASS} -X DELETE '#{FOUR_STORE}/data/?graph=#{FOUR_STORE}/data/#{FOUR_STORE_USER}/BII-I-1.n3'`.chomp - response = `curl -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -X DELETE '#{$four_store[:uri]}/data/?graph=#{$four_store[:uri]}/data/#{$four_store[:user]}/BII-I-1.n3'`.chomp + response = `curl -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -X DELETE '#{$four_store[:uri]}/data/?graph=#{URI}'`.chomp assert_match /200/, response end =begin @@ -54,7 +56,7 @@ class UploadTest < Test::Unit::TestCase threads = [] 5.times do |t| threads << Thread.new(t) do |up| - #puts "Start Time >> " << (Time.now).to_s + puts "Start Time >> " << (Time.now).to_s response = `curl -0 -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -T '#{File.join File.dirname(__FILE__),"data/toxbank-investigation/valid/BII-I-1.n3"}' '#{$four_store[:uri]}/data/?graph=#{$four_store[:user]}/test#{t}.n3'`.chomp assert_match /201/, response end @@ -66,7 +68,7 @@ class UploadTest < Test::Unit::TestCase threads = [] 5.times do |t| threads << Thread.new(t) do |up| - #puts "Start Time >> " << (Time.now).to_s + puts "Start Time >> " << (Time.now).to_s response = `curl -i -k -u #{$four_store[:user]}:#{$four_store[:password]} -X DELETE '#{$four_store[:uri]}/data/#{$four_store[:user]}/test#{t}.n3'`.chomp assert_match /200/, response end |