summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/test
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-05 10:09:07 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-05 10:09:07 +0000
commitaa27694514363589150efe13249ce9ea39694d63 (patch)
treea9904200905b29c25174171926ce6f03a1a5e32e /sca-cpp/trunk/test
parentd9cb40f1b526f739002137e1f1a08b2d8ae0d718 (diff)
Fixed shopping cart delete function. Map HTTP delete with no path info to a deleteall function, to distinguish delete of a resource and delete of the whole collection of resources.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@895970 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/test')
-rw-r--r--sca-cpp/trunk/test/store-script/shopping-cart.scm9
-rw-r--r--sca-cpp/trunk/test/store-script/store-script-test.cpp6
-rw-r--r--sca-cpp/trunk/test/store-script/store-script-test.scm (renamed from sca-cpp/trunk/test/store-script/store-script.scm)0
-rw-r--r--sca-cpp/trunk/test/store-script/store.scm4
4 files changed, 14 insertions, 5 deletions
diff --git a/sca-cpp/trunk/test/store-script/shopping-cart.scm b/sca-cpp/trunk/test/store-script/shopping-cart.scm
index b7672345d7..60981411c7 100644
--- a/sca-cpp/trunk/test/store-script/shopping-cart.scm
+++ b/sca-cpp/trunk/test/store-script/shopping-cart.scm
@@ -39,11 +39,16 @@
(find id (getcart cartId cache))
)
-; Delete the cart
-(define (delete id cache)
+; Delete the whole cart
+(define (deleteall cache)
(cache "delete" cartId)
)
+; Delete an item from the cart
+(define (delete id cache)
+ true
+)
+
; Return the price of an item
(define (price item)
(cadr (assoc 'price (caddr item)))
diff --git a/sca-cpp/trunk/test/store-script/store-script-test.cpp b/sca-cpp/trunk/test/store-script/store-script-test.cpp
index 05aefcaf8c..33b87037f1 100644
--- a/sca-cpp/trunk/test/store-script/store-script-test.cpp
+++ b/sca-cpp/trunk/test/store-script/store-script-test.cpp
@@ -39,7 +39,7 @@ using namespace tuscany;
bool testScript() {
gc_scoped_pool pool;
- ifstream is("store-script.scm");
+ ifstream is("store-script-test.scm");
ostringstream os;
scheme::evalDriverRun(is, os, pool);
assert(contains(str(os), "(\"Sample Feed\" \""));
@@ -52,7 +52,7 @@ bool testScript() {
bool testEval() {
{
gc_scoped_pool pool;
- ifstream is("store-script.scm");
+ ifstream is("store-script-test.scm");
ostringstream os;
scheme::setupDisplay(os);
scheme::Env globalEnv = scheme::setupEnvironment(pool);
@@ -66,7 +66,7 @@ bool testEval() {
{
gc_scoped_pool pool;
- ifstream is("store-script.scm");
+ ifstream is("store-script-test.scm");
ostringstream os;
scheme::setupDisplay(os);
diff --git a/sca-cpp/trunk/test/store-script/store-script.scm b/sca-cpp/trunk/test/store-script/store-script-test.scm
index 30c10d8184..30c10d8184 100644
--- a/sca-cpp/trunk/test/store-script/store-script.scm
+++ b/sca-cpp/trunk/test/store-script/store-script-test.scm
diff --git a/sca-cpp/trunk/test/store-script/store.scm b/sca-cpp/trunk/test/store-script/store.scm
index 01f72d0bea..e325a65d74 100644
--- a/sca-cpp/trunk/test/store-script/store.scm
+++ b/sca-cpp/trunk/test/store-script/store.scm
@@ -20,6 +20,10 @@
(shoppingCart "gettotal")
)
+(define (deleteall catalog shoppingCart shoppingTotal)
+ (shoppingCart "deleteall")
+)
+
(define (delete id catalog shoppingCart shoppingTotal)
(shoppingCart "delete" id)
)