diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-13 15:02:25 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-13 15:02:25 (GMT) |
commit | 66b0852b0618cc4bfff08d47aa0af56353226190 (patch) | |
tree | f1194ccb83779aef83e6d4afbfe8aee0aaedd224 /test | |
parent | fe941ab36b44f083886c07a72d371b2cfba55fe3 (diff) | |
download | uscxml-66b0852b0618cc4bfff08d47aa0af56353226190.zip uscxml-66b0852b0618cc4bfff08d47aa0af56353226190.tar.gz uscxml-66b0852b0618cc4bfff08d47aa0af56353226190.tar.bz2 |
Started renewed VoiceXMLInvoker
Diffstat (limited to 'test')
-rw-r--r-- | test/src/test-url.cpp | 2 | ||||
-rw-r--r-- | test/src/test-vxml-mmi-http.cpp | 8 | ||||
-rw-r--r-- | test/src/test-vxml-mmi-socket.cpp | 3 | ||||
-rw-r--r-- | test/uscxml/test-jvoicexml.scxml | 70 |
4 files changed, 38 insertions, 45 deletions
diff --git a/test/src/test-url.cpp b/test/src/test-url.cpp index 046cc8b..b3f9e28 100644 --- a/test/src/test-url.cpp +++ b/test/src/test-url.cpp @@ -48,6 +48,8 @@ int main(int argc, char** argv) { WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif
+ HTTPServer::getInstance(8099, 8100);
+
std::string exeName = argv[0];
exeName = exeName.substr(exeName.find_last_of("\\/") + 1);
diff --git a/test/src/test-vxml-mmi-http.cpp b/test/src/test-vxml-mmi-http.cpp index 130441c..a2dd14f 100644 --- a/test/src/test-vxml-mmi-http.cpp +++ b/test/src/test-vxml-mmi-http.cpp @@ -1,5 +1,4 @@ #include "uscxml/config.h" -#include "uscxml/server/Socket.h" #include "uscxml/UUID.h" #include <iostream> #include <stdexcept> @@ -16,22 +15,20 @@ #include "uscxml/server/HTTPServer.h" #include "uscxml/URL.h" #include "uscxml/concurrency/tinythread.h" -#include "uscxml/plugins/ioprocessor/modality/MMIMessages.h" +#include "uscxml/messages/MMIMessages.h" #include <DOM/io/Stream.hpp> #ifdef _WIN32 #include "XGetopt.h" #endif -#include "uscxml/plugins/ioprocessor/modality/MMIMessages.cpp" - #define ISSUE_REQUEST(name) {\ Arabica::DOM::Document<std::string> name##XML = name.toXML(true);\ name##XML.getDocumentElement().setPrefix("mmi");\ std::stringstream name##XMLSS;\ name##XMLSS << name##XML;\ URL name##URL(target);\ - std::cout << name##XMLSS.str();\ + std::cout << "SEND:" << std::endl << name##XMLSS.str() << std::flush;\ name##URL.setOutContent(name##XMLSS.str());\ name##URL.addOutHeader("Content-type", "application/xml");\ name##URL.download(false);\ @@ -50,6 +47,7 @@ std::string context; class MMIServlet : public HTTPServlet { public: bool httpRecvRequest(const HTTPServer::Request& request) { + std::cout << "RCVD:" << std::endl << request << std::flush; tthread::lock_guard<tthread::mutex> lock(Mutex); const Arabica::DOM::Document<std::string>& doc = request.data.at("content").node.getOwnerDocument(); diff --git a/test/src/test-vxml-mmi-socket.cpp b/test/src/test-vxml-mmi-socket.cpp index 8246c3b..99662c9 100644 --- a/test/src/test-vxml-mmi-socket.cpp +++ b/test/src/test-vxml-mmi-socket.cpp @@ -12,10 +12,9 @@ #endif #include "uscxml/concurrency/tinythread.h" -#include "uscxml/plugins/ioprocessor/modality/MMIMessages.h" +#include "uscxml/messages/MMIMessages.h" #include <DOM/io/Stream.hpp> -#include "uscxml/plugins/ioprocessor/modality/MMIMessages.cpp" using namespace uscxml; diff --git a/test/uscxml/test-jvoicexml.scxml b/test/uscxml/test-jvoicexml.scxml index 691a951..311f1c8 100644 --- a/test/uscxml/test-jvoicexml.scxml +++ b/test/uscxml/test-jvoicexml.scxml @@ -2,56 +2,50 @@ xmlns:vxml="http://www.w3.org/2001/vxml" datamodel="ecmascript"> <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" /> + <state id="start"> <invoke type="heartbeat"> - <param name="interval" expr="'4s'" /> + <param name="interval" expr="'5s'" /> </invoke> - - <invoke type="vxml" id="vxml"> - <finalize> - <script> - dump(_event); - </script> - </finalize> - </invoke> - - <onentry> - <log expr="'Starting!!'" /> - </onentry> + + <state id="vxmlHello"> + <invoke type="vxml" id="vxml"> + <param name="target" expr="'http://localhost:9090/mmi'" /> + <finalize> + <script>dump(_event);</script> + </finalize> + + <content> + <vxml:vxml version="2.1" xml:lang="en" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schematicLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd"> + <vxml:form id="say_hello"> + <vxml:block> + Hello World! + <vxml:goto next="#say_goodbye" /> + </vxml:block> + </vxml:form> + <vxml:form id="say_goodbye"> + <vxml:block> + <vxml:prompt>Goodbye!</vxml:prompt> + </vxml:block> + </vxml:form> + </vxml:vxml> + </content> + </invoke> + + <transition event="heartbeat" target="idle" /> + </state> <state id="idle"> <onentry> <log expr="'Idling!'" /> </onentry> - <transition event="heartbeat.4s" target="vxmlHello"> + <transition event="heartbeat" target="vxmlHello"> <log expr="'Foo!'" /> </transition> </state> - <state id="vxmlHello"> - <onentry> - <send target="#_vxml"> - <content> - <vxml:vxml version="2.1" xml:lang="en" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schematicLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd"> - <vxml:form id="say_hello"> - <vxml:block> - Hello World! - <vxml:goto next="#say_goodbye" /> - </vxml:block> - </vxml:form> - <vxml:form id="say_goodbye"> - <vxml:block> - <vxml:prompt>Goodbye!</vxml:prompt> - </vxml:block> - </vxml:form> - </vxml:vxml> - </content> - </send> - </onentry> - <transition target="idle" /> - </state> </state> </scxml>
\ No newline at end of file |