diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-06-20 19:53:21 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-06-20 19:53:21 (GMT) |
commit | 794575f01ce5a6bf7e377eb815f3def5aded74f5 (patch) | |
tree | 9c59df64ee290f68b7b6c8698bfac4169684485e /test/src | |
parent | d304f85417e3175c5f2ca159dd303309c24e7b81 (diff) | |
download | uscxml-794575f01ce5a6bf7e377eb815f3def5aded74f5.zip uscxml-794575f01ce5a6bf7e377eb815f3def5aded74f5.tar.gz uscxml-794575f01ce5a6bf7e377eb815f3def5aded74f5.tar.bz2 |
New version with XHTML invoker
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/scxml-test-framework-client.cpp | 6 | ||||
-rw-r--r-- | test/src/test-url.cpp | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/test/src/scxml-test-framework-client.cpp b/test/src/scxml-test-framework-client.cpp index 0441c0e..8fbdf75 100644 --- a/test/src/scxml-test-framework-client.cpp +++ b/test/src/scxml-test-framework-client.cpp @@ -105,7 +105,7 @@ public: } - void httpRecvRequest(const uscxml::HTTPServer::Request& request) { + bool httpRecvRequest(const uscxml::HTTPServer::Request& request) { // uscxml::HTTPServer::Reply httpReply(request); // uscxml::HTTPServer::reply(httpReply); @@ -144,7 +144,7 @@ public: _interpreters[token] = std::make_pair(interpreter, request); interpreter.start(); } - return; + return true; } if(jsonReq.compound.find("event") != jsonReq.compound.end()) { @@ -160,7 +160,7 @@ public: _interpreters[token].second = request; _interpreters[token].first.receive(event); } - + return true; } void setURL(const std::string& url) { diff --git a/test/src/test-url.cpp b/test/src/test-url.cpp index 69951e4..69f9014 100644 --- a/test/src/test-url.cpp +++ b/test/src/test-url.cpp @@ -16,7 +16,9 @@ class TestServlet : public HTTPServlet { public:
TestServlet(bool adaptPath) : _canAdaptPath(adaptPath) {}
- void httpRecvRequest(const HTTPServer::Request& request) {};
+ bool httpRecvRequest(const HTTPServer::Request& request) {
+ return true;
+ };
bool canAdaptPath() {
return _canAdaptPath;
}
@@ -69,6 +71,9 @@ int main(int argc, char** argv) { URL exeUrl(exeName);
exeUrl.toAbsolute(baseUrl);
assert(canResolve(exeUrl.asString()));
+ std::cout << exeUrl.asString() << std::endl;
+ exeUrl.download(true);
+ assert(exeUrl.getInContent().length() > 0);
}
{
@@ -105,6 +110,11 @@ int main(int argc, char** argv) { }
{
+ Data data = Data::fromJSON("{\"shiftKey\":false,\"toElement\":{\"id\":\"\",\"localName\":\"body\"},\"clientY\":38,\"y\":38,\"x\":66,\"ctrlKey\":false,\"relatedTarget\":{\"id\":\"\",\"localName\":\"body\"},\"clientX\":66,\"screenY\":288,\"metaKey\":false,\"offsetX\":58,\"altKey\":false,\"offsetY\":30,\"fromElement\":{\"id\":\"foo\",\"localName\":\"div\"},\"screenX\":-1691,\"dataTransfer\":null,\"button\":0,\"pageY\":38,\"layerY\":38,\"pageX\":66,\"charCode\":0,\"which\":0,\"keyCode\":0,\"detail\":0,\"layerX\":66,\"returnValue\":true,\"timeStamp\":1371223991895,\"eventPhase\":2,\"target\":{\"id\":\"foo\",\"localName\":\"div\"},\"defaultPrevented\":false,\"srcElement\":{\"id\":\"foo\",\"localName\":\"div\"},\"type\":\"mouseout\",\"cancelable\":true,\"currentTarget\":{\"id\":\"foo\",\"localName\":\"div\"},\"bubbles\":true,\"cancelBubble\":false}");
+ std::cout << data << std::endl;
+ }
+
+ {
Data data = Data::fromJSON("asdf");
std::cout << data << std::endl;
}
|