summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/atom/atom-test.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-12-30 08:52:44 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-12-30 08:52:44 +0000
commit910ecec91d3de8d43eee9eef9201dd3fb1e00060 (patch)
treed355820ae11b2b4c0f75dafed195c450040d47d2 /sca-cpp/trunk/modules/atom/atom-test.cpp
parentfc4d80fd2083d48e6923faac1b6a038247079e50 (diff)
Support ATOM and RSS entries with no content or description.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1053822 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/atom/atom-test.cpp')
-rw-r--r--sca-cpp/trunk/modules/atom/atom-test.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/sca-cpp/trunk/modules/atom/atom-test.cpp b/sca-cpp/trunk/modules/atom/atom-test.cpp
index 4acc720816..762331d528 100644
--- a/sca-cpp/trunk/modules/atom/atom-test.cpp
+++ b/sca-cpp/trunk/modules/atom/atom-test.cpp
@@ -56,6 +56,13 @@ string itemTextEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
"</entry>\n");
+string itemNoContentEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<entry xmlns=\"http://www.w3.org/2005/Atom\">"
+ "<title type=\"text\">item</title>"
+ "<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>"
+ "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
+ "</entry>\n");
+
string incompleteEntry("<entry xmlns=\"http://www.w3.org/2005/Atom\">"
"<title>item</title><content type=\"text/xml\">"
"<Item xmlns=\"http://services/\">"
@@ -94,6 +101,12 @@ bool testEntry() {
assert(str(os) == itemTextEntry);
}
{
+ const list<value> a = mklist<value>(string("item"), string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"), list<value>());
+ ostringstream os;
+ writeATOMEntry<ostream*>(writer, &os, a);
+ assert(str(os) == itemNoContentEntry);
+ }
+ {
const list<value> a = content(readATOMEntry(mklist(itemEntry)));
ostringstream os;
writeATOMEntry<ostream*>(writer, &os, a);
@@ -106,6 +119,12 @@ bool testEntry() {
assert(str(os) == itemTextEntry);
}
{
+ const list<value> a = content(readATOMEntry(mklist(itemNoContentEntry)));
+ ostringstream os;
+ writeATOMEntry<ostream*>(writer, &os, a);
+ assert(str(os) == itemNoContentEntry);
+ }
+ {
const list<value> a = content(readATOMEntry(mklist(incompleteEntry)));
ostringstream os;
writeATOMEntry<ostream*>(writer, &os, a);