summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-12-20 21:34:09 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-12-20 21:34:09 (GMT)
commit498f6f80e9ca01236ca1491596875ab7eb4cd8c3 (patch)
treee627ae19475bb93a98dfa50db1950f6e3403f569 /test
parentd779abe6ff76a78f92d229fcf1f006f5cf1f9295 (diff)
downloaduscxml-498f6f80e9ca01236ca1491596875ab7eb4cd8c3.zip
uscxml-498f6f80e9ca01236ca1491596875ab7eb4cd8c3.tar.gz
uscxml-498f6f80e9ca01236ca1491596875ab7eb4cd8c3.tar.bz2
Refactoring finished
Support datamodels, invokers and ioprocessors as plugins Comply to HTTP1.1 by sending host header field Started prolog datamodel
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt17
-rw-r--r--test/samples/uscxml/test-ecmascript.scxml8
-rw-r--r--test/samples/uscxml/test-prolog.scxml15
-rw-r--r--test/src/test-apache-commons.cpp138
-rw-r--r--test/src/test-communication.cpp38
-rw-r--r--test/src/test-completion.cpp20
-rw-r--r--test/src/test-ecmascript-v8.cpp34
-rw-r--r--test/src/test-eventdelay.cpp26
-rw-r--r--test/src/test-execution.cpp24
-rw-r--r--test/src/test-predicates.cpp108
-rw-r--r--test/src/test-prolog-swi.cpp25
11 files changed, 248 insertions, 205 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 1fdaaee..7bd6c47 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -13,10 +13,19 @@ target_link_libraries(test-apache-commons uscxml)
add_test(test-apache-commons ${CURRENT_BINARY_DIR}/test-apache-commons ${CMAKE_SOURCE_DIR}/test/samples/apache)
set_target_properties(test-apache-commons PROPERTIES FOLDER "Tests")
-add_executable(test-ecmascript-v8 src/test-ecmascript-v8.cpp)
-target_link_libraries(test-ecmascript-v8 uscxml)
-add_test(test-ecmascript-v8 ${CURRENT_BINARY_DIR}/test-ecmascript-v8 ${CMAKE_SOURCE_DIR}/test/src/test-ecmascript.scxml)
-set_target_properties(test-ecmascript-v8 PROPERTIES FOLDER "Tests")
+if (V8_FOUND)
+ add_executable(test-ecmascript-v8 src/test-ecmascript-v8.cpp)
+ target_link_libraries(test-ecmascript-v8 uscxml)
+ add_test(test-ecmascript-v8 ${CURRENT_BINARY_DIR}/test-ecmascript-v8 ${CMAKE_SOURCE_DIR}/test/src/test-ecmascript.scxml)
+ set_target_properties(test-ecmascript-v8 PROPERTIES FOLDER "Tests")
+endif()
+
+if (SWI_FOUND)
+ add_executable(test-prolog-swi src/test-prolog-swi.cpp)
+ target_link_libraries(test-prolog-swi uscxml)
+ add_test(test-prolog-swi ${CURRENT_BINARY_DIR}/test-prolog-swi ${CMAKE_SOURCE_DIR}/test/src/test-prolog.scxml)
+ set_target_properties(test-prolog-swi PROPERTIES FOLDER "Tests")
+endif()
add_executable(test-communication src/test-communication.cpp)
target_link_libraries(test-communication uscxml)
diff --git a/test/samples/uscxml/test-ecmascript.scxml b/test/samples/uscxml/test-ecmascript.scxml
index aa88f17..7dfd94c 100644
--- a/test/samples/uscxml/test-ecmascript.scxml
+++ b/test/samples/uscxml/test-ecmascript.scxml
@@ -77,13 +77,7 @@
</foreach>
</foreach>
</onentry>
- <transition target="externalEvents" />
- </state>
- <state id="externalEvents">
- <onentry>
- <log expr="'-- External Events'" />
- </onentry>
- <transition target="datamodels" event="event1" cond="_event.name == 'event1'" />
+ <transition target="datamodels" />
</state>
<state id="datamodels">
<datamodel>
diff --git a/test/samples/uscxml/test-prolog.scxml b/test/samples/uscxml/test-prolog.scxml
new file mode 100644
index 0000000..75a1c64
--- /dev/null
+++ b/test/samples/uscxml/test-prolog.scxml
@@ -0,0 +1,15 @@
+<scxml datamodel="prolog" initial="start" binding="late">
+ <datamodel>
+ <data id="facts">
+ cat(tom).
+ animal(X):- cat(X).
+ </data>
+ </datamodel>
+ <script>
+ cat(tom).
+ cat(X).
+ animal(X).
+ </script>
+ <state id="start">
+ </state>
+</scxml> \ No newline at end of file
diff --git a/test/src/test-apache-commons.cpp b/test/src/test-apache-commons.cpp
index 3bfbfed..9ac4442 100644
--- a/test/src/test-apache-commons.cpp
+++ b/test/src/test-apache-commons.cpp
@@ -8,61 +8,61 @@ using namespace Arabica::XPath;
static std::string path;
bool testEvents1() {
- LOG(INFO) << "---- testEvent1 ";
- Interpreter* interpreter = Interpreter::fromURI(path + "/eventdata-01.xml");
+ LOG(INFO) << "---- testEvent1 ";
+ Interpreter* interpreter = Interpreter::fromURI(path + "/eventdata-01.xml");
interpreter->start();
- interpreter->waitForStabilization();
- assert(interpreter->getConfiguration().size() == 1);
- assert(Interpreter::isMember(interpreter->getState("state1"), interpreter->getConfiguration()));
-
- Event eventFoo;
- eventFoo.name = "event.foo";
- eventFoo.atom = "3";
- interpreter->receive(eventFoo);
- interpreter->waitForStabilization();
- assert(interpreter->getConfiguration().size() == 1);
- assert(Interpreter::isMember(interpreter->getState("state3"), interpreter->getConfiguration()));
-
- Event eventBar;
- eventBar.name = "event.bar";
- eventBar.atom = "6";
- interpreter->receive(eventBar);
- interpreter->waitForStabilization();
- assert(interpreter->getConfiguration().size() == 1);
- assert(Interpreter::isMember(interpreter->getState("state6"), interpreter->getConfiguration()));
-
- Event eventBaz;
- eventBaz.name = "event.baz";
- eventBaz.atom = "7";
- interpreter->receive(eventBaz);
-
- delete interpreter;
- return true;
+ interpreter->waitForStabilization();
+ assert(interpreter->getConfiguration().size() == 1);
+ assert(Interpreter::isMember(interpreter->getState("state1"), interpreter->getConfiguration()));
+
+ Event eventFoo;
+ eventFoo.name = "event.foo";
+ eventFoo.atom = "3";
+ interpreter->receive(eventFoo);
+ interpreter->waitForStabilization();
+ assert(interpreter->getConfiguration().size() == 1);
+ assert(Interpreter::isMember(interpreter->getState("state3"), interpreter->getConfiguration()));
+
+ Event eventBar;
+ eventBar.name = "event.bar";
+ eventBar.atom = "6";
+ interpreter->receive(eventBar);
+ interpreter->waitForStabilization();
+ assert(interpreter->getConfiguration().size() == 1);
+ assert(Interpreter::isMember(interpreter->getState("state6"), interpreter->getConfiguration()));
+
+ Event eventBaz;
+ eventBaz.name = "event.baz";
+ eventBaz.atom = "7";
+ interpreter->receive(eventBaz);
+
+ delete interpreter;
+ return true;
}
bool testEvents2() {
- LOG(INFO) << "---- testEvent2 ";
- Interpreter* interpreter = Interpreter::fromURI(path + "/eventdata-02.xml");
+ LOG(INFO) << "---- testEvent2 ";
+ Interpreter* interpreter = Interpreter::fromURI(path + "/eventdata-02.xml");
interpreter->start();
- interpreter->waitForStabilization();
- assert(interpreter->getConfiguration().size() == 1);
- assert(Interpreter::isMember(interpreter->getState("state0"), interpreter->getConfiguration()));
-
- Event eventConnAlert;
- eventConnAlert.name = "connection.alerting";
- eventConnAlert.atom = "'line2'";
- interpreter->receive(eventConnAlert);
- interpreter->waitForStabilization();
- assert(interpreter->getConfiguration().size() == 1);
- assert(Interpreter::isMember(interpreter->getState("state2"), interpreter->getConfiguration()));
-
- Event eventConnAlert2;
- eventConnAlert2.name = "connection.alerting";
- eventConnAlert2.compound["line"] = Data(std::string("4"));
- interpreter->receive(eventConnAlert2);
-
- delete interpreter;
- return true;
+ interpreter->waitForStabilization();
+ assert(interpreter->getConfiguration().size() == 1);
+ assert(Interpreter::isMember(interpreter->getState("state0"), interpreter->getConfiguration()));
+
+ Event eventConnAlert;
+ eventConnAlert.name = "connection.alerting";
+ eventConnAlert.atom = "'line2'";
+ interpreter->receive(eventConnAlert);
+ interpreter->waitForStabilization();
+ assert(interpreter->getConfiguration().size() == 1);
+ assert(Interpreter::isMember(interpreter->getState("state2"), interpreter->getConfiguration()));
+
+ Event eventConnAlert2;
+ eventConnAlert2.name = "connection.alerting";
+ eventConnAlert2.compound["line"] = Data(std::string("4"));
+ interpreter->receive(eventConnAlert2);
+
+ delete interpreter;
+ return true;
}
//bool testEvents3() {
@@ -73,7 +73,7 @@ bool testEvents2() {
// Thread::sleepMs(200);
// assert(interpreter->getConfiguration().size() == 1);
// assert(Interpreter::isMember(interpreter->getState("state0"), interpreter->getConfiguration()));
-//
+//
// Event eventConnAlert;
// eventConnAlert.name = "connection.alerting";
// eventConnAlert.atom = "'line2'";
@@ -81,7 +81,7 @@ bool testEvents2() {
// Thread::sleepMs(200);
// assert(interpreter->getConfiguration().size() == 1);
// assert(Interpreter::isMember(interpreter->getState("state2"), interpreter->getConfiguration()));
-//
+//
// Event eventConnAlert2;
// eventConnAlert2.name = "connection.alerting";
// eventConnAlert2.compound["line"] = Data(std::string("4"));
@@ -89,40 +89,40 @@ bool testEvents2() {
// Thread::sleepMs(200);
// assert(interpreter->getConfiguration().size() == 1);
// assert(Interpreter::isMember(interpreter->getState("state4"), interpreter->getConfiguration()));
-//
+//
// delete Interpreter;
// return true;
//}
int main(int argc, char** argv) {
- if (argc != 2) {
- std::cerr << "Expected path to scxml file from apache commons distribution" << std::endl;
- exit(EXIT_FAILURE);
- }
-
- path = "file://";
- path += argv[1];
-
- if (!testEvents1())
- return EXIT_FAILURE;
- if (!testEvents2())
- return EXIT_FAILURE;
+ if (argc != 2) {
+ std::cerr << "Expected path to scxml file from apache commons distribution" << std::endl;
+ exit(EXIT_FAILURE);
+ }
+
+ path = "file://";
+ path += argv[1];
+
+ if (!testEvents1())
+ return EXIT_FAILURE;
+ if (!testEvents2())
+ return EXIT_FAILURE;
// if (!testEvents3())
// return EXIT_FAILURE;
-
+
//
// Interpreter* scxmlInterpreter = new Interpreter(path + "/tie-breaker-01.xml");
// SCXMLRunner* scxmlRun = new SCXMLRunner(scxmlInterpreter);
// scxmlRun->start();
-//
+//
// Thread::sleepMs(100);
// assert(Interpreter::isMember(scxmlinterpreter->getState("ten"), scxmlinterpreter->getConfiguration()));
-//
+//
// boost::shared_ptr<Event> event = boost::shared_ptr<Event>(new Event());
// event->name = "ten.done";
// scxmlinterpreter->receive(event);
// scxmlRun->join();
// scxmlinterpreter->receive(event);
-
+
} \ No newline at end of file
diff --git a/test/src/test-communication.cpp b/test/src/test-communication.cpp
index ac0fa6c..a0cdbbd 100644
--- a/test/src/test-communication.cpp
+++ b/test/src/test-communication.cpp
@@ -2,30 +2,30 @@
#include <DOM/io/Stream.hpp>
int main(int argc, char** argv) {
- if (argc != 2) {
- std::cerr << "Expected path to test-communication.scxml" << std::endl;
- exit(EXIT_FAILURE);
- }
-
-
- using namespace uscxml;
- std::list<Interpreter*> _interpreters;
+ if (argc != 2) {
+ std::cerr << "Expected path to test-communication.scxml" << std::endl;
+ exit(EXIT_FAILURE);
+ }
+
+
+ using namespace uscxml;
+ std::list<Interpreter*> _interpreters;
// Event e;
// e.compound["foo"] = Data("bar", Data::VERBATIM);
// e.compound["foo2"] = Data("bar2", Data::VERBATIM);
// std::cout << e.toDocument() << std::endl;
-
- int nrInterpreters = 1;
- for (int i = 0; i < nrInterpreters; i++) {
- _interpreters.push_back(Interpreter::fromURI(argv[1]));
- _interpreters.back()->start();
- }
- std::list<Interpreter*>::iterator interIter = _interpreters.begin();
- while(interIter != _interpreters.end()) {
- (*interIter)->join();
- interIter++;
- }
+ int nrInterpreters = 1;
+ for (int i = 0; i < nrInterpreters; i++) {
+ _interpreters.push_back(Interpreter::fromURI(argv[1]));
+ _interpreters.back()->start();
+ }
+
+ std::list<Interpreter*>::iterator interIter = _interpreters.begin();
+ while(interIter != _interpreters.end()) {
+ (*interIter)->join();
+ interIter++;
+ }
} \ No newline at end of file
diff --git a/test/src/test-completion.cpp b/test/src/test-completion.cpp
index b75baf6..67d8708 100644
--- a/test/src/test-completion.cpp
+++ b/test/src/test-completion.cpp
@@ -3,18 +3,18 @@
#include <DOM/io/Stream.hpp>
int main(int argc, char** argv) {
- if (argc != 2) {
- std::cerr << "Expected path to scxml document" << std::endl;
- exit(EXIT_FAILURE);
- }
-
- using namespace uscxml;
+ if (argc != 2) {
+ std::cerr << "Expected path to scxml document" << std::endl;
+ exit(EXIT_FAILURE);
+ }
- Interpreter* interpreter = Interpreter::fromURI(argv[1]);
- //SCXMLDotWriter::toDot("output.dot", interpreter);
+ using namespace uscxml;
+
+ Interpreter* interpreter = Interpreter::fromURI(argv[1]);
+ //SCXMLDotWriter::toDot("output.dot", interpreter);
interpreter->interpret();
-
-
+
+
return EXIT_SUCCESS;
} \ No newline at end of file
diff --git a/test/src/test-ecmascript-v8.cpp b/test/src/test-ecmascript-v8.cpp
index bca9343..9ce39d9 100644
--- a/test/src/test-ecmascript-v8.cpp
+++ b/test/src/test-ecmascript-v8.cpp
@@ -2,23 +2,23 @@
#include "uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h"
int main(int argc, char** argv) {
- if (argc != 2) {
- std::cerr << "Expected path to test-ecmascript.scxml" << std::endl;
- exit(EXIT_FAILURE);
- }
+ if (argc != 2) {
+ std::cerr << "Expected path to test-ecmascript.scxml" << std::endl;
+ exit(EXIT_FAILURE);
+ }
- using namespace uscxml;
- using namespace Arabica::DOM;
- using namespace Arabica::XPath;
+ using namespace uscxml;
+ using namespace Arabica::DOM;
+ using namespace Arabica::XPath;
+
+ Interpreter* scxml = Interpreter::fromURI(argv[1]);
+ scxml->start();
+ scxml->waitForStabilization();
+
+ Event event1;
+ event1.name = "event1";
+ scxml->receive(event1);
+ scxml->join();
+ tthread::this_thread::sleep_for(tthread::chrono::milliseconds(500));
- Interpreter* scxml = Interpreter::fromURI(argv[1]);
- scxml->start();
- scxml->waitForStabilization();
-
- Event event1;
- event1.name = "event1";
- scxml->receive(event1);
- scxml->join();
- tthread::this_thread::sleep_for(tthread::chrono::milliseconds(500));
-
} \ No newline at end of file
diff --git a/test/src/test-eventdelay.cpp b/test/src/test-eventdelay.cpp
index 17a88ca..a3fec34 100644
--- a/test/src/test-eventdelay.cpp
+++ b/test/src/test-eventdelay.cpp
@@ -6,18 +6,18 @@ int eventCalled = 0;
static void callback(void* userData, const std::string eventId) {
// std::cout << eventId << ": " << (const char*)userData << std::endl;
- std::cout << eventId << std::endl << std::flush;
- eventCalled++;
+ std::cout << eventId << std::endl << std::flush;
+ eventCalled++;
}
int main(int argc, char** argv) {
- using namespace uscxml;
+ using namespace uscxml;
DelayedEventQueue* eq = new DelayedEventQueue();
- std::cout << "Starting" << std::endl;
- eq->start();
- tthread::this_thread::sleep_for(tthread::chrono::milliseconds(10));
+ std::cout << "Starting" << std::endl;
+ eq->start();
+ tthread::this_thread::sleep_for(tthread::chrono::milliseconds(10));
// eq->addEvent("foo", callback, 200, (void*)"event foo");
// eq->addEvent("bar", callback, 400, (void*)"event bar");
@@ -26,14 +26,14 @@ int main(int argc, char** argv) {
// eq->addEvent("bar", callback, 300, (void*)"event bar");
// eq->addEvent("baz", callback, 400, (void*)"event baz");
- for (unsigned int i = 0; i <= 2000; i += 200) {
+ for (unsigned int i = 0; i <= 2000; i += 200) {
// eq->stop();
- std::stringstream ss;
- ss << i;
- eq->addEvent(ss.str(), callback, i, NULL);
- std::cout << "Added " << i << std::endl;
+ std::stringstream ss;
+ ss << i;
+ eq->addEvent(ss.str(), callback, i, NULL);
+ std::cout << "Added " << i << std::endl;
// eq->start();
- }
- tthread::this_thread::sleep_for(tthread::chrono::milliseconds(2000));
+ }
+ tthread::this_thread::sleep_for(tthread::chrono::milliseconds(2000));
} \ No newline at end of file
diff --git a/test/src/test-execution.cpp b/test/src/test-execution.cpp
index cea89b5..272ce41 100644
--- a/test/src/test-execution.cpp
+++ b/test/src/test-execution.cpp
@@ -1,16 +1,16 @@
#include "uscxml/Interpreter.h"
int main(int argc, char** argv) {
- if (argc != 2) {
- std::cerr << "Expected path to test-execution.scxml" << std::endl;
- exit(EXIT_FAILURE);
- }
-
- using namespace uscxml;
- using namespace Arabica::DOM;
- using namespace Arabica::XPath;
-
- Interpreter* interpreter = Interpreter::fromURI(argv[1]);
- interpreter->dump();
- interpreter->interpret();
+ if (argc != 2) {
+ std::cerr << "Expected path to test-execution.scxml" << std::endl;
+ exit(EXIT_FAILURE);
+ }
+
+ using namespace uscxml;
+ using namespace Arabica::DOM;
+ using namespace Arabica::XPath;
+
+ Interpreter* interpreter = Interpreter::fromURI(argv[1]);
+ interpreter->dump();
+ interpreter->interpret();
} \ No newline at end of file
diff --git a/test/src/test-predicates.cpp b/test/src/test-predicates.cpp
index 0494c24..2905f40 100644
--- a/test/src/test-predicates.cpp
+++ b/test/src/test-predicates.cpp
@@ -3,58 +3,58 @@
#undef protected
int main(int argc, char** argv) {
- if (argc != 2) {
- std::cerr << "Expected path to test-predicates.scxml" << std::endl;
- exit(EXIT_FAILURE);
- }
-
- using namespace uscxml;
- using namespace Arabica::DOM;
- using namespace Arabica::XPath;
-
- Interpreter* interpreter = Interpreter::fromURI(argv[1]);
-
- Node<std::string> atomicState = interpreter->getState("atomic");
- assert(Interpreter::isAtomic(atomicState));
- assert(!Interpreter::isParallel(atomicState));
- assert(!Interpreter::isCompound(atomicState));
-
- Node<std::string> compoundState = interpreter->getState("compound");
- assert(!Interpreter::isAtomic(compoundState));
- assert(!Interpreter::isParallel(compoundState));
- assert(Interpreter::isCompound(compoundState));
-
- Node<std::string> parallelState = interpreter->getState("parallel");
- assert(!Interpreter::isAtomic(parallelState));
- assert(Interpreter::isParallel(parallelState));
- assert(!Interpreter::isCompound(parallelState)); // parallel states are not compound!
-
- Node<std::string> initialState = interpreter->getInitialState();
- assert(initialState == atomicState);
-
- NodeSet<std::string> childs = interpreter->getChildStates(compoundState);
- Node<std::string> compundChild1 = interpreter->getState("compundChild1");
- Node<std::string> compundChild2 = interpreter->getState("compundChild2");
- assert(childs.size() > 0);
- assert(Interpreter::isMember(compundChild1, childs));
- assert(Interpreter::isMember(compundChild2, childs));
- assert(!Interpreter::isMember(compoundState, childs));
-
- assert(Interpreter::isDescendant(compundChild1, compoundState));
-
- std::string transEvents;
- transEvents = "error";
- assert(Interpreter::nameMatch(transEvents, "error"));
- assert(!Interpreter::nameMatch(transEvents, "foo"));
-
- transEvents = "error foo";
- assert(Interpreter::nameMatch(transEvents, "error"));
- assert(Interpreter::nameMatch(transEvents, "error.send"));
- assert(Interpreter::nameMatch(transEvents, "error.send.failed"));
- assert(Interpreter::nameMatch(transEvents, "foo"));
- assert(Interpreter::nameMatch(transEvents, "foo.bar"));
- assert(!Interpreter::nameMatch(transEvents, "errors.my.custom"));
- assert(!Interpreter::nameMatch(transEvents, "errorhandler.mistake"));
- assert(!Interpreter::nameMatch(transEvents, "errOr.send"));
- assert(!Interpreter::nameMatch(transEvents, "foobar"));
+ if (argc != 2) {
+ std::cerr << "Expected path to test-predicates.scxml" << std::endl;
+ exit(EXIT_FAILURE);
+ }
+
+ using namespace uscxml;
+ using namespace Arabica::DOM;
+ using namespace Arabica::XPath;
+
+ Interpreter* interpreter = Interpreter::fromURI(argv[1]);
+
+ Node<std::string> atomicState = interpreter->getState("atomic");
+ assert(Interpreter::isAtomic(atomicState));
+ assert(!Interpreter::isParallel(atomicState));
+ assert(!Interpreter::isCompound(atomicState));
+
+ Node<std::string> compoundState = interpreter->getState("compound");
+ assert(!Interpreter::isAtomic(compoundState));
+ assert(!Interpreter::isParallel(compoundState));
+ assert(Interpreter::isCompound(compoundState));
+
+ Node<std::string> parallelState = interpreter->getState("parallel");
+ assert(!Interpreter::isAtomic(parallelState));
+ assert(Interpreter::isParallel(parallelState));
+ assert(!Interpreter::isCompound(parallelState)); // parallel states are not compound!
+
+ Node<std::string> initialState = interpreter->getInitialState();
+ assert(initialState == atomicState);
+
+ NodeSet<std::string> childs = interpreter->getChildStates(compoundState);
+ Node<std::string> compundChild1 = interpreter->getState("compundChild1");
+ Node<std::string> compundChild2 = interpreter->getState("compundChild2");
+ assert(childs.size() > 0);
+ assert(Interpreter::isMember(compundChild1, childs));
+ assert(Interpreter::isMember(compundChild2, childs));
+ assert(!Interpreter::isMember(compoundState, childs));
+
+ assert(Interpreter::isDescendant(compundChild1, compoundState));
+
+ std::string transEvents;
+ transEvents = "error";
+ assert(Interpreter::nameMatch(transEvents, "error"));
+ assert(!Interpreter::nameMatch(transEvents, "foo"));
+
+ transEvents = "error foo";
+ assert(Interpreter::nameMatch(transEvents, "error"));
+ assert(Interpreter::nameMatch(transEvents, "error.send"));
+ assert(Interpreter::nameMatch(transEvents, "error.send.failed"));
+ assert(Interpreter::nameMatch(transEvents, "foo"));
+ assert(Interpreter::nameMatch(transEvents, "foo.bar"));
+ assert(!Interpreter::nameMatch(transEvents, "errors.my.custom"));
+ assert(!Interpreter::nameMatch(transEvents, "errorhandler.mistake"));
+ assert(!Interpreter::nameMatch(transEvents, "errOr.send"));
+ assert(!Interpreter::nameMatch(transEvents, "foobar"));
} \ No newline at end of file
diff --git a/test/src/test-prolog-swi.cpp b/test/src/test-prolog-swi.cpp
new file mode 100644
index 0000000..17947af
--- /dev/null
+++ b/test/src/test-prolog-swi.cpp
@@ -0,0 +1,25 @@
+#include "uscxml/Interpreter.h"
+#include "uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h"
+
+int main(int argc, char** argv) {
+ if (argc != 2) {
+ std::cerr << "Expected path to test-prolog.scxml" << std::endl;
+ exit(EXIT_FAILURE);
+ }
+
+ using namespace uscxml;
+ using namespace Arabica::DOM;
+ using namespace Arabica::XPath;
+
+ uscxml::Factory::pluginPath = "/Users/sradomski/Documents/TK/Code/uscxml/build/xcode/lib";
+ Interpreter* scxml = Interpreter::fromURI(argv[1]);
+ scxml->start();
+ scxml->waitForStabilization();
+
+ Event event1;
+ event1.name = "event1";
+ scxml->receive(event1);
+ scxml->join();
+ tthread::this_thread::sleep_for(tthread::chrono::milliseconds(500));
+
+} \ No newline at end of file