summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/wsgi/wiring-test
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-03-06 09:23:34 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-03-06 09:23:34 +0000
commitcaf895ebaddcba6b09bbe29eee23862ba1ca0126 (patch)
treee74213a0662dd47d616f56b488f4b6fff8fb3513 /sca-cpp/trunk/modules/wsgi/wiring-test
parenta84a0e4d169efbc78b169aea3ab422182f156a41 (diff)
Translated XML, ATOM and JSON conversion functions from C++ to Python. Added support for JSON-RPC and ATOM to the WSGI integration. Adjusted server module test cases to help test the WSGI server.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@919721 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/wsgi/wiring-test')
-rwxr-xr-xsca-cpp/trunk/modules/wsgi/wiring-test32
1 files changed, 18 insertions, 14 deletions
diff --git a/sca-cpp/trunk/modules/wsgi/wiring-test b/sca-cpp/trunk/modules/wsgi/wiring-test
index 5db99641ce..c3a8d09ae7 100755
--- a/sca-cpp/trunk/modules/wsgi/wiring-test
+++ b/sca-cpp/trunk/modules/wsgi/wiring-test
@@ -18,45 +18,49 @@
# under the License.
echo "Testing..."
+uri=$1
+if [ "$uri" = "" ]; then
+ uri="http://localhost:8090"
+fi
# Setup
-./wsgi-start 8090
+mkdir -p tmp
+./wsgi-start 8090 2>/dev/null
sleep 2
# Test HTTP GET
-#curl http://localhost:8090/index.html 2>/dev/null >tmp/index.html
-#diff tmp/index.html ../server/htdocs/index.html
-#rc=$?
-rc="0"
+curl $uri/index.html 2>/dev/null >tmp/index.html
+diff tmp/index.html htdocs/index.html
+rc=$?
# Test ATOMPub
if [ "$rc" = "0" ]; then
- curl http://localhost:8090/client/ >tmp/feed.xml 2>/dev/null
- diff tmp/feed.xml ../server/htdocs/feed.xml
+ curl $uri/client/ >tmp/feed.xml 2>/dev/null
+ diff tmp/feed.xml htdocs/feed.xml
rc=$?
fi
if [ "$rc" = "0" ]; then
- curl http://localhost:8090/client/111 >tmp/entry.xml 2>/dev/null
- diff tmp/entry.xml ../server/htdocs/entry.xml
+ curl $uri/client/111 >tmp/entry.xml 2>/dev/null
+ diff tmp/entry.xml htdocs/entry.xml
rc=$?
fi
if [ "$rc" = "0" ]; then
- curl http://localhost:8090/client/ -X POST -H "Content-type: application/atom+xml" --data @../server/htdocs/entry.xml 2>/dev/null
+ curl $uri/client/ -X POST -H "Content-type: application/atom+xml" --data @htdocs/entry.xml 2>/dev/null
rc=$?
fi
if [ "$rc" = "0" ]; then
- curl http://localhost:8090/client/111 -X PUT -H "Content-type: application/atom+xml" --data @../server/htdocs/entry.xml 2>/dev/null
+ curl $uri/client/111 -X PUT -H "Content-type: application/atom+xml" --data @htdocs/entry.xml 2>/dev/null
rc=$?
fi
if [ "$rc" = "0" ]; then
- curl http://localhost:8090/client/111 -X DELETE 2>/dev/null
+ curl $uri/client/111 -X DELETE 2>/dev/null
rc=$?
fi
# Test JSON-RPC
if [ "$rc" = "0" ]; then
- curl http://localhost:8090/client/ -X POST -H "Content-type: application/json-rpc" --data @../server/htdocs/json-request.txt >tmp/json-result.txt 2>/dev/null
- diff tmp/json-result.txt ../server/htdocs/json-result.txt
+ curl $uri/client/ -X POST -H "Content-type: application/json-rpc" --data @htdocs/json-request.txt >tmp/json-result.txt 2>/dev/null
+ diff tmp/json-result.txt htdocs/json-result.txt
rc=$?
fi