summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2010-01-09 18:22:00 +0100
committerChristoph Helma <helma@in-silico.de>2010-01-09 18:22:00 +0100
commit68d5f59aced70107a7c31d9e802e08d638c69734 (patch)
treefe3ad1227b73b76c46b8b7ec0de2819205f51df1
parentb6ec88dd16ae5bab0b015f886cf2488cb16027e0 (diff)
tasks added
-rw-r--r--features/fminer.feature3
-rw-r--r--features/lazar_single_prediction.feature3
-rw-r--r--features/step_definitions/common_steps.rb7
-rw-r--r--features/step_definitions/fminer_step.rb3
-rw-r--r--features/step_definitions/lazar_steps.rb2
-rw-r--r--features/step_definitions/task_steps.rb8
-rw-r--r--features/task_complete.feature5
-rw-r--r--features/task_create.feature5
8 files changed, 24 insertions, 12 deletions
diff --git a/features/fminer.feature b/features/fminer.feature
index 791e509..c1db022 100644
--- a/features/fminer.feature
+++ b/features/fminer.feature
@@ -4,7 +4,8 @@ Feature: Fminer
Scenario Outline: Create fminer features
Given Content-Type is application/rdf+xml
And I post <data> to the dataset webservice
- When I apply fminer for <feature>
+ And I apply fminer for <feature>
+ When the task is completed
Then I should receive a valid URI
Examples:
diff --git a/features/lazar_single_prediction.feature b/features/lazar_single_prediction.feature
index d72bea6..93e9841 100644
--- a/features/lazar_single_prediction.feature
+++ b/features/lazar_single_prediction.feature
@@ -7,7 +7,8 @@ Feature: Create a model and predict an unknown compound
Scenario Outline:
Given Content-Type is application/rdf+xml
And I post <data> to the dataset webservice
- When I create a lazar model for <feature>
+ And I create a lazar model for <feature>
+ When the task is completed
Then I should receive a valid URI
And the model should predict <prediction> for <smiles>
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index f5668ee..baddac5 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -14,6 +14,13 @@ When /^I post (.*) to the (.*) webservice$/ do |data,component|
@resources << @uri unless /compound|feature/ =~ component
end
+When /^the task is completed$/ do
+ @task.wait_for_completion
+ @uri = @task.resource
+ #puts @uri
+ @resources << @uri
+end
+
Then /^I should receive a valid URI$/ do
#puts @uri
@response = RestClient.get @uri, :accept => '*/*'
diff --git a/features/step_definitions/fminer_step.rb b/features/step_definitions/fminer_step.rb
index 26588de..5421e33 100644
--- a/features/step_definitions/fminer_step.rb
+++ b/features/step_definitions/fminer_step.rb
@@ -1,6 +1,7 @@
When /^I apply fminer for (.*)$/ do |feature_uri|
dataset_uri = @uri
@uri = RestClient.post File.join(@@config[:services]["opentox-algorithm"], "fminer"), :dataset_uri => dataset_uri, :feature_uri => feature_uri
- #puts @uri
+ @task = OpenTox::Task.find(@uri)
@resources << @uri
+ #puts @uri
end
diff --git a/features/step_definitions/lazar_steps.rb b/features/step_definitions/lazar_steps.rb
index 9ba5842..7ad2ebc 100644
--- a/features/step_definitions/lazar_steps.rb
+++ b/features/step_definitions/lazar_steps.rb
@@ -1,6 +1,8 @@
When /^I create a lazar model for (.*)$/ do |feature_uri|
training_uri = @uri
+ #puts `curl #{training_uri}`
@uri = RestClient.post File.join(@@config[:services]["opentox-algorithm"], "lazar"), :dataset_uri => training_uri, :feature_uri => feature_uri, :feature_generation_uri => File.join(@@config[:services]["opentox-algorithm"], "fminer")
+ @task = OpenTox::Task.find(@uri)
@resources << @uri
#puts @uri.to_yaml
end
diff --git a/features/step_definitions/task_steps.rb b/features/step_definitions/task_steps.rb
index a503ece..8e25dfe 100644
--- a/features/step_definitions/task_steps.rb
+++ b/features/step_definitions/task_steps.rb
@@ -1,10 +1,10 @@
-When /^I create a task for a (.*)$/ do |resource_uri|
- @uri = RestClient.post @@config[:services]["opentox-task"], :resource_uri => resource_uri
+When /^I create a task$/ do
+ @uri = RestClient.post @@config[:services]["opentox-task"], nil
@resources << @uri
end
-When /^I finish the task$/ do
- RestClient.put File.join(@uri,"completed"), nil
+When /^I finish the task for (.*)$/ do |resource|
+ RestClient.put File.join(@uri,"completed"), :resource => resource
end
diff --git a/features/task_complete.feature b/features/task_complete.feature
index 961c454..53bf322 100644
--- a/features/task_complete.feature
+++ b/features/task_complete.feature
@@ -2,9 +2,10 @@
Feature: Create and complete a Task
Scenario Outline: Create and complete a task
- Given I create a task for a <resource>
- When I finish the task
+ Given I create a task
+ When I finish the task for <resource>
Then the status should be "completed"
+ And the resource should be <resource>
Examples:
|resource|
diff --git a/features/task_create.feature b/features/task_create.feature
index d817f26..0e591ac 100644
--- a/features/task_create.feature
+++ b/features/task_create.feature
@@ -2,10 +2,9 @@
Feature: Create Task
Scenario Outline: Create a task
- When I create a task for a <resource>
+ When I create a task
Then I should receive a valid URI
- And the status should be "started"
- And the resource should be <resource>
+ And the status should be "created"
Examples:
|resource|