summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-04-23 11:07:50 +0200
committerChristoph Helma <helma@in-silico.ch>2012-04-23 11:07:50 +0200
commitac8fd2a51e662f5e75d53a9aab98c5f5df02c926 (patch)
treed06738e8334e8783fa8bac69fad8dcc5b6e532e6
parent1850ffbc061a4ef92e759b96802d1769cb5d03c6 (diff)
parent1fa53ac290b5314ba21b9004b517a89bad0e9366 (diff)
Merge branch 'development' of github.com:opentox/opentox-test into development
-rw-r--r--test/rdf_check.rb70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/rdf_check.rb b/test/rdf_check.rb
new file mode 100644
index 0000000..82e1554
--- /dev/null
+++ b/test/rdf_check.rb
@@ -0,0 +1,70 @@
+require File.join(File.expand_path(File.dirname(__FILE__)),"setup.rb")
+
+class UploadTest < Test::Unit::TestCase
+
+ def setup
+ end
+
+ def teardown
+ end
+
+ def test_01_query_sparqle_rdf_BII_I_1
+ id = OpenTox::Authorization.authenticate($aa[:user],$aa[:password])
+ #test_all
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/`.chomp
+ assert_match /[https\:\/\/toxbanktest2, https\:\/\/toxbank\-dev]/, response
+ #test_id_query_sparqle
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
+ assert_match /[title, Manchester, givenname, Castrillo]/, response
+ #test_resource_ISA
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/ISA_3981`.chomp
+ assert_match /[givenname, Castrillo, family\_name, Juan]/, response
+ #test_metadata_query_sparqle
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/metadata`.chomp
+ assert_match /[I2225, BII\-I\-1, S2223, S2224, Growth, Background]/, response
+ #test_resource_Investigation
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/I2225`.chomp
+ assert_match /[BII\-I\-1, title, Growth, abstract, Background]/, response
+ #test_resource_Study
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/S2223`.chomp
+ assert_match /[hasAssay, A1269, hasProtocol, P\_2202, description, Comprehensive, title, rapamycin, Rapamycin, Affymetrix]/, response
+ #test_resource_Assay
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/A1269`.chomp
+ #TODO fix Assay content
+ assert_match /Assay/, response
+ #test_resource_Protocol
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0/P_2202`.chomp
+ assert_match /[mRNA, extraction]/, response
+ end
+ def test_02_query_sparqle_rdf_E_MTAB
+ id = OpenTox::Authorization.authenticate($aa[:user],$aa[:password])
+ #test_all
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/`.chomp
+ assert_match /[https\:\/\/toxbanktest2, https\:\/\/toxbank\-dev]/, response
+ #test_id_query_sparqle
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
+ #TODO fix givenname
+ assert_match /[title, EMBL\-EBI, hasStudy, S2008, hasMember, ISA_60553]/, response
+ #test_resource_ISA
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/ISA_60553`.chomp
+ assert_match /[givenname, Ruth, family\_name, Akhtar]/, response
+ #test_metadata_query_sparqle
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/metadata`.chomp
+ assert_match /[I2]/, response
+ #test_resource_Investigation
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/I2`.chomp
+ #TODO assert_match /[title, abstract]/, response
+ assert_match /[S2008]/, response
+ #test_resource_Study
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/S2008`.chomp
+ assert_match /[TG\-GATEs]/, response
+ assert_match /[hasAssay, A1838, hasProtocol, P_2010]/, response
+ #test_resource_Assay
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/A1838`.chomp
+ #TODO fix Assay content
+ assert_match /Assay/, response
+ #test_resource_Protocol
+ response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2/P_2010`.chomp
+ assert_match /[label, P\-MTAB\-23090]/, response
+ end
+end