diff options
Diffstat (limited to 'sca-cpp/trunk/samples')
10 files changed, 132 insertions, 3 deletions
diff --git a/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-request.txt b/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-request.txt new file mode 100644 index 0000000000..1bbbc1bf52 --- /dev/null +++ b/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-request.txt @@ -0,0 +1 @@ +{"id": 1, "method": "getcatalog", "params": []} diff --git a/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-result.txt b/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-result.txt new file mode 100644 index 0000000000..34a2420298 --- /dev/null +++ b/sca-cpp/trunk/samples/store-cpp/htdocs/test/getcatalog-result.txt @@ -0,0 +1 @@ +{"id":1,"result":[{"javaClass":"services.Item","name":"Apple","currencyCode":"USD","currencySymbol":"$","price":2.99},{"javaClass":"services.Item","name":"Orange","currencyCode":"USD","currencySymbol":"$","price":3.55},{"javaClass":"services.Item","name":"Pear","currencyCode":"USD","currencySymbol":"$","price":1.55}]}
\ No newline at end of file diff --git a/sca-cpp/trunk/samples/store-cpp/htdocs/test/shopping-cart-entry.xml b/sca-cpp/trunk/samples/store-cpp/htdocs/test/shopping-cart-entry.xml new file mode 100644 index 0000000000..5e8fc7c1f3 --- /dev/null +++ b/sca-cpp/trunk/samples/store-cpp/htdocs/test/shopping-cart-entry.xml @@ -0,0 +1 @@ +<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml"><item><javaClass>services.Item</javaClass><name>Orange</name><currencyCode>USD</currencyCode><currencySymbol>$</currencySymbol><price>3.55</price></item></content></entry> diff --git a/sca-cpp/trunk/samples/store-cpp/server-test b/sca-cpp/trunk/samples/store-cpp/server-test index e50467be98..fa020c6418 100755 --- a/sca-cpp/trunk/samples/store-cpp/server-test +++ b/sca-cpp/trunk/samples/store-cpp/server-test @@ -30,6 +30,24 @@ $curl_prefix/bin/curl 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 http://localhost:8090/references/Store/catalog -X POST -H "Content-type: application/json-rpc" --data @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 http://localhost:8090/references/Store/shoppingCart -X POST -H "Content-type: application/atom+xml" --data @htdocs/test/shopping-cart-entry.xml 2>/dev/null + rc=$? +fi +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl 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 diff --git a/sca-cpp/trunk/samples/store-java/server-test b/sca-cpp/trunk/samples/store-java/server-test index e50467be98..dd94ccabde 100755 --- a/sca-cpp/trunk/samples/store-java/server-test +++ b/sca-cpp/trunk/samples/store-java/server-test @@ -30,6 +30,24 @@ $curl_prefix/bin/curl 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 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 ../store-cpp/htdocs/test/getcatalog-result.txt + rc=$? +fi + +# Test Shopping Cart +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl 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 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 diff --git a/sca-cpp/trunk/samples/store-nosql/server-test b/sca-cpp/trunk/samples/store-nosql/server-test index e50467be98..dd94ccabde 100755 --- a/sca-cpp/trunk/samples/store-nosql/server-test +++ b/sca-cpp/trunk/samples/store-nosql/server-test @@ -30,6 +30,24 @@ $curl_prefix/bin/curl 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 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 ../store-cpp/htdocs/test/getcatalog-result.txt + rc=$? +fi + +# Test Shopping Cart +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl 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 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 diff --git a/sca-cpp/trunk/samples/store-python/server-test b/sca-cpp/trunk/samples/store-python/server-test index e50467be98..dd94ccabde 100755 --- a/sca-cpp/trunk/samples/store-python/server-test +++ b/sca-cpp/trunk/samples/store-python/server-test @@ -30,6 +30,24 @@ $curl_prefix/bin/curl 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 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 ../store-cpp/htdocs/test/getcatalog-result.txt + rc=$? +fi + +# Test Shopping Cart +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl 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 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 diff --git a/sca-cpp/trunk/samples/store-scheme/server-test b/sca-cpp/trunk/samples/store-scheme/server-test index e50467be98..dd94ccabde 100755 --- a/sca-cpp/trunk/samples/store-scheme/server-test +++ b/sca-cpp/trunk/samples/store-scheme/server-test @@ -30,6 +30,24 @@ $curl_prefix/bin/curl 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 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 ../store-cpp/htdocs/test/getcatalog-result.txt + rc=$? +fi + +# Test Shopping Cart +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl 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 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 diff --git a/sca-cpp/trunk/samples/store-sql/server-test b/sca-cpp/trunk/samples/store-sql/server-test index e50467be98..dd94ccabde 100755 --- a/sca-cpp/trunk/samples/store-sql/server-test +++ b/sca-cpp/trunk/samples/store-sql/server-test @@ -30,6 +30,24 @@ $curl_prefix/bin/curl 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 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 ../store-cpp/htdocs/test/getcatalog-result.txt + rc=$? +fi + +# Test Shopping Cart +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl 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 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 diff --git a/sca-cpp/trunk/samples/store-vhost/server-test b/sca-cpp/trunk/samples/store-vhost/server-test index 1ed4b55df0..5cc160b23f 100755 --- a/sca-cpp/trunk/samples/store-vhost/server-test +++ b/sca-cpp/trunk/samples/store-vhost/server-test @@ -26,13 +26,31 @@ curl_prefix=`cat $here/../../modules/http/curl.prefix` sleep 2 # For this test to work, add the test domain to your etc/hosts as follows: -# 127.0.0.1 sca-store.com jane.sca-store.com joe.sca-store.com +# 127.0.0.1 sca-store.com joe.sca-store.com joe.sca-store.com # Test HTTP GET -$curl_prefix/bin/curl http://jane.sca-store.com:8090/ 2>/dev/null >tmp/jane.html -diff tmp/jane.html htdocs/domains/jane/index.html +$curl_prefix/bin/curl http://joe.sca-store.com:8090/ 2>/dev/null >tmp/index.html +diff tmp/index.html htdocs/domains/joe/index.html rc=$? +# Test Catalog +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl http://joe.sca-store.com: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 ../store-cpp/htdocs/test/getcatalog-result.txt + rc=$? +fi + +# Test Shopping Cart +if [ "$rc" = "0" ]; then + $curl_prefix/bin/curl http://joe.sca-store.com: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 http://joe.sca-store.com: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 |