summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/atom/atom-test.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-02-26 20:59:35 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-02-26 20:59:35 +0000
commit7c018c6fb691b65ac1cb181a95f5766e2933eb3c (patch)
treeb12eb4fd6fc05faebd9d481f1d57599cd0b2829e /sca-cpp/trunk/modules/atom/atom-test.cpp
parent0ee21c5d9657a1259a731722f53666ad135279bb (diff)
Correctly pass query strings through component wiring redirects and improve format of XML and JSON response documents.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1074924 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.cpp142
1 files changed, 74 insertions, 68 deletions
diff --git a/sca-cpp/trunk/modules/atom/atom-test.cpp b/sca-cpp/trunk/modules/atom/atom-test.cpp
index 762331d528..5503c0f9b4 100644
--- a/sca-cpp/trunk/modules/atom/atom-test.cpp
+++ b/sca-cpp/trunk/modules/atom/atom-test.cpp
@@ -36,52 +36,56 @@ ostream* writer(const string& s, ostream* os) {
return os;
}
-string itemEntry("<?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>"
- "<content type=\"application/xml\">"
- "<item>"
- "<name>Apple</name><price>$2.99</price>"
- "</item>"
- "</content>"
- "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
+const string itemEntry(
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">item</title>\n"
+ " <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
+ " <content type=\"application/xml\">\n"
+ " <item>\n"
+ " <name>Apple</name>\n"
+ " <price>$2.99</price>\n"
+ " </item>\n"
+ " </content>\n"
+ " <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
"</entry>\n");
-string itemTextEntry("<?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>"
- "<content type=\"text\">Apple</content>"
- "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
+const string itemTextEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">item</title>\n"
+ " <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
+ " <content type=\"text\">Apple</content>\n"
+ " <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
"</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\"/>"
+const string itemNoContentEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">item</title>\n"
+ " <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
+ " <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
"</entry>\n");
-string incompleteEntry("<entry xmlns=\"http://www.w3.org/2005/Atom\">"
- "<title>item</title><content type=\"text/xml\">"
- "<Item xmlns=\"http://services/\">"
- "<name xmlns=\"\">Orange</name>"
- "<price xmlns=\"\">3.55</price>"
- "</Item>"
- "</content>"
- "</entry>");
-
-string completedEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<entry xmlns=\"http://www.w3.org/2005/Atom\">"
- "<title type=\"text\">item</title>"
- "<id></id>"
- "<content type=\"application/xml\">"
- "<Item xmlns=\"http://services/\">"
- "<name xmlns=\"\">Orange</name>"
- "<price xmlns=\"\">3.55</price>"
- "</Item>"
- "</content><link href=\"\"/>"
+const string incompleteEntry("<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title>item</title>\n"
+ " <content type=\"text/xml\">\n"
+ " <Item xmlns=\"http://services/\">\n"
+ " <name xmlns=\"\">Orange</name>\n"
+ " <price xmlns=\"\">3.55</price>\n"
+ " </Item>\n"
+ " </content>\n"
+ "</entry>\n");
+
+const string completedEntry("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">item</title>\n"
+ " <id></id>\n"
+ " <content type=\"application/xml\">\n"
+ " <Item xmlns=\"http://services/\">\n"
+ " <name xmlns=\"\">Orange</name>\n"
+ " <price xmlns=\"\">3.55</price>\n"
+ " </Item>\n"
+ " </content>\n"
+ " <link href=\"\"/>\n"
"</entry>\n");
bool testEntry() {
@@ -133,36 +137,38 @@ bool testEntry() {
return true;
}
-string emptyFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<feed xmlns=\"http://www.w3.org/2005/Atom\">"
- "<title type=\"text\">Feed</title>"
- "<id>1234</id>"
+const string emptyFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">Feed</title>\n"
+ " <id>1234</id>\n"
"</feed>\n");
-string itemFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<feed xmlns=\"http://www.w3.org/2005/Atom\">"
- "<title type=\"text\">Feed</title>"
- "<id>1234</id>"
- "<entry xmlns=\"http://www.w3.org/2005/Atom\">"
- "<title type=\"text\">item</title>"
- "<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>"
- "<content type=\"application/xml\">"
- "<item>"
- "<name>Apple</name><price>$2.99</price>"
- "</item>"
- "</content>"
- "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>"
- "</entry>"
- "<entry xmlns=\"http://www.w3.org/2005/Atom\">"
- "<title type=\"text\">item</title>"
- "<id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c</id>"
- "<content type=\"application/xml\">"
- "<item>"
- "<name>Orange</name><price>$3.55</price>"
- "</item>"
- "</content>"
- "<link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c\"/>"
- "</entry>"
+const string itemFeed("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">Feed</title>\n"
+ " <id>1234</id>\n"
+ " <entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">item</title>\n"
+ " <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b</id>\n"
+ " <content type=\"application/xml\">\n"
+ " <item>\n"
+ " <name>Apple</name>\n"
+ " <price>$2.99</price>\n"
+ " </item>\n"
+ " </content>\n"
+ " <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b\"/>\n"
+ " </entry>\n"
+ " <entry xmlns=\"http://www.w3.org/2005/Atom\">\n"
+ " <title type=\"text\">item</title>\n"
+ " <id>cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c</id>\n"
+ " <content type=\"application/xml\">\n"
+ " <item>\n"
+ " <name>Orange</name>\n"
+ " <price>$3.55</price>\n"
+ " </item>\n"
+ " </content>\n"
+ " <link href=\"cart-53d67a61-aa5e-4e5e-8401-39edeba8b83c\"/>\n"
+ " </entry>\n"
"</feed>\n");
bool testFeed() {