summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/samples/store-gae/server-test
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-07-21 05:28:51 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-07-21 05:28:51 +0000
commit7ca51988782311ab74b23920fa5fd1b64900f46a (patch)
treefddf78039dabcb062a7a528a6f46fb5083014594 /sca-cpp/trunk/samples/store-gae/server-test
parent22e1e6325fd0dcf5059caf99a038493aa8b86f3a (diff)
Add a test of the password protected python store sample.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@966096 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rwxr-xr-xsca-cpp/trunk/samples/store-gae/server-test24
1 files changed, 21 insertions, 3 deletions
diff --git a/sca-cpp/trunk/samples/store-gae/server-test b/sca-cpp/trunk/samples/store-gae/server-test
index a36f6a0239..acaf3b2f0d 100755
--- a/sca-cpp/trunk/samples/store-gae/server-test
+++ b/sca-cpp/trunk/samples/store-gae/server-test
@@ -25,12 +25,30 @@ curl_prefix=`cat $here/../../modules/http/curl.prefix`
./start 2>/dev/null
sleep 2
-# Test HTTP GET
+# Test HTTP GET (with authentication)
mkdir -p tmp
-$curl_prefix/bin/curl -L http://localhost:8090/ 2>/dev/null >tmp/login.html
-grep "Login" tmp/login.html >/dev/null
+$curl_prefix/bin/curl -L -c tmp/cookies.txt -b tmp/cookies.txt "http://localhost:8090/_ah/login?email=test@example.com&action=Login&continue=http://localhost:8090/" 2>/dev/null >tmp/index.html
+diff tmp/index.html htdocs/index.html
rc=$?
+# Test Catalog
+if [ "$rc" = "0" ]; then
+ $curl_prefix/bin/curl -b tmp/cookies.txt http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @../store-cpp/htdocs/test/getcatalog-request.txt >tmp/getcatalog-result.txt 2>/dev/null
+ diff tmp/getcatalog-result.txt htdocs/test/getcatalog-result.txt
+ rc=$?
+fi
+
+# Test Shopping Cart
+if [ "$rc" = "0" ]; then
+ $curl_prefix/bin/curl -b tmp/cookies.txt http://localhost:8090/references/Store/shoppingCart -X POST -H "Content-type: application/atom+xml" --data @../store-cpp/htdocs/test/shopping-cart-entry.xml 2>/dev/null
+ rc=$?
+fi
+if [ "$rc" = "0" ]; then
+ $curl_prefix/bin/curl -b tmp/cookies.txt http://localhost:8090/references/Store/shoppingCart >tmp/shopping-cart-feed.xml 2>/dev/null
+ grep "3.55" tmp/shopping-cart-feed.xml >/dev/null
+ rc=$?
+fi
+
# Cleanup
./stop
sleep 2