diff options
Diffstat (limited to '')
-rwxr-xr-x | sca-cpp/trunk/components/filedb/filedb-test | 1 | ||||
-rw-r--r-- | sca-cpp/trunk/components/filedb/filedb.cpp | 8 | ||||
-rw-r--r-- | sca-cpp/trunk/components/filedb/filedb.hpp | 8 | ||||
-rwxr-xr-x | sca-cpp/trunk/components/filedb/server-test | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/sca-cpp/trunk/components/filedb/filedb-test b/sca-cpp/trunk/components/filedb/filedb-test index 6d82936f6d..6d2d66424a 100755 --- a/sca-cpp/trunk/components/filedb/filedb-test +++ b/sca-cpp/trunk/components/filedb/filedb-test @@ -18,6 +18,7 @@ # under the License. # Setup +rm -rf tmp mkdir -p tmp mkdir -p tmp/schemedb mkdir -p tmp/xmldb diff --git a/sca-cpp/trunk/components/filedb/filedb.cpp b/sca-cpp/trunk/components/filedb/filedb.cpp index ac4c3faa6b..21b509a3b7 100644 --- a/sca-cpp/trunk/components/filedb/filedb.cpp +++ b/sca-cpp/trunk/components/filedb/filedb.cpp @@ -48,7 +48,7 @@ const failable<value> post(const list<value>& params, filedb::FileDB& db) { const value id = append<value>(car(params), mklist(mkuuid())); const failable<bool> val = filedb::post(id, cadr(params), db); if (!hasContent(val)) - return mkfailure<value>(reason(val)); + return mkfailure<value>(val); return id; } @@ -58,7 +58,7 @@ const failable<value> post(const list<value>& params, filedb::FileDB& db) { const failable<value> put(const list<value>& params, filedb::FileDB& db) { const failable<bool> val = filedb::put(car(params), cadr(params), db); if (!hasContent(val)) - return mkfailure<value>(reason(val)); + return mkfailure<value>(val); return value(content(val)); } @@ -68,7 +68,7 @@ const failable<value> put(const list<value>& params, filedb::FileDB& db) { const failable<value> del(const list<value>& params, filedb::FileDB& db) { const failable<bool> val = filedb::del(car(params), db); if (!hasContent(val)) - return mkfailure<value>(reason(val)); + return mkfailure<value>(val); return value(content(val)); } @@ -90,7 +90,7 @@ public: return put(cdr(params), db); if (func == "delete") return del(cdr(params), db); - return tuscany::mkfailure<tuscany::value>(); + return mkfailure<value>(); } private: diff --git a/sca-cpp/trunk/components/filedb/filedb.hpp b/sca-cpp/trunk/components/filedb/filedb.hpp index ea7638320f..a7151eade1 100644 --- a/sca-cpp/trunk/components/filedb/filedb.hpp +++ b/sca-cpp/trunk/components/filedb/filedb.hpp @@ -125,7 +125,7 @@ const failable<bool> write(const value& v, ostream& os, const string& format) { if (format == "xml") { failable<list<string> > s = writeXML(valuesToElements(v)); if (!hasContent(s)) - return mkfailure<bool>(reason(s)); + return mkfailure<bool>(s); write(content(s), os); return true; } @@ -133,7 +133,7 @@ const failable<bool> write(const value& v, ostream& os, const string& format) { js::JSContext jscx; failable<list<string> > s = json::writeJSON(valuesToElements(v), jscx); if (!hasContent(s)) - return mkfailure<bool>(reason(s)); + return mkfailure<bool>(s); write(content(s), os); return true; } @@ -155,7 +155,7 @@ const failable<value> read(istream& is, const string& format) { js::JSContext jscx; const failable<list<value> > fv = json::readJSON(streamList(is), jscx); if (!hasContent(fv)) - return mkfailure<value>(reason(fv)); + return mkfailure<value>(fv); const value v = elementsToValues(content(fv)); return v; } @@ -223,7 +223,7 @@ const failable<value> get(const value& key, FileDB& db) { if (is.fail()) { ostringstream os; os << "Couldn't get file database entry: " << key; - return mkfailure<value>(str(os)); + return mkfailure<value>(str(os), 404, false); } const failable<value> val = read(is, db.format); diff --git a/sca-cpp/trunk/components/filedb/server-test b/sca-cpp/trunk/components/filedb/server-test index edd5386b08..94afe464e1 100755 --- a/sca-cpp/trunk/components/filedb/server-test +++ b/sca-cpp/trunk/components/filedb/server-test @@ -18,6 +18,7 @@ # under the License. # Setup +rm -rf tmp ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs ../../modules/http/httpd-event-conf tmp ../../modules/server/server-conf tmp |