You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2010/01/17 10:02:59 UTC

svn commit: r900073 - in /tuscany/sca-cpp/trunk: ./ components/cache/ components/webservice/ kernel/ modules/atom/ modules/http/ modules/java/ modules/json/ modules/python/ modules/python/htdocs/ modules/scdl/ modules/server/ test/ test/store-cpp/ test...

Author: jsdelfino
Date: Sun Jan 17 09:02:57 2010
New Revision: 900073

URL: http://svn.apache.org/viewvc?rev=900073&view=rev
Log:
Simplified Makefiles a bit. Added -R options to configure shared library runtime search path and not require LD_LIBRARY_PATH anymore. Refactored test shell scripts and added a store-cpp integration test.

Added:
    tuscany/sca-cpp/trunk/modules/java/server-test
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/server-test
    tuscany/sca-cpp/trunk/modules/java/wiring-test   (with props)
    tuscany/sca-cpp/trunk/modules/python/wiring-test   (with props)
    tuscany/sca-cpp/trunk/modules/server/cpp-conf
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/server/scheme-conf
    tuscany/sca-cpp/trunk/test/store-cpp/
    tuscany/sca-cpp/trunk/test/store-cpp/Makefile.am
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/http/Makefile.am
    tuscany/sca-cpp/trunk/test/store-cpp/currency-converter.cpp
    tuscany/sca-cpp/trunk/test/store-cpp/fruits-catalog.cpp
    tuscany/sca-cpp/trunk/test/store-cpp/htdocs/
    tuscany/sca-cpp/trunk/test/store-cpp/htdocs/.htaccess
      - copied, changed from r900072, tuscany/sca-cpp/trunk/test/Makefile.am
    tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.html
    tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.js
    tuscany/sca-cpp/trunk/test/store-cpp/server-test
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/python-conf
    tuscany/sca-cpp/trunk/test/store-cpp/shopping-cart.cpp
    tuscany/sca-cpp/trunk/test/store-cpp/start
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/server-test
    tuscany/sca-cpp/trunk/test/store-cpp/stop   (contents, props changed)
      - copied, changed from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
    tuscany/sca-cpp/trunk/test/store-cpp/store.composite
    tuscany/sca-cpp/trunk/test/store-java/Makefile.am
      - copied, changed from r900072, tuscany/sca-cpp/trunk/test/Makefile.am
    tuscany/sca-cpp/trunk/test/store-java/server-test
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/python-conf
    tuscany/sca-cpp/trunk/test/store-java/start
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/server-test
    tuscany/sca-cpp/trunk/test/store-java/stop   (contents, props changed)
      - copied, changed from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
    tuscany/sca-cpp/trunk/test/store-python/start
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/server-test
    tuscany/sca-cpp/trunk/test/store-python/stop   (contents, props changed)
      - copied, changed from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
    tuscany/sca-cpp/trunk/test/store-scheme/start
      - copied, changed from r900072, tuscany/sca-cpp/trunk/modules/python/server-test
    tuscany/sca-cpp/trunk/test/store-scheme/stop   (contents, props changed)
      - copied, changed from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
Removed:
    tuscany/sca-cpp/trunk/modules/python/htdocs/
Modified:
    tuscany/sca-cpp/trunk/INSTALL
    tuscany/sca-cpp/trunk/README
    tuscany/sca-cpp/trunk/components/cache/Makefile.am
    tuscany/sca-cpp/trunk/components/webservice/Makefile.am
    tuscany/sca-cpp/trunk/configure.ac
    tuscany/sca-cpp/trunk/kernel/Makefile.am
    tuscany/sca-cpp/trunk/modules/atom/Makefile.am
    tuscany/sca-cpp/trunk/modules/http/Makefile.am
    tuscany/sca-cpp/trunk/modules/java/Makefile.am
    tuscany/sca-cpp/trunk/modules/json/Makefile.am
    tuscany/sca-cpp/trunk/modules/python/Makefile.am
    tuscany/sca-cpp/trunk/modules/python/python-conf
    tuscany/sca-cpp/trunk/modules/python/server-test
    tuscany/sca-cpp/trunk/modules/scdl/Makefile.am
    tuscany/sca-cpp/trunk/modules/server/Makefile.am
    tuscany/sca-cpp/trunk/modules/server/scheme-conf
    tuscany/sca-cpp/trunk/test/Makefile.am
    tuscany/sca-cpp/trunk/test/store-python/server-test
    tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
    tuscany/sca-cpp/trunk/test/store-scheme/server-test

Modified: tuscany/sca-cpp/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/INSTALL?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/INSTALL (original)
+++ tuscany/sca-cpp/trunk/INSTALL Sun Jan 17 09:02:57 2010
@@ -39,9 +39,12 @@
 SpiderMonkey libmozjs
 (included in xulrunner-1.9.1.7)
 
-Python
+Python (optional)
 libpython2.6
 
+Java (optional)
+a Java 6 development kit including jni.h and libjava
+
 
 To configure the Tuscany SCA build do this:
 ./autogen.sh
@@ -74,8 +77,8 @@
 
 
 Here's an example configuration, tested on Ubuntu 9.10, with development
-dependencies installed in the standard directories and a build of the
-HTTPD worker MPM in $HOME/httpd-2-2.13-bin:
+dependencies installed in the standard directories and HTTPD and Axis2C
+installed under $HOME:
 
 ./configure --prefix=$HOME/tuscany-sca-cpp-bin \
 --with-apr=$HOME/httpd-2.2.13-bin --with-httpd=$HOME/httpd-2.2.13-bin \

Modified: tuscany/sca-cpp/trunk/README
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/README?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/README (original)
+++ tuscany/sca-cpp/trunk/README Sun Jan 17 09:02:57 2010
@@ -33,12 +33,15 @@
  |   |   |-- atom             AtomPub encoding support
  |   |   |-- json             JSON-RPC encoding support
  |   |   |-- http             HTTP protocol support
- |   |   |-- eval             Scheme script evaluator
+ |   |   |-- java             Support for Java components
+ |   |   |-- python           Support for Python components
+ |   |   |-- scheme           Support for Scheme components
  |   |   |-- server           HTTPD server integration
  |   |
  |   |-- components           Useful SCA components
  |   |   |-- cache            Memcached-based cache component
  |   |   |-- store            Persistent store component
+ |   |   |-- webservice       Web service gateway component using Axis2C
  |   |
  |   |-- test                 Integration tests
  |   |

Modified: tuscany/sca-cpp/trunk/components/cache/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/cache/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/cache/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/components/cache/Makefile.am Sun Jan 17 09:02:57 2010
@@ -23,9 +23,9 @@
 libmcache_la_SOURCES = mcache.cpp
 
 mcache_test_SOURCES = mcache-test.cpp
-mcache_test_LDADD = -lxml2
+mcache_test_LDFLAGS = -lxml2
 
 client_test_SOURCES = client-test.cpp
-client_test_LDADD = -lxml2 -lcurl -lmozjs
+client_test_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 TESTS = memcached-test server-test

Modified: tuscany/sca-cpp/trunk/components/webservice/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/webservice/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/webservice/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/components/webservice/Makefile.am Sun Jan 17 09:02:57 2010
@@ -25,14 +25,14 @@
 comp_LTLIBRARIES = libwebservice.la
 
 libwebservice_la_SOURCES = webservice.cpp
-libwebservice_la_LIBADD = -lxml2 -L${AXIS2C_LIB} -laxis2_engine
+libwebservice_la_LDFLAGS = -lxml2 -L${AXIS2C_LIB} -R${AXIS2C_LIB} -laxis2_engine
 
 webservice_test_SOURCES = webservice-test.cpp
-webservice_test_LDADD = -lxml2 -L${AXIS2C_LIB} -laxis2_engine
+webservice_test_LDFLAGS = -lxml2 -L${AXIS2C_LIB} -R${AXIS2C_LIB} -laxis2_engine
 
 client_test_SOURCES = client-test.cpp
-client_test_LDADD = -lxml2 -lcurl -lmozjs
+client_test_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 TESTS = webservice-test client-test
 
-endif
\ No newline at end of file
+endif

Modified: tuscany/sca-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/configure.ac?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/configure.ac (original)
+++ tuscany/sca-cpp/trunk/configure.ac Sun Jan 17 09:02:57 2010
@@ -137,28 +137,26 @@
 # Initialize default GCC C++ and LD options.
 cxxflags=""
 ldflags="${LDFLAGS}"
+defaultlibs="${LIBS}"
 
 # Configure default includes.
 cxxflags="${cxxflags} ${INCLUDES} -I. -I${TUSCANY_SCACPP}/kernel -I${APR_INCLUDE} -I${LIBXML2_INCLUDE} -I${JS_INCLUDE} -I${CURL_INCLUDE}"
 
-# Check for libraries required by all modules and add them to default LIBS variable  
+# Check for libraries required by all modules and add them to LD options.
 AC_MSG_NOTICE([checking for required libraries])
-LIBS="-L${APR_LIB} ${LIBS}"
-AC_CHECK_LIB([apr-1], [apr_pool_initialize], [], [AC_MSG_ERROR([couldn't find a suitable libapr-1, use --with-apr=PATH])])
-AC_CHECK_LIB([aprutil-1], [apr_memcache_replace], [], [AC_MSG_ERROR([couldn't find a suitable libaprutil-1, use --with-apr=PATH])])
-default_LIBS="${LIBS}"
+LIBS="-L${APR_LIB} ${defaultlibs}"
+AC_CHECK_LIB([apr-1], [apr_pool_initialize], [AC_MSG_NOTICE([found])], [AC_MSG_ERROR([couldn't find a suitable libapr-1, use --with-apr=PATH])])
+AC_CHECK_LIB([aprutil-1], [apr_memcache_replace], [AC_MSG_NOTICE([found])], [AC_MSG_ERROR([couldn't find a suitable libaprutil-1, use --with-apr=PATH])])
+ldflags="${ldflags} -L${APR_LIB} -R${APR_LIB} -lapr-1 -laprutil-1"
 
-# Check for libraries only required by some modules.  
-LIBS="-L${CURL_LIB} ${default_LIBS}"
+# Check for libraries only required by some modules and add their search path to LD options.  
+LIBS="-L${CURL_LIB} ${defaultlibs}"
 AC_CHECK_LIB([curl], [curl_global_init], [], [AC_MSG_ERROR([couldn't find a suitable libcurl, use --with-curl=PATH])])
-LIBS="-L${JS_LIB} ${default_LIBS}"
+LIBS="-L${JS_LIB} ${defaultlibs}"
 AC_CHECK_LIB([mozjs], [JS_NewContext], [], [AC_MSG_ERROR([couldn't find a suitable libmozjs, use --with-js-lib=PATH])])
-LIBS="-L${LIBXML2_LIB} ${default_LIBS}"
+LIBS="-L${LIBXML2_LIB} ${defaultlibs}"
 AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([couldn't find a suitable libxml2, use --with-libxml2=PATH])])
-
-# Configure default search path for these libraries.
-LIBS="-L${CURL_LIB} -L${JS_LIB} -L${LIBXML2_LIB} ${default_LIBS}"
-default_LIBS="${LIBS}"
+ldflags="${ldflags} -L${CURL_LIB} -R${CURL_LIB} -L${JS_LIB} -R${JS_LIB} -L${LIBXML2_LIB} -R${LIBXML2_LIB}"
 
 # Check for required header files.
 AC_MSG_NOTICE([checking for header files])
@@ -236,9 +234,8 @@
   esac ],
 [ AC_MSG_RESULT(no)])
 if test "${want_threads}" = "true"; then
-  LIBS="${default_LIBS}"
   AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([couldn't find a suitable libpthread])])
-  LIBS="${default_LIBS}"
+  LIBS="${defaultlibs}"
   cxxflags="${cxxflags} -D_REENTRANT"
   ldflags="${ldflags} -lpthread"
   AM_CONDITIONAL([WANT_THREADS], true)
@@ -247,10 +244,6 @@
   AM_CONDITIONAL([WANT_THREADS], false)
 fi
 
-# Configure GCC C++ and LD options.
-AC_SUBST([CXXFLAGS], ["${cxxflags}"])
-AC_SUBST([LDFLAGS], ["${ldflags}"])
-
 # Configure exuberant ctags.
 TAGSFILE="`pwd`/tags"
 AC_SUBST([CTAGSFLAGS], ["${CTAGSFLAGS} --c++-kinds=+p --fields=+iaS --extra=+q --append --tag-relative=yes -f ${TAGSFILE}"])
@@ -309,7 +302,6 @@
 if test "${want_python}" = "true"; then
   LIBS="-L${PYTHON_LIB} ${default_LIBS}"
   AC_CHECK_LIB([python2.6], [Py_Initialize], [], [AC_MSG_ERROR([couldn't find a suitable libpython2.6, use --with-python=PATH])])
-  LIBS="${default_LIBS}"
   AM_CONDITIONAL([WANT_PYTHON], true)
   AC_DEFINE([WANT_PYTHON], 1, [enable Python support])
 else
@@ -346,7 +338,6 @@
 if test "${want_java}" = "true"; then
   LIBS="-L${JAVA_LIB} ${default_LIBS}"
   #AC_CHECK_LIB([java], [JNI_OnLoad], [], [AC_MSG_ERROR([couldn't find a suitable libjava, use --with-java=PATH])])
-  LIBS="${default_LIBS}"
   AC_PROG_JAVAC
   AC_PROG_JAR
   AM_CONDITIONAL([WANT_JAVA], true)
@@ -385,13 +376,17 @@
 if test "${want_webservice}" = "true"; then
   LIBS="-L${AXIS2C_LIB} ${default_LIBS}"
   AC_CHECK_LIB([axis2_engine], [axis2_svc_client_create], [], [AC_MSG_ERROR([couldn't find a suitable libaxis2_engine, use --with-axis2c=PATH])])
-  LIBS="${default_LIBS}"
   AM_CONDITIONAL([WANT_WEBSERVICE], true)
   AC_DEFINE([WANT_WEBSERVICE], 1, [enable Web service support])
 else
   AM_CONDITIONAL([WANT_WEBSERVICE], false)
 fi
 
+# Configure GCC C++ and LD options.
+AC_SUBST([CXXFLAGS], ["${cxxflags}"])
+AC_SUBST([LDFLAGS], ["${ldflags}"])
+LIBS="${defaultlibs}"
+
 AC_CONFIG_FILES([Makefile
                  kernel/Makefile
                  modules/Makefile
@@ -410,8 +405,11 @@
                  samples/Makefile
                  test/Makefile
                  test/store-scheme/Makefile
+                 test/store-cpp/Makefile
                  test/store-python/Makefile
+                 test/store-java/Makefile
                  doc/Makefile
                  doc/Doxyfile
                  ])
 AC_OUTPUT
+

Modified: tuscany/sca-cpp/trunk/kernel/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/kernel/Makefile.am Sun Jan 17 09:02:57 2010
@@ -34,9 +34,9 @@
 parallel_test_SOURCES = parallel-test.cpp
 
 xml_test_SOURCES = xml-test.cpp
-xml_test_LDADD = -lxml2
+xml_test_LDFLAGS = -lxml2
 
 xsd_test_SOURCES = xsd-test.cpp
-xsd_test_LDADD = -lxml2
+xsd_test_LDFLAGS = -lxml2
 
 TESTS = string-test kernel-test mem-test parallel-test xml-test

Modified: tuscany/sca-cpp/trunk/modules/atom/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/atom/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/atom/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/atom/Makefile.am Sun Jan 17 09:02:57 2010
@@ -18,6 +18,6 @@
 noinst_PROGRAMS = atom-test
 
 atom_test_SOURCES = atom-test.cpp
-atom_test_LDADD = -lxml2
+atom_test_LDFLAGS = -lxml2
 
 TESTS = atom-test

Modified: tuscany/sca-cpp/trunk/modules/http/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/http/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/http/Makefile.am Sun Jan 17 09:02:57 2010
@@ -20,6 +20,6 @@
 INCLUDES = -I${HTTPD_INCLUDE}
 
 curl_test_SOURCES = curl-test.cpp
-curl_test_LDADD = -lxml2 -lcurl -lmozjs
+curl_test_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 TESTS = httpd-test http-test

Modified: tuscany/sca-cpp/trunk/modules/java/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/java/Makefile.am Sun Jan 17 09:02:57 2010
@@ -17,23 +17,30 @@
 
 datadir=$(prefix)/modules/java
 JAVAROOT = $(top_builddir)/modules/java
+libdir=$(prefix)/lib
 
 if WANT_JAVA
 
-noinst_PROGRAMS = java-test java-shell
+noinst_PROGRAMS = java-test java-shell client-test
+
+lib_LTLIBRARIES = libmod_tuscany_java.la
 
 INCLUDES = -I${JAVA_INCLUDE}
 
+libmod_tuscany_java_la_SOURCES = mod-java.cpp
+libmod_tuscany_java_la_LDFLAGS = -lxml2 -lcurl -lmozjs -L${JAVA_LIB} -R${JAVA_LIB} -R${JAVA_LIB}/server -ljava
+
 java_test_SOURCES = java-test.cpp
-java_test_LDADD =  -L${JAVA_LIB} -ljava
-java_test_LDFLAGS = -rpath ${JAVA_LIB} -rpath ${JAVA_LIB}/server
+java_test_LDFLAGS = -L${JAVA_LIB} -R${JAVA_LIB} -R${JAVA_LIB}/server -ljava
 
 java_shell_SOURCES = java-shell.cpp
-java_shell_LDADD = -L${JAVA_LIB} -ljava
-java_shell_LDFLAGS = -rpath ${JAVA_LIB} -rpath ${JAVA_LIB}/server
+java_shell_LDFLAGS = -L${JAVA_LIB} -R${JAVA_LIB} -R${JAVA_LIB}/server -ljava
 
 noinst_JAVA = org/apache/tuscany/*.java test/*.java
 
-TESTS = java-test
+client_test_SOURCES = client-test.cpp
+client_test_LDFLAGS = -lxml2 -lcurl -lmozjs
+
+TESTS = java-test server-test
 
-endif
\ No newline at end of file
+endif

Copied: tuscany/sca-cpp/trunk/modules/java/server-test (from r900072, tuscany/sca-cpp/trunk/modules/python/server-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/server-test?p2=tuscany/sca-cpp/trunk/modules/java/server-test&p1=tuscany/sca-cpp/trunk/modules/python/server-test&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/server-test (original)
+++ tuscany/sca-cpp/trunk/modules/java/server-test Sun Jan 17 09:02:57 2010
@@ -18,9 +18,9 @@
 #  under the License.
 
 # Setup
-../http/httpd-conf tmp 8090 htdocs
+../http/httpd-conf tmp 8090 ../server/htdocs
 ../server/server-conf tmp
-./python-conf tmp
+./java-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF
 
 <Location />

Added: tuscany/sca-cpp/trunk/modules/java/wiring-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/java/wiring-test?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/java/wiring-test (added)
+++ tuscany/sca-cpp/trunk/modules/java/wiring-test Sun Jan 17 09:02:57 2010
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#    
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+echo "Testing..."
+
+# Setup
+../http/httpd-conf tmp 8090 ../server/htdocs
+../server/server-conf tmp
+./java-conf tmp
+cat >>tmp/conf/httpd.conf <<EOF
+
+<Location />
+SCAContribution `pwd`/
+SCAComposite domain-test.composite
+</Location>
+EOF
+
+apachectl -k start -d `pwd`/tmp
+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=$?
+
+# 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
+    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
+    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
+    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
+    rc=$?
+fi
+if [ "$rc" = "0" ]; then
+    curl http://localhost:8090/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
+    rc=$?
+fi
+
+# Cleanup
+apachectl -k stop -d `pwd`/tmp
+sleep 2
+if [ "$rc" = "0" ]; then
+    echo "OK"
+fi
+return $rc

Propchange: tuscany/sca-cpp/trunk/modules/java/wiring-test
------------------------------------------------------------------------------
    svn:executable = *

Modified: tuscany/sca-cpp/trunk/modules/json/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/json/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/json/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/json/Makefile.am Sun Jan 17 09:02:57 2010
@@ -18,6 +18,6 @@
 noinst_PROGRAMS = json-test
 
 json_test_SOURCES = json-test.cpp
-json_test_LDADD = -lmozjs 
+json_test_LDFLAGS = -lmozjs 
 
 TESTS = json-test

Modified: tuscany/sca-cpp/trunk/modules/python/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/python/Makefile.am Sun Jan 17 09:02:57 2010
@@ -29,16 +29,16 @@
 INCLUDES = -I${PYTHON_INCLUDE}
 
 libmod_tuscany_python_la_SOURCES = mod-python.cpp
-libmod_tuscany_python_la_LIBADD = -lxml2 -lcurl -lmozjs -L${PYTHON_LIB} -lpython2.6
+libmod_tuscany_python_la_LDFLAGS = -lxml2 -lcurl -lmozjs -L${PYTHON_LIB} -R${PYTHON_LIB} -lpython2.6
 
 python_test_SOURCES = python-test.cpp
-python_test_LDADD = -L${PYTHON_LIB} -lpython2.6
+python_test_LDFLAGS = -L${PYTHON_LIB} -R${PYTHON_LIB} -lpython2.6
 
 python_shell_SOURCES = python-shell.cpp
-python_shell_LDADD = -L${PYTHON_LIB} -lpython2.6
+python_shell_LDFLAGS = -L${PYTHON_LIB} -R${PYTHON_LIB} -lpython2.6
 
 client_test_SOURCES = client-test.cpp
-client_test_LDADD = -lxml2 -lcurl -lmozjs
+client_test_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 TESTS = python-test server-test
 

Modified: tuscany/sca-cpp/trunk/modules/python/python-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/python-conf?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/python-conf (original)
+++ tuscany/sca-cpp/trunk/modules/python/python-conf Sun Jan 17 09:02:57 2010
@@ -17,13 +17,10 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
+# Generate a Python server conf
 here=`readlink -f $0`; here=`dirname $here`
 root=`readlink -f $1`
 
-mkdir -p $root
-mkdir -p $root/logs
-mkdir -p $root/conf
 cat >>$root/conf/httpd.conf <<EOF
 LoadModule mod_tuscany_eval $here/.libs/libmod_tuscany_python.so
 EOF

Modified: tuscany/sca-cpp/trunk/modules/python/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/server-test?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/server-test (original)
+++ tuscany/sca-cpp/trunk/modules/python/server-test Sun Jan 17 09:02:57 2010
@@ -18,7 +18,7 @@
 #  under the License.
 
 # Setup
-../http/httpd-conf tmp 8090 htdocs
+../http/httpd-conf tmp 8090 ../server/htdocs
 ../server/server-conf tmp
 ./python-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF

Added: tuscany/sca-cpp/trunk/modules/python/wiring-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/wiring-test?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/wiring-test (added)
+++ tuscany/sca-cpp/trunk/modules/python/wiring-test Sun Jan 17 09:02:57 2010
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#    
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+echo "Testing..."
+
+# Setup
+../http/httpd-conf tmp 8090 ../server/htdocs
+../server/server-conf tmp
+./python-conf tmp
+cat >>tmp/conf/httpd.conf <<EOF
+
+<Location />
+SCAContribution `pwd`/
+SCAComposite domain-test.composite
+</Location>
+EOF
+
+apachectl -k start -d `pwd`/tmp
+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=$?
+
+# 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
+    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
+    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
+    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
+    rc=$?
+fi
+if [ "$rc" = "0" ]; then
+    curl http://localhost:8090/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
+    rc=$?
+fi
+
+# Cleanup
+apachectl -k stop -d `pwd`/tmp
+sleep 2
+if [ "$rc" = "0" ]; then
+    echo "OK"
+fi
+return $rc

Propchange: tuscany/sca-cpp/trunk/modules/python/wiring-test
------------------------------------------------------------------------------
    svn:executable = *

Modified: tuscany/sca-cpp/trunk/modules/scdl/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/scdl/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/scdl/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/scdl/Makefile.am Sun Jan 17 09:02:57 2010
@@ -18,6 +18,6 @@
 noinst_PROGRAMS = scdl-test
 
 scdl_test_SOURCES = scdl-test.cpp
-scdl_test_LDADD = -lxml2
+scdl_test_LDFLAGS = -lxml2
 
 TESTS = scdl-test

Modified: tuscany/sca-cpp/trunk/modules/server/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/server/Makefile.am Sun Jan 17 09:02:57 2010
@@ -23,10 +23,10 @@
 INCLUDES = -I${HTTPD_INCLUDE}
 
 libmod_tuscany_eval_la_SOURCES = mod-eval.cpp
-libmod_tuscany_eval_la_LIBADD = -lxml2 -lcurl -lmozjs
+libmod_tuscany_eval_la_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 libmod_tuscany_wiring_la_SOURCES = mod-wiring.cpp
-libmod_tuscany_wiring_la_LIBADD = -lxml2 -lcurl -lmozjs
+libmod_tuscany_wiring_la_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 testdir=$(prefix)/test
 test_LTLIBRARIES = libimpl-test.la
@@ -34,6 +34,6 @@
 libimpl_test_la_SOURCES = impl-test.cpp
 
 client_test_SOURCES = client-test.cpp
-client_test_LDADD = -lxml2 -lcurl -lmozjs
+client_test_LDFLAGS = -lxml2 -lcurl -lmozjs
 
 TESTS = httpd-test server-test wiring-test

Copied: tuscany/sca-cpp/trunk/modules/server/cpp-conf (from r900072, tuscany/sca-cpp/trunk/modules/server/scheme-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/cpp-conf?p2=tuscany/sca-cpp/trunk/modules/server/cpp-conf&p1=tuscany/sca-cpp/trunk/modules/server/scheme-conf&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/scheme-conf (original)
+++ tuscany/sca-cpp/trunk/modules/server/cpp-conf Sun Jan 17 09:02:57 2010
@@ -17,7 +17,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a scheme server conf
+# Generate a C++ server conf
 here=`readlink -f $0`; here=`dirname $here`
 root=`readlink -f $1`
 

Modified: tuscany/sca-cpp/trunk/modules/server/scheme-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/scheme-conf?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/scheme-conf (original)
+++ tuscany/sca-cpp/trunk/modules/server/scheme-conf Sun Jan 17 09:02:57 2010
@@ -17,7 +17,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a scheme server conf
+# Generate a Scheme server conf
 here=`readlink -f $0`; here=`dirname $here`
 root=`readlink -f $1`
 

Modified: tuscany/sca-cpp/trunk/test/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/Makefile.am Sun Jan 17 09:02:57 2010
@@ -15,5 +15,5 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-SUBDIRS = store-scheme store-python
+SUBDIRS = store-scheme store-cpp store-python store-java
 

Copied: tuscany/sca-cpp/trunk/test/store-cpp/Makefile.am (from r900072, tuscany/sca-cpp/trunk/modules/http/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/Makefile.am?p2=tuscany/sca-cpp/trunk/test/store-cpp/Makefile.am&p1=tuscany/sca-cpp/trunk/modules/http/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/http/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-cpp/Makefile.am Sun Jan 17 09:02:57 2010
@@ -15,11 +15,13 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-noinst_PROGRAMS = curl-test
+testdir=$(prefix)/test/store-cpp
+test_LTLIBRARIES = libcurrency-converter.la libfruits-catalog.la libshopping-cart.la
 
-INCLUDES = -I${HTTPD_INCLUDE}
+libcurrency_converter_la_SOURCES = currency-converter.cpp
 
-curl_test_SOURCES = curl-test.cpp
-curl_test_LDADD = -lxml2 -lcurl -lmozjs
+libfruits_catalog_la_SOURCES = fruits-catalog.cpp
 
-TESTS = httpd-test http-test
+libshopping_cart_la_SOURCES = shopping-cart.cpp
+
+TESTS = server-test

Added: tuscany/sca-cpp/trunk/test/store-cpp/currency-converter.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/currency-converter.cpp?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-cpp/currency-converter.cpp (added)
+++ tuscany/sca-cpp/trunk/test/store-cpp/currency-converter.cpp Sun Jan 17 09:02:57 2010
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+/**
+ * Currency converter component implementation.
+ */
+
+#include "string.hpp"
+#include "function.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+
+namespace tuscany {
+namespace store {
+
+/**
+ * Convert an amount from USD to a currency.
+ */
+const failable<value> convert(unused const value& from, const value& to, const value& amount) {
+    if (to == string("EUR"))
+        return value(0.70 * (double)amount);
+    return amount;
+}
+
+/**
+ * Return a currency symbol.
+ */
+const failable<value> symbol(const value& currency) {
+    if (currency == string("EUR"))
+        return value(string("E"));
+    return value(string("$"));
+}
+
+}
+}
+
+extern "C" {
+
+const tuscany::value apply(const tuscany::list<tuscany::value>& params) {
+    const tuscany::value func(car(params));
+    if (func == "convert")
+        return tuscany::store::convert(cadr(params), caddr(params), cadddr(params));
+    if (func == "symbol")
+        return tuscany::store::symbol(cadr(params));
+    return tuscany::mkfailure<tuscany::value>(tuscany::string("Function not supported: ") + func);
+}
+
+}

Added: tuscany/sca-cpp/trunk/test/store-cpp/fruits-catalog.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/fruits-catalog.cpp?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-cpp/fruits-catalog.cpp (added)
+++ tuscany/sca-cpp/trunk/test/store-cpp/fruits-catalog.cpp Sun Jan 17 09:02:57 2010
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+/**
+ * Catalog component implementation.
+ */
+
+#include "string.hpp"
+#include "function.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+
+namespace tuscany {
+namespace store {
+
+/**
+ * Returns a catalog.
+ */
+struct convert {
+    const lambda<value(const list<value>&)> converter;
+    const string currency;
+    convert(const lambda<value(const list<value>&)>& converter, const string& currency) : converter(converter), currency(currency) {
+    }
+    const value operator()(const value& price) const {
+        return converter(mklist<value>("convert", string("USD"), currency, price));
+    }
+};
+
+const list<value> mkfruit(const string& name, const string& code, const string& symbol, const double price) {
+    return list<value>() +
+        mklist<value>("javaClass", string("services.Item")) + mklist<value>("name", name) + mklist<value>("currencyCode", code) + mklist<value>("currencySymbol", symbol) + mklist<value>("price", price);
+}
+
+const failable<value> get(const lambda<value(const list<value>&)> converter) {
+    const string currency("USD");
+    const string symbol(converter(mklist<value>("symbol", currency)));
+    const lambda<value(const value&)> conv(convert(converter, currency));
+
+    return value(list<value>() +
+        mkfruit("Apple", currency, symbol, conv(2.99)) +
+        mkfruit("Orange", currency, symbol, conv(3.55)) +
+        mkfruit("Pear", currency, symbol, conv(1.55)));
+}
+
+const failable<value> listMethods(unused const lambda<value(const list<value>&)> converter) {
+    return value(mklist<value>(string("Service.get")));
+}
+
+}
+}
+
+extern "C" {
+
+const tuscany::value apply(const tuscany::list<tuscany::value>& params) {
+    const tuscany::value func(car(params));
+    if (func == "get")
+        return tuscany::store::get(cadr(params));
+    if (func == "listMethods")
+        return tuscany::store::listMethods(cadr(params));
+    return tuscany::mkfailure<tuscany::value>(tuscany::string("Function not supported: ") + func);
+}
+
+}

Copied: tuscany/sca-cpp/trunk/test/store-cpp/htdocs/.htaccess (from r900072, tuscany/sca-cpp/trunk/test/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/htdocs/.htaccess?p2=tuscany/sca-cpp/trunk/test/store-cpp/htdocs/.htaccess&p1=tuscany/sca-cpp/trunk/test/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-cpp/htdocs/.htaccess Sun Jan 17 09:02:57 2010
@@ -1,3 +1,4 @@
+#
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -15,5 +16,4 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-SUBDIRS = store-scheme store-python
-
+DirectoryIndex store.html

Added: tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.html?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.html (added)
+++ tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.html Sun Jan 17 09:02:57 2010
@@ -0,0 +1,169 @@
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<html>
+<head>
+<title>Store</title>
+
+<script type="text/javascript" src="store.js"></script>
+
+<script language="JavaScript">
+
+	//@Reference
+	var catalog = new tuscany.sca.Reference("catalog");
+	
+	//@Reference
+	var shoppingCart = new tuscany.sca.Reference("shoppingCart");
+
+	//@Reference
+	var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
+	
+	var catalogItems;
+
+	function catalog_getResponse(items,exception) {
+		if(exception){
+			alert(exception.message);
+			return;
+		}
+		var catalog = "";
+		
+		for (var i=0; i<items.length; i++) {
+			var item = items[i].name + ' - ' + items[i].price;
+			catalog += '<input name="items" type="checkbox" value="' + 
+						item + '">' + item + ' <br>';
+		}
+		document.getElementById('catalog').innerHTML=catalog;
+		catalogItems = items;
+
+		// TEMP		
+		shoppingTotal.gettotal(shoppingTotal_getTotalResponse);
+	}
+	
+	function shoppingCart_getResponse(feed) {
+		if (feed != null) {
+			var entries = feed.getElementsByTagName("entry"); 
+			var list = "";
+			for (var i=0; i<entries.length; i++) {
+				var content = entries[i].getElementsByTagName("content")[0];
+				var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
+				var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
+				list += name + ' - ' + price + ' <br>';
+			}
+			document.getElementById("shoppingCart").innerHTML = list;
+
+			if (entries.length != 0) {			
+					try	{
+						shoppingTotal.gettotal(shoppingTotal_getTotalResponse);
+					}
+					catch(e){
+						alert(e);
+					}
+			}
+		}
+	}
+	
+	function shoppingTotal_getTotalResponse(total,exception) {
+		if(exception) { 
+			alert(exception.message); 
+			return;
+		}
+		document.getElementById('total').innerHTML = total;
+	}
+	
+	function shoppingCart_postResponse(entry) {
+		shoppingCart.get("", shoppingCart_getResponse);
+	}				
+
+	function addToCart() {
+		var items  = document.catalogForm.items;
+		var j = 0;
+		for (var i=0; i<items.length; i++)
+			if (items[i].checked) {
+				var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title type="text">Item</title><content type="application/xml">' +
+                '<item>' +
+                '<javaClass>' + catalogItems[i].javaClass + '</javaClass>' +
+                '<name>' + catalogItems[i].name + '</name>' +
+                '<currencyCode>' + catalogItems[i].currencyCode + '</currencyCode>' +
+                '<currencySymbol>' + catalogItems[i].currencySymbol + '</currencySymbol>' +
+                '<price>' + catalogItems[i].price + '</price>' +
+                '</item>' +
+                '</content></entry>';
+				shoppingCart.post(entry, shoppingCart_postResponse);
+				items[i].checked = false;
+			}
+	}
+	function checkoutCart() {
+		document.getElementById('store').innerHTML='<h2>' +
+				'Thanks for Shopping With Us!</h2>'+
+				'<h2>Your Order</h2>'+
+				'<form name="orderForm">'+
+					document.getElementById('shoppingCart').innerHTML+
+					'<br>'+
+					document.getElementById('total').innerHTML+
+					'<br>'+
+					'<br>'+
+					'<input type="submit" value="Continue Shopping">'+ 
+				'</form>';
+		shoppingCart.del("", null);
+	}
+	function deleteCart() {
+		shoppingCart.del("", null);
+		document.getElementById('shoppingCart').innerHTML = "";
+		document.getElementById('total').innerHTML = "";	
+	}	
+
+	function init() {
+			
+			try	{
+				catalog.get(catalog_getResponse);
+				shoppingCart.get("", shoppingCart_getResponse);
+			}
+			catch(e){
+				alert(e);
+			}
+		}
+	
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Store</h1>
+  <div id="store">
+   	<h2>Catalog</h2>
+   	<form name="catalogForm">
+		<div id="catalog" ></div>
+		<br>
+		<input type="button" onClick="addToCart()"  value="Add to Cart">
+   	</form>
+ 
+ 	<br>
+  
+   	<h2>Your Shopping Cart</h2>
+   	<form name="shoppingCartForm">
+		<div id="shoppingCart"></div>
+		<br>
+		<div id="total"></div>
+		<br>		
+		<input type="button" onClick="checkoutCart()" value="Checkout"> 
+		<input type="button" onClick="deleteCart()" value="Empty">     
+	   	<a href="../shoppingCart/">(feed)</a>
+	</form>    
+  </div>
+</body>
+</html>

Added: tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.js?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.js (added)
+++ tuscany/sca-cpp/trunk/test/store-cpp/htdocs/store.js Sun Jan 17 09:02:57 2010
@@ -0,0 +1,661 @@
+
+/* Apache Tuscany SCA Widget header */
+
+/*
+ * JSON-RPC JavaScript client
+ *
+ * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $
+ *
+ * Copyright (c) 2003-2004 Jan-Klaas Kollhof
+ * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd
+ *
+ * This code is based on Jan-Klaas' JavaScript o lait library (jsolait).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*
+ * Modifications for Apache Tuscany:
+ * - JSONRpcClient_createMethod changed so callback is last arg
+ */
+
+/* escape a character */
+
+escapeJSONChar =
+function escapeJSONChar(c)
+{
+    if(c == "\"" || c == "\\") return "\\" + c;
+    else if (c == "\b") return "\\b";
+    else if (c == "\f") return "\\f";
+    else if (c == "\n") return "\\n";
+    else if (c == "\r") return "\\r";
+    else if (c == "\t") return "\\t";
+    var hex = c.charCodeAt(0).toString(16);
+    if(hex.length == 1) return "\\u000" + hex;
+    else if(hex.length == 2) return "\\u00" + hex;
+    else if(hex.length == 3) return "\\u0" + hex;
+    else return "\\u" + hex;
+};
+
+
+/* encode a string into JSON format */
+
+escapeJSONString =
+function escapeJSONString(s)
+{
+    /* The following should suffice but Safari's regex is b0rken
+       (doesn't support callback substitutions)
+       return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g,
+       escapeJSONChar) + "\"";
+    */
+
+    /* Rather inefficient way to do it */
+    var parts = s.split("");
+    for(var i=0; i < parts.length; i++) {
+	var c =parts[i];
+	if(c == '"' ||
+	   c == '\\' ||
+	   c.charCodeAt(0) < 32 ||
+	   c.charCodeAt(0) >= 128)
+	    parts[i] = escapeJSONChar(parts[i]);
+    }
+    return "\"" + parts.join("") + "\"";
+};
+
+
+/* Marshall objects to JSON format */
+
+toJSON = function toJSON(o)
+{
+    if(o == null) {
+	return "null";
+    } else if(o.constructor == String) {
+	return escapeJSONString(o);
+    } else if(o.constructor == Number) {
+	return o.toString();
+    } else if(o.constructor == Boolean) {
+	return o.toString();
+    } else if(o.constructor == Date) {
+	return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}';
+    } else if(o.constructor == Array) {
+	var v = [];
+	for(var i = 0; i < o.length; i++) v.push(toJSON(o[i]));
+	return "[" + v.join(", ") + "]";
+    } else {
+	var v = [];
+	for(attr in o) {
+	    if(o[attr] == null) v.push("\"" + attr + "\": null");
+	    else if(typeof o[attr] == "function"); /* skip */
+	    else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr]));
+	}
+	return "{" + v.join(", ") + "}";
+    }
+};
+
+
+/* JSONRpcClient constructor */
+
+JSONRpcClient =
+function JSONRpcClient_ctor(serverURL, user, pass, objectID)
+{
+    this.serverURL = serverURL;
+    this.user = user;
+    this.pass = pass;
+    this.objectID = objectID;
+
+    /* Add standard methods */
+    if(this.objectID) {
+	this._addMethods(["listMethods"]);
+	var req = this._makeRequest("listMethods", []);
+    } else {
+	this._addMethods(["system.listMethods"]);
+	var req = this._makeRequest("system.listMethods", []);
+    }
+    var m = this._sendRequest(req);
+    this._addMethods(m);
+};
+
+
+/* JSONRpcCLient.Exception */
+
+JSONRpcClient.Exception =
+function JSONRpcClient_Exception_ctor(code, message, javaStack)
+{
+    this.code = code;
+    var name;
+    if(javaStack) {
+	this.javaStack = javaStack;
+	var m = javaStack.match(/^([^:]*)/);
+	if(m) name = m[0];
+    }
+    if(name) this.name = name;
+    else this.name = "JSONRpcClientException";
+    this.message = message;
+};
+
+JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490;
+JSONRpcClient.Exception.CODE_ERR_CLIENT = 550;
+JSONRpcClient.Exception.CODE_ERR_PARSE = 590;
+JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591;
+JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592;
+JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593;
+
+JSONRpcClient.Exception.prototype = new Error();
+
+JSONRpcClient.Exception.prototype.toString =
+function JSONRpcClient_Exception_toString(code, msg)
+{
+    return this.name + ": " + this.message;
+};
+
+
+/* Default top level exception handler */
+
+JSONRpcClient.default_ex_handler =
+function JSONRpcClient_default_ex_handler(e) { alert(e); };
+
+
+/* Client settable variables */
+
+JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler;
+JSONRpcClient.profile_async = false;
+JSONRpcClient.max_req_active = 1;
+JSONRpcClient.requestId = 1;
+
+
+/* JSONRpcClient implementation */
+
+JSONRpcClient.prototype._createMethod =
+function JSONRpcClient_createMethod(methodName)
+{
+    var fn=function()
+    {
+	var args = [];
+	var callback = null;
+	for(var i=0;i<arguments.length;i++) args.push(arguments[i]);
+
+/*	TUSCANY change callback to be last arg instead of first to match binding.ajax
+	if(typeof args[0] == "function") callback = args.shift();
+*/
+	if(typeof args[arguments.length-1] == "function") callback = args.pop();
+
+	var req = fn.client._makeRequest.call(fn.client, fn.methodName,
+					      args, callback);
+	if(callback == null) {
+	    return fn.client._sendRequest.call(fn.client, req);
+	} else {
+	    JSONRpcClient.async_requests.push(req);
+	    JSONRpcClient.kick_async();
+	    return req.requestId;
+	}
+    };
+    fn.client = this;
+    fn.methodName = methodName;
+    return fn;
+};
+
+JSONRpcClient.prototype._addMethods =
+function JSONRpcClient_addMethods(methodNames)
+{
+    for(var i=0; i<methodNames.length; i++) {
+	var obj = this;
+	var names = methodNames[i].split(".");
+	for(var n=0; n<names.length-1; n++) {
+	    var name = names[n];
+	    if(obj[name]) {
+		obj = obj[name];
+	    } else {
+		obj[name]  = new Object();
+		obj = obj[name];
+	    }
+	}
+	var name = names[names.length-1];
+	if(!obj[name]) {
+	    var method = this._createMethod(methodNames[i]);
+	    obj[name] = method;
+	}
+    }
+};
+
+JSONRpcClient._getCharsetFromHeaders =
+function JSONRpcClient_getCharsetFromHeaders(http)
+{
+    try {
+	var contentType = http.getResponseHeader("Content-type");
+	var parts = contentType.split(/\s*;\s*/);
+	for(var i =0; i < parts.length; i++) {
+	    if(parts[i].substring(0, 8) == "charset=")
+		return parts[i].substring(8, parts[i].length);
+	}
+    } catch (e) {}
+    return "UTF-8"; /* default */
+};
+
+/* Async queue globals */
+JSONRpcClient.async_requests = [];
+JSONRpcClient.async_inflight = {};
+JSONRpcClient.async_responses = [];
+JSONRpcClient.async_timeout = null;
+JSONRpcClient.num_req_active = 0;
+
+JSONRpcClient._async_handler =
+function JSONRpcClient_async_handler()
+{
+    JSONRpcClient.async_timeout = null;
+
+    while(JSONRpcClient.async_responses.length > 0) {
+	var res = JSONRpcClient.async_responses.shift();
+	if(res.canceled) continue;
+	if(res.profile) res.profile.dispatch = new Date();
+	try {
+	    res.cb(res.result, res.ex, res.profile);
+	} catch(e) {
+	    JSONRpcClient.toplevel_ex_handler(e);
+	}
+    }
+
+    while(JSONRpcClient.async_requests.length > 0 &&
+	  JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) {
+	var req = JSONRpcClient.async_requests.shift();
+	if(req.canceled) continue;
+	req.client._sendRequest.call(req.client, req);
+    }
+};
+
+JSONRpcClient.kick_async =
+function JSONRpcClient_kick_async()
+{
+    if(JSONRpcClient.async_timeout == null)
+	JSONRpcClient.async_timeout =
+	    setTimeout(JSONRpcClient._async_handler, 0);
+};
+
+JSONRpcClient.cancelRequest =
+function JSONRpcClient_cancelRequest(requestId)
+{
+    /* If it is in flight then mark it as canceled in the inflight map
+       and the XMLHttpRequest callback will discard the reply. */
+    if(JSONRpcClient.async_inflight[requestId]) {
+	JSONRpcClient.async_inflight[requestId].canceled = true;
+	return true;
+    }
+
+    /* If its not in flight yet then we can just mark it as canceled in
+       the the request queue and it will get discarded before being sent. */
+    for(var i in JSONRpcClient.async_requests) {
+	if(JSONRpcClient.async_requests[i].requestId == requestId) {
+	    JSONRpcClient.async_requests[i].canceled = true;
+	    return true;
+	}
+    }
+
+    /* It may have returned from the network and be waiting for its callback
+       to be dispatched, so mark it as canceled in the response queue
+       and the response will get discarded before calling the callback. */
+    for(var i in JSONRpcClient.async_responses) {
+	if(JSONRpcClient.async_responses[i].requestId == requestId) {
+	    JSONRpcClient.async_responses[i].canceled = true;
+	    return true;
+	}
+    }
+
+    return false;
+};
+
+JSONRpcClient.prototype._makeRequest =
+function JSONRpcClient_makeRequest(methodName, args, cb)
+{
+    var req = {};
+    req.client = this;
+    req.requestId = JSONRpcClient.requestId++;
+
+    var obj = {};
+    obj.id = req.requestId;
+    if (this.objectID)
+	obj.method = ".obj#" + this.objectID + "." + methodName;
+    else
+	obj.method = methodName;
+    obj.params = args;
+
+    if (cb) req.cb = cb;
+    if (JSONRpcClient.profile_async)
+	req.profile = { "submit": new Date() };
+    req.data = toJSON(obj);
+
+    return req;
+};
+
+JSONRpcClient.prototype._sendRequest =
+function JSONRpcClient_sendRequest(req)
+{
+    if(req.profile) req.profile.start = new Date();
+
+    /* Get free http object from the pool */
+    var http = JSONRpcClient.poolGetHTTPRequest();
+    JSONRpcClient.num_req_active++;
+
+    /* Send the request */
+    if (typeof(this.user) == "undefined") {
+	http.open("POST", this.serverURL, (req.cb != null));
+    } else {
+	http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass);
+    }
+
+    /* setRequestHeader is missing in Opera 8 Beta */
+    try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {}
+
+    /* Construct call back if we have one */
+    if(req.cb) {
+	var self = this;
+	http.onreadystatechange = function() {
+	    if(http.readyState == 4) {
+		http.onreadystatechange = function () {};
+		var res = { "cb": req.cb, "result": null, "ex": null};
+		if (req.profile) {
+		    res.profile = req.profile;
+		    res.profile.end = new Date();
+		}
+		try { res.result = self._handleResponse(http); }
+		catch(e) { res.ex = e; }
+		if(!JSONRpcClient.async_inflight[req.requestId].canceled)
+		    JSONRpcClient.async_responses.push(res);
+		delete JSONRpcClient.async_inflight[req.requestId];
+		JSONRpcClient.kick_async();
+	    }
+	};
+    } else {
+	http.onreadystatechange = function() {};
+    }
+
+    JSONRpcClient.async_inflight[req.requestId] = req;
+	
+    try {
+	http.send(req.data);
+    } catch(e) {
+	JSONRpcClient.poolReturnHTTPRequest(http);
+	JSONRpcClient.num_req_active--;
+	throw new JSONRpcClient.Exception
+	    (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
+    }
+
+    if(!req.cb) return this._handleResponse(http);
+};
+
+JSONRpcClient.prototype._handleResponse =
+function JSONRpcClient_handleResponse(http)
+{
+    /* Get the charset */
+    if(!this.charset) {
+	this.charset = JSONRpcClient._getCharsetFromHeaders(http);
+    }
+
+    /* Get request results */
+    var status, statusText, data;
+    try {
+	status = http.status;
+	statusText = http.statusText;
+	data = http.responseText;
+    } catch(e) {
+	JSONRpcClient.poolReturnHTTPRequest(http);
+	JSONRpcClient.num_req_active--;
+	JSONRpcClient.kick_async();
+	throw new JSONRpcClient.Exception
+	    (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed");
+    }
+
+    /* Return http object to the pool; */
+    JSONRpcClient.poolReturnHTTPRequest(http);
+    JSONRpcClient.num_req_active--;
+
+    /* Unmarshall the response */
+    if(status != 200) {
+	throw new JSONRpcClient.Exception(status, statusText);
+    }
+    var obj;
+    try {
+	eval("obj = " + data);
+    } catch(e) {
+	throw new JSONRpcClient.Exception(550, "error parsing result");
+    }
+    if(obj.error)
+	throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg,
+					  obj.error.trace);
+    var res = obj.result;
+
+    /* Handle CallableProxy */
+    if(res && res.objectID && res.JSONRPCType == "CallableReference")
+	return new JSONRpcClient(this.serverURL, this.user,
+				 this.pass, res.objectID);
+
+    return res;
+};
+
+
+/* XMLHttpRequest wrapper code */
+
+/* XMLHttpRequest pool globals */
+JSONRpcClient.http_spare = [];
+JSONRpcClient.http_max_spare = 8;
+
+JSONRpcClient.poolGetHTTPRequest =
+function JSONRpcClient_pool_getHTTPRequest()
+{
+    if(JSONRpcClient.http_spare.length > 0) {
+	return JSONRpcClient.http_spare.pop();
+    }
+    return JSONRpcClient.getHTTPRequest();
+};
+
+JSONRpcClient.poolReturnHTTPRequest =
+function JSONRpcClient_poolReturnHTTPRequest(http)
+{
+    if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare)
+	delete http;
+    else
+	JSONRpcClient.http_spare.push(http);
+};
+
+JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
+			     "MSXML2.XMLHTTP.4.0",
+			     "MSXML2.XMLHTTP.3.0",
+			     "MSXML2.XMLHTTP",
+			     "Microsoft.XMLHTTP" ];
+
+JSONRpcClient.getHTTPRequest =
+function JSONRpcClient_getHTTPRequest()
+{
+    /* Mozilla XMLHttpRequest */
+    try {
+	JSONRpcClient.httpObjectName = "XMLHttpRequest";
+	return new XMLHttpRequest();
+    } catch(e) {}
+
+    /* Microsoft MSXML ActiveX */
+    for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) {
+	try {
+	    JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i];
+	    return new ActiveXObject(JSONRpcClient.msxmlNames[i]);
+	} catch (e) {}
+    }
+
+    /* None found */
+    JSONRpcClient.httpObjectName = null;
+    throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object");
+};
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+	
+function AtomClient(uri) {
+
+	this.msxmlNames = [ "MSXML2.XMLHTTP.5.0",
+                        "MSXML2.XMLHTTP.4.0",
+                        "MSXML2.XMLHTTP.3.0",
+                        "MSXML2.XMLHTTP",
+                        "Microsoft.XMLHTTP" ];
+			            
+	this.uri=uri;
+	
+	this.get = function(id, responseFunction) {
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 200) {
+				    var strDocument = xhr.responseText;
+				    var xmlDocument = xhr.responseXML;
+				    if(!xmlDocument || xmlDocument.childNodes.length==0){ 
+                        xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml");
+                    } 
+                    if (responseFunction != null) responseFunction(xmlDocument);
+				} else {
+                    alert("get - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("GET", uri + '/' + id, true);
+		xhr.send(null);
+	}	
+
+	this.post = function (entry, responseFunction) {
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 201) {
+				    var strDocument = xhr.responseText;
+				    var xmlDocument = xhr.responseXML;
+				    if(!xmlDocument || xmlDocument.childNodes.length==0){ 
+                        xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml");
+                    } 
+					if (responseFunction != null) responseFunction(xmlDocument);
+				} else {
+					alert("post - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("POST", uri, true);
+		xhr.setRequestHeader("Content-Type", "application/atom+xml");
+		xhr.send(entry);
+	}	
+
+	this.put = function (id, entry, responseFunction) {
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 200) {
+				    var strDocument = xhr.responseText;
+				    var xmlDocument = xhr.responseXML;
+				    if(!xmlDocument || xmlDocument.childNodes.length==0){ 
+                        xmlDocument = (new DOMParser()).parseFromString(strDocument, "text/xml");
+                    } 
+					if (responseFunction != null) responseFunction(xmlDocument);
+				} else {
+					alert("put - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("PUT", uri + '/' + id, true);
+		xhr.setRequestHeader("Content-Type", "application/atom+xml");
+		xhr.send(entry);
+	}	
+
+	this.del = function (id, responseFunction) {       
+		var xhr = this.createXMLHttpRequest();
+		xhr.onreadystatechange = function() {
+			if (xhr.readyState == 4) {
+				if (xhr.status == 200) {
+					if (responseFunction != null) responseFunction();
+				} else {
+					alert("delete - Error getting data from the server");
+				}
+			}
+		}
+		xhr.open("DELETE", uri + '/' + id, true);		
+		xhr.send(null);
+	}
+	this.createXMLHttpRequest = function () {
+        /* Mozilla XMLHttpRequest */
+        try {return new XMLHttpRequest();} catch(e) {}      
+		
+        /* Microsoft MSXML ActiveX */
+        for (var i=0;i < this.msxmlNames.length; i++) {
+            try {return new ActiveXObject(this.msxmlNames[i]);} catch (e) {}
+        }
+        alert("XML http request not supported");
+        return null;
+	}
+	if (typeof DOMParser == "undefined") {
+	   DOMParser = function () {}
+	
+	   DOMParser.prototype.parseFromString = function (str, contentType) {
+	      if (typeof ActiveXObject != "undefined") {
+	         var d = new ActiveXObject("MSXML.DomDocument");
+	         d.loadXML(str);
+	         return d;
+	      } else if (typeof XMLHttpRequest != "undefined") {
+	         var req = new XMLHttpRequest;
+	         req.open("GET", "data:" + (contentType || "application/xml") +
+	                         ";charset=utf-8," + encodeURIComponent(str), false);
+	         if (req.overrideMimeType) {
+	            req.overrideMimeType(contentType);
+	         }
+	         req.send(null);
+	         return req.responseXML;
+	      }
+      }
+   }
+}
+
+
+
+/* Tuscany Reference/Property injection code */
+
+if (!tuscany) { 
+var tuscany = {}; 
+}
+if (!tuscany.sca) { 
+tuscany.sca = {}; 
+}
+
+tuscany.sca.propertyMap = new String();
+tuscany.sca.Property = function (name) {
+    return tuscany.sca.propertyMap[name];
+}
+
+tuscany.sca.referenceMap = new Object();
+tuscany.sca.referenceMap.catalog = new JSONRpcClient("/catalog").Service;
+tuscany.sca.referenceMap.shoppingCart = new AtomClient("/shoppingCart");
+tuscany.sca.referenceMap.shoppingTotal = new JSONRpcClient("/total").Service;
+tuscany.sca.Reference = function (name) {
+    return tuscany.sca.referenceMap[name];
+}
+
+/** End of Apache Tuscany SCA Widget */
+

Copied: tuscany/sca-cpp/trunk/test/store-cpp/server-test (from r900072, tuscany/sca-cpp/trunk/modules/python/python-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/server-test?p2=tuscany/sca-cpp/trunk/test/store-cpp/server-test&p1=tuscany/sca-cpp/trunk/modules/python/python-conf&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/python-conf (original)
+++ tuscany/sca-cpp/trunk/test/store-cpp/server-test Sun Jan 17 09:02:57 2010
@@ -17,13 +17,22 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+echo "Testing..."
 
-mkdir -p $root
-mkdir -p $root/logs
-mkdir -p $root/conf
-cat >>$root/conf/httpd.conf <<EOF
-LoadModule mod_tuscany_eval $here/.libs/libmod_tuscany_python.so
-EOF
+# Setup
+./start
+sleep 2
+
+# Test HTTP GET
+curl http://localhost:8090/store.html 2>/dev/null >tmp/store.html
+diff tmp/store.html htdocs/store.html
+rc=$?
+
+# Cleanup
+./stop
+sleep 2
+
+if [ "$rc" = "0" ]; then
+    echo "OK"
+fi
+return $rc

Added: tuscany/sca-cpp/trunk/test/store-cpp/shopping-cart.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/shopping-cart.cpp?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-cpp/shopping-cart.cpp (added)
+++ tuscany/sca-cpp/trunk/test/store-cpp/shopping-cart.cpp Sun Jan 17 09:02:57 2010
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+/**
+ * Shopping cart component implementation.
+ */
+
+#include <apr_general.h>
+#include <apr_uuid.h>
+#include "string.hpp"
+#include "function.hpp"
+#include "list.hpp"
+#include "value.hpp"
+#include "monad.hpp"
+
+namespace tuscany {
+namespace store {
+
+const string cartId("1234");
+
+/**
+ * Get the shopping cart from the cache. Return an empty
+ * cart if not found.
+ */
+const list<value> getcart(const value& id, const lambda<value(const list<value>&)> cache) {
+    const value cart = cache(mklist<value>("get", id));
+    if (isNil(cart))
+        return value(list<value>());
+    return (list<value>)cart;
+}
+
+/**
+ * Returns a UUID.
+ */
+const value uuid() {
+    apr_uuid_t uuid;
+    apr_uuid_get(&uuid);
+    char buf[APR_UUID_FORMATTED_LENGTH];
+    apr_uuid_format(buf, &uuid);
+    return string(buf, APR_UUID_FORMATTED_LENGTH);
+}
+
+/**
+ * Post a new item to the cart. Create a new cart if necessary.
+ */
+const failable<value> post(const value& item, const lambda<value(const list<value>&)> cache) {
+    const value id(uuid());
+    const list<value> newItem(mklist<value>(car<value>(item), id, caddr<value>(item)));
+    const list<value> cart(cons<value>(newItem, getcart(cartId, cache)));
+    cache(mklist<value>("put", cartId, cart));
+    return id;
+}
+
+/**
+ * Return the contents of the cart.
+ */
+const failable<value> getall(const lambda<value(const list<value>&)> cache) {
+    return value(append(mklist<value>(string("Your Cart"), cartId), getcart(cartId, cache)));
+}
+
+/**
+ * Find an item in the cart.
+ */
+const value find(const value& id, const list<value>& cart) {
+    if (isNil(cart))
+        return cons<value>(string("Item"), mklist<value>("0", list<value>()));
+    if (id == cadr<value>(car(cart)))
+        return car(cart);
+    return find(id, cdr(cart));
+}
+
+const failable<value> get(const value& id, const lambda<value(const list<value>&)> cache) {
+    return find(id, getcart(cartId, cache));
+}
+
+/**
+ * Delete the whole cart.
+ */
+const failable<value> delall(const lambda<value(const list<value>&)> cache) {
+    return cache(mklist<value>("delete", cartId));
+}
+
+/**
+ * Delete an item from the cart.
+ */
+const failable<value> del(unused const value& id, unused const lambda<value(const list<value>&)> cache) {
+    return value(true);
+}
+
+/**
+ * Return the price of an item.
+ */
+const double price(const list<value>& item) {
+    return cadr<value>(assoc<value>("price", caddr(item)));
+}
+
+/**
+ * Sum the prices of a list of items.
+ */
+const double sum(const list<value>& items) {
+    if (isNil(items))
+        return 0;
+    return price(car(items)) + sum(cdr(items));
+}
+
+/**
+ * Return the total price of the items in the cart.
+ */
+const failable<value> gettotal(const lambda<value(const list<value>&)> cache) {
+    const list<value> cart(getcart(cartId, cache));
+    return value(sum(cart));
+}
+
+/**
+ * TODO remove this JSON-RPC specific function.
+ */
+const failable<value> listMethods(unused const lambda<value(const list<value>&)> converter) {
+    return value(mklist<value>(string("Service.gettotal")));
+}
+
+}
+}
+
+extern "C" {
+
+const tuscany::value apply(const tuscany::list<tuscany::value>& params) {
+    const tuscany::value func(car(params));
+    if (func == "post")
+        return tuscany::store::post(cadr(params), caddr(params));
+    if (func == "getall")
+        return tuscany::store::getall(cadr(params));
+    if (func == "get")
+        return tuscany::store::get(cadr(params), caddr(params));
+    if (func == "deleteall")
+        return tuscany::store::delall(cadr(params));
+    if (func == "delete")
+        return tuscany::store::del(cadr(params), caddr(params));
+    if (func == "gettotal")
+        return tuscany::store::gettotal(cadr(params));
+    if (func == "listMethods")
+        return tuscany::store::listMethods(cadr(params));
+    return tuscany::mkfailure<tuscany::value>(tuscany::string("Function not supported: ") + func);
+}
+
+}

Copied: tuscany/sca-cpp/trunk/test/store-cpp/start (from r900072, tuscany/sca-cpp/trunk/modules/python/server-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/start?p2=tuscany/sca-cpp/trunk/test/store-cpp/start&p1=tuscany/sca-cpp/trunk/modules/python/server-test&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/server-test (original)
+++ tuscany/sca-cpp/trunk/test/store-cpp/start Sun Jan 17 09:02:57 2010
@@ -17,26 +17,19 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Setup
-../http/httpd-conf tmp 8090 htdocs
-../server/server-conf tmp
-./python-conf tmp
+../../modules/http/httpd-conf tmp 8090 htdocs
+../../modules/server/server-conf tmp
+../../modules/server/cpp-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF
 
 <Location />
 SCAContribution `pwd`/
-SCAComposite domain-test.composite
+SCAComposite store.composite
 </Location>
 EOF
 
 apachectl -k start -d `pwd`/tmp
-sleep 2
 
-# Test
-./client-test 2>/dev/null
-rc=$?
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+$mc &
 
-# Cleanup
-apachectl -k stop -d `pwd`/tmp
-sleep 2
-return $rc

Copied: tuscany/sca-cpp/trunk/test/store-cpp/stop (from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/stop?p2=tuscany/sca-cpp/trunk/test/store-cpp/stop&p1=tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-cpp/stop Sun Jan 17 09:02:57 2010
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -15,9 +17,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-noinst_PROGRAMS = script-test
-
-script_test_SOURCES = script-test.cpp
-script_test_LDADD = -lxml2 -lmozjs
+apachectl -k stop -d `pwd`/tmp
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+kill `ps -f | grep -v grep | grep "$mc" | awk '{ print $2 }'`
 
-TESTS = script-test server-test

Propchange: tuscany/sca-cpp/trunk/test/store-cpp/stop
------------------------------------------------------------------------------
    svn:executable = *

Added: tuscany/sca-cpp/trunk/test/store-cpp/store.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-cpp/store.composite?rev=900073&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-cpp/store.composite (added)
+++ tuscany/sca-cpp/trunk/test/store-cpp/store.composite Sun Jan 17 09:02:57 2010
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+  xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+  targetNamespace="http://store"
+  name="store">
+        
+    <component name="Catalog">
+        <implementation.cpp path=".libs" library="libfruits-catalog"/> 
+        <property name="currencyCode">USD</property>
+        <service name="Catalog">
+            <t:binding.jsonrpc uri="catalog"/>
+        </service>
+        <reference name="currencyConverter" target="CurrencyConverter"/>
+    </component> 
+     
+    <component name="ShoppingCart">
+        <implementation.cpp path=".libs" library="libshopping-cart"/>
+        <service name="ShoppingCart">
+            <t:binding.atom uri="shoppingCart"/>
+        </service>        
+        <service name="Total">
+            <t:binding.jsonrpc uri="total"/>
+        </service>        
+        <reference name="cache" target="Cache"/>
+    </component>
+    
+    <component name="CurrencyConverter">
+        <implementation.cpp path=".libs" library="libcurrency-converter"/>
+        <service name="CurrencyConverter">
+            <t:binding.jsonrpc uri="currencyConverter"/>
+        </service>        
+    </component>     
+
+    <component name="Cache">
+        <implementation.cpp path="../../components/cache/.libs" library="libmcache"/>
+        <service name="Cache">
+            <t:binding.atom uri="cache"/>
+        </service>
+    </component>     
+
+</composite>

Copied: tuscany/sca-cpp/trunk/test/store-java/Makefile.am (from r900072, tuscany/sca-cpp/trunk/test/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-java/Makefile.am?p2=tuscany/sca-cpp/trunk/test/store-java/Makefile.am&p1=tuscany/sca-cpp/trunk/test/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-java/Makefile.am Sun Jan 17 09:02:57 2010
@@ -15,5 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-SUBDIRS = store-scheme store-python
+if WANT_JAVA
 
+endif

Copied: tuscany/sca-cpp/trunk/test/store-java/server-test (from r900072, tuscany/sca-cpp/trunk/modules/python/python-conf)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-java/server-test?p2=tuscany/sca-cpp/trunk/test/store-java/server-test&p1=tuscany/sca-cpp/trunk/modules/python/python-conf&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/python-conf (original)
+++ tuscany/sca-cpp/trunk/test/store-java/server-test Sun Jan 17 09:02:57 2010
@@ -17,13 +17,22 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Generate a server conf
-here=`readlink -f $0`; here=`dirname $here`
-root=`readlink -f $1`
+echo "Testing..."
 
-mkdir -p $root
-mkdir -p $root/logs
-mkdir -p $root/conf
-cat >>$root/conf/httpd.conf <<EOF
-LoadModule mod_tuscany_eval $here/.libs/libmod_tuscany_python.so
-EOF
+# Setup
+./start
+sleep 2
+
+# Test HTTP GET
+curl http://localhost:8090/store.html 2>/dev/null >tmp/store.html
+diff tmp/store.html htdocs/store.html
+rc=$?
+
+# Cleanup
+./stop
+sleep 2
+
+if [ "$rc" = "0" ]; then
+    echo "OK"
+fi
+return $rc

Copied: tuscany/sca-cpp/trunk/test/store-java/start (from r900072, tuscany/sca-cpp/trunk/modules/python/server-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-java/start?p2=tuscany/sca-cpp/trunk/test/store-java/start&p1=tuscany/sca-cpp/trunk/modules/python/server-test&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/server-test (original)
+++ tuscany/sca-cpp/trunk/test/store-java/start Sun Jan 17 09:02:57 2010
@@ -17,26 +17,19 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Setup
-../http/httpd-conf tmp 8090 htdocs
-../server/server-conf tmp
-./python-conf tmp
+../../modules/http/httpd-conf tmp 8090 htdocs
+../../modules/server/server-conf tmp
+../../modules/java/java-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF
 
 <Location />
 SCAContribution `pwd`/
-SCAComposite domain-test.composite
+SCAComposite store.composite
 </Location>
 EOF
 
 apachectl -k start -d `pwd`/tmp
-sleep 2
 
-# Test
-./client-test 2>/dev/null
-rc=$?
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+$mc &
 
-# Cleanup
-apachectl -k stop -d `pwd`/tmp
-sleep 2
-return $rc

Copied: tuscany/sca-cpp/trunk/test/store-java/stop (from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-java/stop?p2=tuscany/sca-cpp/trunk/test/store-java/stop&p1=tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-java/stop Sun Jan 17 09:02:57 2010
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -15,9 +17,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-noinst_PROGRAMS = script-test
-
-script_test_SOURCES = script-test.cpp
-script_test_LDADD = -lxml2 -lmozjs
+apachectl -k stop -d `pwd`/tmp
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+kill `ps -f | grep -v grep | grep "$mc" | awk '{ print $2 }'`
 
-TESTS = script-test server-test

Propchange: tuscany/sca-cpp/trunk/test/store-java/stop
------------------------------------------------------------------------------
    svn:executable = *

Modified: tuscany/sca-cpp/trunk/test/store-python/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-python/server-test?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-python/server-test (original)
+++ tuscany/sca-cpp/trunk/test/store-python/server-test Sun Jan 17 09:02:57 2010
@@ -20,21 +20,7 @@
 echo "Testing..."
 
 # Setup
-../../modules/http/httpd-conf tmp 8090 htdocs
-../../modules/server/server-conf tmp
-../../modules/python/python-conf tmp
-cat >>tmp/conf/httpd.conf <<EOF
-
-<Location />
-SCAContribution `pwd`/
-SCAComposite store.composite
-</Location>
-EOF
-
-apachectl -k start -d `pwd`/tmp
-
-mc="memcached -l 127.0.0.1 -m 4 -p 11211"
-$mc &
+./start
 sleep 2
 
 # Test HTTP GET
@@ -43,9 +29,9 @@
 rc=$?
 
 # Cleanup
-apachectl -k stop -d `pwd`/tmp
-kill `ps -f | grep -v grep | grep "$mc" | awk '{ print $2 }'`
+./stop
 sleep 2
+
 if [ "$rc" = "0" ]; then
     echo "OK"
 fi

Copied: tuscany/sca-cpp/trunk/test/store-python/start (from r900072, tuscany/sca-cpp/trunk/modules/python/server-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-python/start?p2=tuscany/sca-cpp/trunk/test/store-python/start&p1=tuscany/sca-cpp/trunk/modules/python/server-test&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/server-test (original)
+++ tuscany/sca-cpp/trunk/test/store-python/start Sun Jan 17 09:02:57 2010
@@ -17,26 +17,19 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Setup
-../http/httpd-conf tmp 8090 htdocs
-../server/server-conf tmp
-./python-conf tmp
+../../modules/http/httpd-conf tmp 8090 htdocs
+../../modules/server/server-conf tmp
+../../modules/python/python-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF
 
 <Location />
 SCAContribution `pwd`/
-SCAComposite domain-test.composite
+SCAComposite store.composite
 </Location>
 EOF
 
 apachectl -k start -d `pwd`/tmp
-sleep 2
 
-# Test
-./client-test 2>/dev/null
-rc=$?
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+$mc &
 
-# Cleanup
-apachectl -k stop -d `pwd`/tmp
-sleep 2
-return $rc

Copied: tuscany/sca-cpp/trunk/test/store-python/stop (from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-python/stop?p2=tuscany/sca-cpp/trunk/test/store-python/stop&p1=tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-python/stop Sun Jan 17 09:02:57 2010
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -15,9 +17,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-noinst_PROGRAMS = script-test
-
-script_test_SOURCES = script-test.cpp
-script_test_LDADD = -lxml2 -lmozjs
+apachectl -k stop -d `pwd`/tmp
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+kill `ps -f | grep -v grep | grep "$mc" | awk '{ print $2 }'`
 
-TESTS = script-test server-test

Propchange: tuscany/sca-cpp/trunk/test/store-python/stop
------------------------------------------------------------------------------
    svn:executable = *

Modified: tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am Sun Jan 17 09:02:57 2010
@@ -18,6 +18,6 @@
 noinst_PROGRAMS = script-test
 
 script_test_SOURCES = script-test.cpp
-script_test_LDADD = -lxml2 -lmozjs
+script_test_LDFLAGS = -lxml2 -lmozjs
 
 TESTS = script-test server-test

Modified: tuscany/sca-cpp/trunk/test/store-scheme/server-test
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-scheme/server-test?rev=900073&r1=900072&r2=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-scheme/server-test (original)
+++ tuscany/sca-cpp/trunk/test/store-scheme/server-test Sun Jan 17 09:02:57 2010
@@ -20,21 +20,7 @@
 echo "Testing..."
 
 # Setup
-../../modules/http/httpd-conf tmp 8090 htdocs
-../../modules/server/server-conf tmp
-../../modules/server/scheme-conf tmp
-cat >>tmp/conf/httpd.conf <<EOF
-
-<Location />
-SCAContribution `pwd`/
-SCAComposite store.composite
-</Location>
-EOF
-
-apachectl -k start -d `pwd`/tmp
-
-mc="memcached -l 127.0.0.1 -m 4 -p 11211"
-$mc &
+./start
 sleep 2
 
 # Test HTTP GET
@@ -43,9 +29,9 @@
 rc=$?
 
 # Cleanup
-apachectl -k stop -d `pwd`/tmp
-kill `ps -f | grep -v grep | grep "$mc" | awk '{ print $2 }'`
+./stop
 sleep 2
+
 if [ "$rc" = "0" ]; then
     echo "OK"
 fi

Copied: tuscany/sca-cpp/trunk/test/store-scheme/start (from r900072, tuscany/sca-cpp/trunk/modules/python/server-test)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-scheme/start?p2=tuscany/sca-cpp/trunk/test/store-scheme/start&p1=tuscany/sca-cpp/trunk/modules/python/server-test&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/server-test (original)
+++ tuscany/sca-cpp/trunk/test/store-scheme/start Sun Jan 17 09:02:57 2010
@@ -17,26 +17,19 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Setup
-../http/httpd-conf tmp 8090 htdocs
-../server/server-conf tmp
-./python-conf tmp
+../../modules/http/httpd-conf tmp 8090 htdocs
+../../modules/server/server-conf tmp
+../../modules/server/scheme-conf tmp
 cat >>tmp/conf/httpd.conf <<EOF
 
 <Location />
 SCAContribution `pwd`/
-SCAComposite domain-test.composite
+SCAComposite store.composite
 </Location>
 EOF
 
 apachectl -k start -d `pwd`/tmp
-sleep 2
 
-# Test
-./client-test 2>/dev/null
-rc=$?
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+$mc &
 
-# Cleanup
-apachectl -k stop -d `pwd`/tmp
-sleep 2
-return $rc

Copied: tuscany/sca-cpp/trunk/test/store-scheme/stop (from r900072, tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/test/store-scheme/stop?p2=tuscany/sca-cpp/trunk/test/store-scheme/stop&p1=tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am&r1=900072&r2=900073&rev=900073&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/test/store-scheme/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/test/store-scheme/stop Sun Jan 17 09:02:57 2010
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -15,9 +17,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-noinst_PROGRAMS = script-test
-
-script_test_SOURCES = script-test.cpp
-script_test_LDADD = -lxml2 -lmozjs
+apachectl -k stop -d `pwd`/tmp
+mc="memcached -l 127.0.0.1 -m 4 -p 11211"
+kill `ps -f | grep -v grep | grep "$mc" | awk '{ print $2 }'`
 
-TESTS = script-test server-test

Propchange: tuscany/sca-cpp/trunk/test/store-scheme/stop
------------------------------------------------------------------------------
    svn:executable = *