summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/test/store-script/fruits-catalog.scm
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/test/store-script/fruits-catalog.scm')
-rw-r--r--sca-cpp/trunk/test/store-script/fruits-catalog.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/sca-cpp/trunk/test/store-script/fruits-catalog.scm b/sca-cpp/trunk/test/store-script/fruits-catalog.scm
new file mode 100644
index 0000000000..390068d71a
--- /dev/null
+++ b/sca-cpp/trunk/test/store-script/fruits-catalog.scm
@@ -0,0 +1,19 @@
+; Catalog implementation
+
+(define (get converter)
+ (display "catalog")
+ (define (convert price) (converter "convert" "USD" "USD" price))
+
+ (define code "USD")
+ (define symbol (converter "symbol" code))
+
+ (list
+ (list (list 'javaClass "services.Item") (list 'name "Apple") (list 'currencyCode code) (list 'currencySymbol symbol) (list 'price (convert 2.99)))
+ (list (list 'javaClass "services.Item") (list 'name "Orange") (list 'currencyCode code) (list 'currencySymbol symbol) (list 'price (convert 3.55)))
+ (list (list 'javaClass "services.Item") (list 'name "Pear") (list 'currencyCode code) (list 'currencySymbol symbol) (list 'price (convert 1.55)))
+ )
+)
+
+; TODO remove these JSON-RPC specific functions
+(define (system.listMethods converter) (list "Service.get"))
+(define Service.get get)