3 #include <boost/algorithm/string.hpp>
4 #include <boost/test/included/unit_test.hpp>
6 using namespace boost::unit_test_framework;
12 static void readDocFile();
13 static void getContent();
17 std::cout <<
"Enter XMLFileHandlerTest - readDocFile" << std::endl;
23 BOOST_CHECK_THROW(
xml_file_handler(
"uamapping_test_notwellformed.xml"), std::logic_error);
28 BOOST_CHECK(xmlHandlerTwo.
getNodeSet(
"//process_variable") != NULL);
32 std::cout <<
"Enter XMLFileHandlerTest - getContent" << std::endl;
35 xmlXPathObjectPtr result = xmlHandler.
getNodeSet(
37 "//process_variable[@sourceName='int8Array__s15']");
38 BOOST_CHECK(result != NULL);
39 xmlNodeSetPtr nodeset = NULL;
42 nodeset = result->nodesetval;
46 BOOST_CHECK(sourceVariableName !=
"");
52 vector<xmlNodePtr> nodeList = xmlHandler.
getNodesByName(nodeset->nodeTab[0]->children,
"destination");
53 BOOST_CHECK(nodeList.size() == 1);
57 BOOST_CHECK(unrollPath ==
"TestCaseForXMLFileHandlerTest::getContent/NorthSideLINAC/partB");
61 BOOST_CHECK(emptyContent ==
"");
65 BOOST_CHECK(path.size() == 1);
72 BOOST_CHECK(xmlHandler.
getNodeSet(
"//test") == NULL);