summaryrefslogtreecommitdiffstats
path: root/cpp/sca/test/store-script/shopping-cart.scm
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-11-16 06:01:41 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-11-16 06:01:41 +0000
commit51a97b5d9350b37f95d6f0c00d013b886e64fcd3 (patch)
tree480092faac7c7deb40265fb070d1b4b059638814 /cpp/sca/test/store-script/shopping-cart.scm
parentada8802640aa232d34b1fe2793b9f52cd62b41f1 (diff)
Added test cases and scripts to test the HTTP binding support. Refactored httpd module and added a wiring httpd module. Implementation of the store demo prepared for ApacheCon.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@880601 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/sca/test/store-script/shopping-cart.scm')
-rw-r--r--cpp/sca/test/store-script/shopping-cart.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/cpp/sca/test/store-script/shopping-cart.scm b/cpp/sca/test/store-script/shopping-cart.scm
new file mode 100644
index 0000000000..ebb3504e25
--- /dev/null
+++ b/cpp/sca/test/store-script/shopping-cart.scm
@@ -0,0 +1,26 @@
+; Shopping cart implementation
+
+(define (post item)
+ (uuid)
+)
+
+(define (getall)
+ (cons "Sample Feed" (cons (uuid) '()))
+)
+
+(define (get id)
+ (define entry (list (list 'name "Apple") (list 'currencyCode "USD") (list 'currencySymbol "$") (list 'price 2.99)))
+ (cons "Item" (list id entry))
+)
+
+(define (delete id)
+ true
+)
+
+(define (gettotal)
+ 11.0
+)
+
+; TODO remove these JSON-RPC specific functions
+(define (system.listMethods) (list "Service.getTotal"))
+(define Service.getTotal gettotal)