summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/test/store-function
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-12-26 03:25:16 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-12-26 03:25:16 +0000
commitf453584ae0a3ec04f1781fc35b7abe5d139c6679 (patch)
tree6724b533ec950e6dbdd4a6dcd6fafe665aec11e1 /sca-cpp/trunk/test/store-function
parent6f0a80fbc621b205f4e1e222a453087006cce668 (diff)
Added timing functions to measure performance, removed unused cache support, refactored and removed some obsolete tests and adjusted build.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@893937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/test/store-function/Makefile.am28
-rw-r--r--sca-cpp/trunk/test/store-function/cart.hpp69
-rw-r--r--sca-cpp/trunk/test/store-function/catalog.hpp54
-rw-r--r--sca-cpp/trunk/test/store-function/catalogs.composite43
-rw-r--r--sca-cpp/trunk/test/store-function/currency-composite.hpp37
-rw-r--r--sca-cpp/trunk/test/store-function/currency.composite32
-rw-r--r--sca-cpp/trunk/test/store-function/currency.hpp59
-rw-r--r--sca-cpp/trunk/test/store-function/item.hpp54
-rw-r--r--sca-cpp/trunk/test/store-function/service.hpp35
-rw-r--r--sca-cpp/trunk/test/store-function/store-composite.hpp47
-rw-r--r--sca-cpp/trunk/test/store-function/store-function-test.cpp50
-rw-r--r--sca-cpp/trunk/test/store-function/store-solution.hpp41
-rw-r--r--sca-cpp/trunk/test/store-function/store-ui.hpp64
-rw-r--r--sca-cpp/trunk/test/store-function/store.composite64
14 files changed, 0 insertions, 677 deletions
diff --git a/sca-cpp/trunk/test/store-function/Makefile.am b/sca-cpp/trunk/test/store-function/Makefile.am
deleted file mode 100644
index 7645db2273..0000000000
--- a/sca-cpp/trunk/test/store-function/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-noinst_PROGRAMS = store-function-test
-
-noinst_HEADERS = *.hpp
-
-INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE}
-
-store_function_test_SOURCES = store-function-test.cpp
-store_function_test_LDADD = -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1
-
-TESTS = store-function-test
-
diff --git a/sca-cpp/trunk/test/store-function/cart.hpp b/sca-cpp/trunk/test/store-function/cart.hpp
deleted file mode 100644
index 9ed6474985..0000000000
--- a/sca-cpp/trunk/test/store-function/cart.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_cart_hpp
-#define tuscany_cart_hpp
-
-#include <string>
-#include "service.hpp"
-#include "item.hpp"
-
-namespace store
-{
-
-const double accumTotal(const double total, const ItemType& item) {
- return total + itemPrice(item);
-}
-
-tuscany::list<ItemType> cart;
-
-const tuscany::list<ItemType> shoppingCart_getAll() {
- return cart;
-}
-
-const bool shoppingCart_post(const ItemType& item) {
- cart = cons(item, cart);
- return true;
-}
-
-const bool shoppingCart_deleteAll() {
- cart = tuscany::list<ItemType>();
- return true;
-}
-
-const double shoppingCart_getTotal() {
- return tuscany::reduce<ItemType, double>(accumTotal, 0.0, cart);
-}
-
-const tuscany::value shoppingCart_service(const tuscany::list<tuscany::value>& args) {
- if (car(args) == "getAll")
- return shoppingCart_getAll();
- if (car(args) == "post")
- return shoppingCart_post(cadr(args));
- if (car(args) == "deleteAll")
- return shoppingCart_deleteAll();
- if (car(args) == "getTotal")
- return shoppingCart_getTotal();
- return tuscany::value();
-}
-
-}
-#endif /* tuscany_cart_hpp */
diff --git a/sca-cpp/trunk/test/store-function/catalog.hpp b/sca-cpp/trunk/test/store-function/catalog.hpp
deleted file mode 100644
index c49ebc8fa3..0000000000
--- a/sca-cpp/trunk/test/store-function/catalog.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_catalog_hpp
-#define tuscany_catalog_hpp
-
-#include <string>
-#include "service.hpp"
-#include "currency.hpp"
-#include "item.hpp"
-
-namespace store
-{
-
-std::string catalog_currencyCode = "USD";
-
-double catalog_convert(const service& currencyConverter, const double price) {
- return currencyConverter(tuscany::mklist<tuscany::value>("convert", "USD", catalog_currencyCode, price));
-}
-
-const tuscany::list<ItemType> catalog_get(const service& currencyConverter) {
- const std::string currencySymbol = currencyConverter_service(tuscany::mklist<tuscany::value>("getSymbol", catalog_currencyCode));
- return tuscany::mklist(
- item("Apple", catalog_currencyCode, currencySymbol, catalog_convert(currencyConverter, 2.99)),
- item("Orange", catalog_currencyCode, currencySymbol, catalog_convert(currencyConverter, 3.55)),
- item("Pear", catalog_currencyCode, currencySymbol, catalog_convert(currencyConverter, 1.55)));
-}
-
-const tuscany::value catalog_service(const service& currencyConverter, const tuscany::list<tuscany::value>& args) {
- if (car(args) == "get")
- return catalog_get(currencyConverter);
- return tuscany::value();
-}
-
-}
-#endif /* tuscany_catalog_hpp */
diff --git a/sca-cpp/trunk/test/store-function/catalogs.composite b/sca-cpp/trunk/test/store-function/catalogs.composite
deleted file mode 100644
index 1638ed0a05..0000000000
--- a/sca-cpp/trunk/test/store-function/catalogs.composite
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://services"
- name="catalogs">
-
- <component name="FruitsCatalogWebService">
- <implementation.java class="services.FruitsCatalogImpl"/>
- <service name="Catalog">
- <binding.ws/>
- </service>
- <property name="currencyCode">USD</property>
- <reference name="currencyConverter" target="CurrencyConverterWebService">
- <binding.ws/>
- </reference>
- </component>
-
- <component name="VegetablesCatalogWebService">
- <implementation.java class="services.VegetablesCatalogImpl"/>
- <service name="Catalog">
- <binding.ws/>
- </service>
- </component>
-
-</composite>
diff --git a/sca-cpp/trunk/test/store-function/currency-composite.hpp b/sca-cpp/trunk/test/store-function/currency-composite.hpp
deleted file mode 100644
index ae28471538..0000000000
--- a/sca-cpp/trunk/test/store-function/currency-composite.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_currencycomposite_hpp
-#define tuscany_currencycomposite_hpp
-
-#include <string>
-#include "service.hpp"
-#include "currency.hpp"
-
-namespace store
-{
-
-const tuscany::value currency_service(const tuscany::list<tuscany::value>& args) {
- return currencyConverter_service(args);
-}
-
-}
-#endif /* tuscany_currencycomposite_hpp */
diff --git a/sca-cpp/trunk/test/store-function/currency.composite b/sca-cpp/trunk/test/store-function/currency.composite
deleted file mode 100644
index aefd474f1f..0000000000
--- a/sca-cpp/trunk/test/store-function/currency.composite
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://services"
- name="currency">
-
- <component name="CurrencyConverterWebService">
- <implementation.java class="services.CurrencyConverterImpl"/>
- <service name="CurrencyConverter">
- <binding.ws/>
- </service>
- </component>
-
-</composite>
diff --git a/sca-cpp/trunk/test/store-function/currency.hpp b/sca-cpp/trunk/test/store-function/currency.hpp
deleted file mode 100644
index ca4376d2c7..0000000000
--- a/sca-cpp/trunk/test/store-function/currency.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_currency_hpp
-#define tuscany_currency_hpp
-
-#include <math.h>
-#include <string>
-#include "debug.hpp"
-#include "service.hpp"
-#include "item.hpp"
-
-namespace store
-{
-
-const double currencyConverter_convert(unused const std::string& fromCurrencyCode, const std::string& toCurrencyCode, const double amount) {
- if(toCurrencyCode == "USD")
- return amount;
- if(toCurrencyCode == "EUR")
- return round(amount * 0.7256 * 100) / 100;
- return amount;
-}
-
-const std::string currencyConverter_getSymbol(const std::string& currencyCode) {
- if(currencyCode == "USD")
- return "$";
- if(currencyCode == "EUR")
- return "E";
- return "?";
-}
-
-const tuscany::value currencyConverter_service(const tuscany::list<tuscany::value>& args) {
- if (car(args) == "convert")
- return currencyConverter_convert(cadr(args), car(cdr(cdr(args))), car(cdr(cdr(cdr(args)))));
- if (car(args) == "getSymbol")
- return currencyConverter_getSymbol(cadr(args));
- return tuscany::value();
-}
-
-}
-#endif /* tuscany_currency_hpp */
diff --git a/sca-cpp/trunk/test/store-function/item.hpp b/sca-cpp/trunk/test/store-function/item.hpp
deleted file mode 100644
index fbe29915dc..0000000000
--- a/sca-cpp/trunk/test/store-function/item.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_item_hpp
-#define tuscany_item_hpp
-
-#include <string>
-#include "service.hpp"
-
-namespace store
-{
-
-typedef tuscany::value ItemType;
-
-const ItemType item(const std::string& name, const std::string& currencyCode, const std::string& currencySymbol, const double price) {
- return tuscany::mklist<tuscany::value>(name, currencyCode, currencySymbol, price);
-}
-
-const std::string itemName(const ItemType& item) {
- return car((tuscany::list<tuscany::value>)item);
-}
-
-const std::string itemCurrencyCode(const ItemType& item) {
- return car(cdr((tuscany::list<tuscany::value>)item));
-}
-
-const std::string itemCurrencySymbol(const ItemType& item) {
- return car(cdr(cdr((tuscany::list<tuscany::value>)item)));
-}
-
-const double itemPrice(const ItemType& item) {
- return car(cdr(cdr(cdr((tuscany::list<tuscany::value>)item))));
-}
-
-}
-#endif /* tuscany_item_hpp */
diff --git a/sca-cpp/trunk/test/store-function/service.hpp b/sca-cpp/trunk/test/store-function/service.hpp
deleted file mode 100644
index b764e87d1a..0000000000
--- a/sca-cpp/trunk/test/store-function/service.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_service_hpp
-#define tuscany_service_hpp
-
-#include "function.hpp"
-#include "list.hpp"
-#include "value.hpp"
-
-namespace store
-{
-
-typedef tuscany::lambda<tuscany::value(tuscany::list<tuscany::value>)> service;
-
-}
-#endif /* tuscany_service_hpp */
diff --git a/sca-cpp/trunk/test/store-function/store-composite.hpp b/sca-cpp/trunk/test/store-function/store-composite.hpp
deleted file mode 100644
index 351c905eae..0000000000
--- a/sca-cpp/trunk/test/store-function/store-composite.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_storecomposite_hpp
-#define tuscany_storecomposite_hpp
-
-#include <string>
-#include "service.hpp"
-#include "currency.hpp"
-#include "currency-composite.hpp"
-#include "item.hpp"
-#include "catalog.hpp"
-#include "cart.hpp"
-#include "store-ui.hpp"
-
-namespace store
-{
-
-const tuscany::value store_service(const service& currency, const tuscany::list<tuscany::value>& args) {
- const tuscany::lambda<tuscany::value(service, tuscany::list<tuscany::value>)> catalogService(catalog_service);
- const service catalog(curry(catalogService, currency));
- const service cart(shoppingCart_service);
- const tuscany::lambda<tuscany::value(service, service, tuscany::list<tuscany::value>)> storeUIService(storeUI_service);
- const service configuredStoreUIService(curry(storeUIService, catalog, cart));
- return configuredStoreUIService(args);
-}
-
-}
-#endif /* tuscany_storecomposite_hpp */
diff --git a/sca-cpp/trunk/test/store-function/store-function-test.cpp b/sca-cpp/trunk/test/store-function/store-function-test.cpp
deleted file mode 100644
index 8a6a86eb8a..0000000000
--- a/sca-cpp/trunk/test/store-function/store-function-test.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-/**
- * Store Test case.
- */
-
-#include <assert.h>
-#include <iostream>
-#include <string>
-#include "store-solution.hpp"
-
-namespace store
-{
-
-bool testComponentAssembly() {
- const service store(storeSolution_service);
- assert(length((tuscany::list<tuscany::value>)store(tuscany::mklist<tuscany::value>("getCatalog"))) == 3);
- return true;
-}
-
-}
-
-int main() {
-
- std::cout << "Testing..." << std::endl;
-
- store::testComponentAssembly();
- std::cout << "OK" << std::endl;
-
- return 0;
-}
diff --git a/sca-cpp/trunk/test/store-function/store-solution.hpp b/sca-cpp/trunk/test/store-function/store-solution.hpp
deleted file mode 100644
index e0addcba12..0000000000
--- a/sca-cpp/trunk/test/store-function/store-solution.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_storesolution_hpp
-#define tuscany_storesolution_hpp
-
-#include <string>
-#include "service.hpp"
-#include "store-composite.hpp"
-#include "currency-composite.hpp"
-
-namespace store
-{
-
-const tuscany::value storeSolution_service(const tuscany::list<tuscany::value>& args) {
- const service currency(currency_service);
- const tuscany::lambda<tuscany::value(service, tuscany::list<tuscany::value>)> storeService(store_service);
- const service configuredStoreService(curry(storeService, currency));
- return configuredStoreService(args);
-}
-
-}
-#endif /* tuscany_storesolution_hpp */
diff --git a/sca-cpp/trunk/test/store-function/store-ui.hpp b/sca-cpp/trunk/test/store-function/store-ui.hpp
deleted file mode 100644
index 12b28d6a92..0000000000
--- a/sca-cpp/trunk/test/store-function/store-ui.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* $Rev$ $Date$ */
-
-#ifndef tuscany_storeui_hpp
-#define tuscany_storeui_hpp
-
-#include <string>
-#include "service.hpp"
-#include "currency.hpp"
-#include "item.hpp"
-#include "catalog.hpp"
-#include "cart.hpp"
-
-namespace store
-{
-
-const tuscany::list<ItemType> storeUI_getCatalog(const service& catalog) {
- return catalog(tuscany::mklist<tuscany::value>("get"));
-}
-
-const tuscany::list<ItemType> storeUI_getCart(const service& cart) {
- return cart(tuscany::mklist<tuscany::value>("getAll"));
-}
-
-const double storeUI_getTotal(const service& cart) {
- return cart(tuscany::mklist<tuscany::value>("getTotal"));
-}
-
-const bool storeUI_post(const service& cart, const ItemType& item) {
- return cart(tuscany::mklist<tuscany::value>("post", item));
-}
-
-const tuscany::value storeUI_service(const service& catalog, const service& cart, const tuscany::list<tuscany::value>& args) {
- if (car(args) == "getCatalog")
- return storeUI_getCatalog(catalog);
- if (car(args) == "getCart")
- return storeUI_getCart(cart);
- if (car(args) == "getTotal")
- return storeUI_getTotal(cart);
- if (car(args) == "post")
- return storeUI_post(cart, cadr(args));
- return tuscany::value();
-}
-
-}
-#endif /* STOREUI_HPP_ */
diff --git a/sca-cpp/trunk/test/store-function/store.composite b/sca-cpp/trunk/test/store-function/store.composite
deleted file mode 100644
index 124adff853..0000000000
--- a/sca-cpp/trunk/test/store-function/store.composite
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://store"
- name="store">
-
- <component name="Store">
- <t:implementation.widget location="uiservices/store.html"/>
- <service name="Widget">
- <t:binding.http uri="/ui"/>
- </service>
- <reference name="catalog" target="StoreCatalog">
- <t:binding.jsonrpc/>
- </reference>
- <reference name="shoppingCart" target="StoreShoppingCart/Cart">
- <t:binding.atom/>
- </reference>
- <reference name="shoppingTotal" target="StoreShoppingCart/Total">
- <t:binding.jsonrpc/>
- </reference>
- </component>
-
- <component name="StoreCatalog">
- <implementation.java class="services.FruitsCatalogImpl"/>
- <property name="currencyCode">USD</property>
- <service name="Catalog">
- <t:binding.jsonrpc/>
- </service>
- <reference name="currencyConverter" target="StoreCurrencyConverter"/>
- </component>
-
- <component name="StoreShoppingCart">
- <implementation.java class="services.ShoppingCartImpl"/>
- <service name="Cart">
- <t:binding.atom uri="/ShoppingCart/Cart"/>
- </service>
- <service name="Total">
- <t:binding.jsonrpc/>
- </service>
- </component>
-
- <component name="StoreCurrencyConverter">
- <implementation.java class="services.CurrencyConverterImpl"/>
- </component>
-
-</composite>