summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/components
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/components')
-rw-r--r--sca-cpp/trunk/components/cache/Makefile.am3
-rwxr-xr-xsca-cpp/trunk/components/cache/memcached-ssl-test1
-rwxr-xr-xsca-cpp/trunk/components/cache/server-test1
-rwxr-xr-xsca-cpp/trunk/components/chat/server-test1
-rw-r--r--sca-cpp/trunk/components/filedb/filedb.hpp33
-rwxr-xr-xsca-cpp/trunk/components/filedb/server-test1
-rwxr-xr-xsca-cpp/trunk/components/log/server-test1
-rwxr-xr-xsca-cpp/trunk/components/nosqldb/server-test1
-rwxr-xr-xsca-cpp/trunk/components/queue/server-test1
-rwxr-xr-xsca-cpp/trunk/components/sqldb/server-test1
-rwxr-xr-xsca-cpp/trunk/components/sqldb/standby-test1
-rwxr-xr-xsca-cpp/trunk/components/webservice/server-test1
12 files changed, 25 insertions, 21 deletions
diff --git a/sca-cpp/trunk/components/cache/Makefile.am b/sca-cpp/trunk/components/cache/Makefile.am
index b1ad26a246..159a941947 100644
--- a/sca-cpp/trunk/components/cache/Makefile.am
+++ b/sca-cpp/trunk/components/cache/Makefile.am
@@ -50,5 +50,4 @@ client_test_LDFLAGS = -lxml2 -lcurl -lmozjs
dist_noinst_SCRIPTS = memcached-test memcached-ssl-test server-test
noinst_PROGRAMS = memcache-test client-test
-#TESTS = memcached-test memcached-ssl-test server-test
-TESTS = memcached-test server-test
+TESTS = memcached-test memcached-ssl-test server-test
diff --git a/sca-cpp/trunk/components/cache/memcached-ssl-test b/sca-cpp/trunk/components/cache/memcached-ssl-test
index a99a5a9144..ffd1cd0e8e 100755
--- a/sca-cpp/trunk/components/cache/memcached-ssl-test
+++ b/sca-cpp/trunk/components/cache/memcached-ssl-test
@@ -35,6 +35,7 @@ tar -C tmp/ssl -c `../../modules/http/ssl-cert-find tmp/ssl` | tar -C tmp/tunnel
../../modules/http/httpd-start tmp/tunnel
../../modules/http/httpd-conf tmp/server localhost 8090 htdocs
+../../modules/http/httpd-event-conf tmp/server
tar -C tmp/ssl -c `../../modules/http/ssl-cert-find tmp/ssl` | tar -C tmp/server -x
../../modules/http/httpd-ssl-conf tmp/server 8453
../../modules/http/cert-auth-conf tmp/server
diff --git a/sca-cpp/trunk/components/cache/server-test b/sca-cpp/trunk/components/cache/server-test
index 1fea285100..d9176f37ac 100755
--- a/sca-cpp/trunk/components/cache/server-test
+++ b/sca-cpp/trunk/components/cache/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
diff --git a/sca-cpp/trunk/components/chat/server-test b/sca-cpp/trunk/components/chat/server-test
index cbece709f5..4b3a7bfc6a 100755
--- a/sca-cpp/trunk/components/chat/server-test
+++ b/sca-cpp/trunk/components/chat/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
diff --git a/sca-cpp/trunk/components/filedb/filedb.hpp b/sca-cpp/trunk/components/filedb/filedb.hpp
index d368522669..d2bc8bd212 100644
--- a/sca-cpp/trunk/components/filedb/filedb.hpp
+++ b/sca-cpp/trunk/components/filedb/filedb.hpp
@@ -44,16 +44,16 @@ namespace filedb {
*/
class FileDB {
public:
- FileDB() : owner(false), jscx(*jscontext("")) {
+ FileDB() : owner(false) {
debug("filedb::filedb");
}
- FileDB(const string& name, const string& format) : owner(true), name(name), format(format), jscx(*jscontext(format)) {
+ FileDB(const string& name, const string& format) : owner(true), name(name), format(format) {
debug(name, "filedb::filedb::name");
debug(format, "filedb::filedb::format");
}
- FileDB(const FileDB& c) : owner(false), name(c.name), format(c.format), jscx(c.jscx) {
+ FileDB(const FileDB& c) : owner(false), name(c.name), format(c.format) {
debug("filedb::filedb::copy");
}
@@ -65,16 +65,9 @@ private:
bool owner;
string name;
string format;
- js::JSContext& jscx;
- js::JSContext* jscontext(const string& format) {
- if (format != "json")
- return NULL;
- return new (gc_new<js::JSContext>()) js::JSContext();
- }
-
- friend const failable<bool> write(const value& v, ostream& os, const string& format, FileDB& db);
- friend const failable<value> read(istream& is, const string& format, FileDB& db);
+ friend const failable<bool> write(const value& v, ostream& os, const string& format);
+ friend const failable<value> read(istream& is, const string& format);
friend const failable<bool> post(const value& key, const value& val, FileDB& db);
friend const failable<bool> put(const value& key, const value& val, FileDB& db);
friend const failable<value> get(const value& key, FileDB& db);
@@ -111,7 +104,7 @@ const failable<bool> mkdirs(const list<value>& path, const string& root) {
/**
* Write a value to a database file.
*/
-const failable<bool> write(const value& v, ostream& os, const string& format, FileDB& db) {
+const failable<bool> write(const value& v, ostream& os, const string& format) {
if (format == "scheme") {
const string vs(scheme::writeValue(v));
os << vs;
@@ -125,7 +118,8 @@ const failable<bool> write(const value& v, ostream& os, const string& format, Fi
return true;
}
if (format == "json") {
- failable<list<string> > s = json::writeJSON(valuesToElements(v), db.jscx);
+ js::JSContext jscx;
+ failable<list<string> > s = json::writeJSON(valuesToElements(v), jscx);
if (!hasContent(s))
return mkfailure<bool>(reason(s));
write(content(s), os);
@@ -137,7 +131,7 @@ const failable<bool> write(const value& v, ostream& os, const string& format, Fi
/**
* Read a value from a database file.
*/
-const failable<value> read(istream& is, const string& format, FileDB& db) {
+const failable<value> read(istream& is, const string& format) {
if (format == "scheme") {
return scheme::readValue(is);
}
@@ -146,7 +140,8 @@ const failable<value> read(istream& is, const string& format, FileDB& db) {
return v;
}
if (format == "json") {
- const failable<list<value> > fv = json::readJSON(streamList(is), db.jscx);
+ js::JSContext jscx;
+ const failable<list<value> > fv = json::readJSON(streamList(is), jscx);
if (!hasContent(fv))
return mkfailure<value>(reason(fv));
const value v = elementsToValues(content(fv));
@@ -170,7 +165,7 @@ const failable<bool> post(const value& key, const value& val, FileDB& db) {
ofstream os(fn);
if (os.fail())
return mkfailure<bool>("Couldn't post file database entry.");
- const failable<bool> r = write(val, os, db.format, db);
+ const failable<bool> r = write(val, os, db.format);
debug(r, "filedb::post::result");
return r;
@@ -191,7 +186,7 @@ const failable<bool> put(const value& key, const value& val, FileDB& db) {
ofstream os(fn);
if (os.fail())
return mkfailure<bool>("Couldn't put file database entry.");
- const failable<bool> r = write(val, os, db.format, db);
+ const failable<bool> r = write(val, os, db.format);
debug(r, "filedb::put::result");
return r;
@@ -209,7 +204,7 @@ const failable<value> get(const value& key, FileDB& db) {
ifstream is(fn);
if (is.fail())
return mkfailure<value>("Couldn't get file database entry.");
- const failable<value> val = read(is, db.format, db);
+ const failable<value> val = read(is, db.format);
debug(val, "filedb::get::result");
return val;
diff --git a/sca-cpp/trunk/components/filedb/server-test b/sca-cpp/trunk/components/filedb/server-test
index f49ba8e80a..edd5386b08 100755
--- a/sca-cpp/trunk/components/filedb/server-test
+++ b/sca-cpp/trunk/components/filedb/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
diff --git a/sca-cpp/trunk/components/log/server-test b/sca-cpp/trunk/components/log/server-test
index e8e13f9d31..015691f958 100755
--- a/sca-cpp/trunk/components/log/server-test
+++ b/sca-cpp/trunk/components/log/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
diff --git a/sca-cpp/trunk/components/nosqldb/server-test b/sca-cpp/trunk/components/nosqldb/server-test
index 39b76b1fcd..d156f982c1 100755
--- a/sca-cpp/trunk/components/nosqldb/server-test
+++ b/sca-cpp/trunk/components/nosqldb/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
diff --git a/sca-cpp/trunk/components/queue/server-test b/sca-cpp/trunk/components/queue/server-test
index 1e575c6193..6b572fce6f 100755
--- a/sca-cpp/trunk/components/queue/server-test
+++ b/sca-cpp/trunk/components/queue/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
cat >>tmp/conf/httpd.conf <<EOF
diff --git a/sca-cpp/trunk/components/sqldb/server-test b/sca-cpp/trunk/components/sqldb/server-test
index 66f3eff0ed..666a9a1f0b 100755
--- a/sca-cpp/trunk/components/sqldb/server-test
+++ b/sca-cpp/trunk/components/sqldb/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
./pgsql-conf tmp
./pgsql-start tmp
./pgsql "drop table test;" 1>/dev/null 2>&1
diff --git a/sca-cpp/trunk/components/sqldb/standby-test b/sca-cpp/trunk/components/sqldb/standby-test
index 89bf8242da..fbb27b5bc3 100755
--- a/sca-cpp/trunk/components/sqldb/standby-test
+++ b/sca-cpp/trunk/components/sqldb/standby-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp/master localhost 8090 tmp/master/htdocs
+../../modules/http/httpd-event-conf tmp
./pgsql-conf tmp/master 5432
./pgsql-start tmp/master
./pgsql localhost 5432 "drop table test;" 1>/dev/null 2>&1
diff --git a/sca-cpp/trunk/components/webservice/server-test b/sca-cpp/trunk/components/webservice/server-test
index 6d3cd7f7fd..35cca9f7ad 100755
--- a/sca-cpp/trunk/components/webservice/server-test
+++ b/sca-cpp/trunk/components/webservice/server-test
@@ -19,6 +19,7 @@
# Setup
../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs
+../../modules/http/httpd-event-conf tmp
../../modules/server/server-conf tmp
../../modules/server/scheme-conf tmp
./axis2-conf tmp