From ff124040623879bc48a0ba5cf06a841642adef53 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 30 Nov 2009 08:36:32 +0000 Subject: Fixes to the http client, httpd modules and memcached component to get the store and shopping cart test case working end to end. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@885349 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/server/impl-test.cpp | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sca-cpp/trunk/modules/server/impl-test.cpp (limited to 'sca-cpp/trunk/modules/server/impl-test.cpp') diff --git a/sca-cpp/trunk/modules/server/impl-test.cpp b/sca-cpp/trunk/modules/server/impl-test.cpp new file mode 100644 index 0000000000..217c6f5171 --- /dev/null +++ b/sca-cpp/trunk/modules/server/impl-test.cpp @@ -0,0 +1,76 @@ +/* + * 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$ */ + +/** + * Test component implementation. + */ + +#include + +#include "function.hpp" +#include "list.hpp" +#include "value.hpp" +#include "monad.hpp" +#include "debug.hpp" + +namespace tuscany { +namespace server { + +const failable get(unused const list& params) { + return value(std::string("Hey")); +} + +const failable post(unused const list& params) { + return value(std::string("1234")); +} + +const failable put(unused const list& params) { + return value(true); +} + +const failable del(unused const list& params) { + return value(true); +} + +const failable hello(const list& params) { + return value("hello " + std::string(car(params))); +} + +} +} + +extern "C" { + +const tuscany::failable eval(const tuscany::value& func, const tuscany::list& params) { + if (func == "get") + return tuscany::server::get(params); + if (func == "post") + return tuscany::server::post(params); + if (func == "put") + return tuscany::server::put(params); + if (func == "del") + return tuscany::server::del(params); + if (func == "hello") + return tuscany::server::hello(params); + return tuscany::mkfailure(std::string("Function not supported: ") + std::string(func)); +} + +} -- cgit v1.2.3