You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/05/09 22:00:57 UTC

svn commit: r536637 - in /incubator/tuscany/java/sca/samples/simple-bigbank: README build.xml simple-bigbank.png simple-bigbank.svg src/main/java/bigbank/client/ src/main/java/bigbank/client/BigBankClient.java

Author: slaws
Date: Wed May  9 13:00:56 2007
New Revision: 536637

URL: http://svn.apache.org/viewvc?view=rev&rev=536637
Log:
Added ant build and test and readme material 

Added:
    incubator/tuscany/java/sca/samples/simple-bigbank/README   (with props)
    incubator/tuscany/java/sca/samples/simple-bigbank/build.xml   (with props)
    incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.png   (with props)
    incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg   (with props)
    incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/
    incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java   (with props)

Added: incubator/tuscany/java/sca/samples/simple-bigbank/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/simple-bigbank/README?view=auto&rev=536637
==============================================================================
--- incubator/tuscany/java/sca/samples/simple-bigbank/README (added)
+++ incubator/tuscany/java/sca/samples/simple-bigbank/README Wed May  9 13:00:56 2007
@@ -0,0 +1,70 @@
+Calculator Sample
+=================
+This sample implements a simple a version of the BigBank scenrio used in 
+various places in the SCA specification documents. 
+
+The README in the samples directory (the directory above this) provides 
+general instructions about building and running samples. Take a look there 
+first. 
+
+Sample Overview
+---------------
+The sample provides a composite with two java components wired together 
+with a default binding. A request to the AccountComponent results in a 
+requrest to the AccountDataComponent to get account data. The data retuns 
+back via the AccountComponent to the client.
+
+calculator/
+  src/
+    main/
+      java/
+        simple-bigbank/
+          bigbank.account         - AccountComponent implementation
+          bigbank.accountdata     - AccountDataComponent implementation
+          bigbank.client          - starts the SCA Runtime and 
+                                    deploys the BigBank.composite. 
+                                    It then calls the deployed AccountService 
+      resources/
+        BigBank.composite         - the SCA assembly for this sample
+  simple-bigbank.png              - a pictorial representation of the sample 
+                                    .composite file
+  build.xml                       - the Ant build file
+  pom.xml                         - the Maven build file        
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant as 
+follows
+
+cd simple-bigbank
+ant 
+
+You should see the following output from the run target.
+
+run:
+     [java] Account summary: currency: USD, [ID:Foo_CHA12345, balance:1500.0, ID
+:Foo_SAA12345, balance:1500.0, ID:Foo_STA12345, symbol:IBM, quantity:100]
+
+Building And Running The Sample Using Maven 
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run 
+using Maven as follows. 
+
+cd simple-bigbank
+mvn
+
+You should see the following output from the test phase.
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running bigbank.BigBankTestCase
+Account summary: currency: USD, [ID:Foo_CHA12345, balance:1500.0, ID:Foo_SAA1234
+5, balance:1500.0, ID:Foo_STA12345, symbol:IBM, quantity:100]
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.592 sec
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+This shows that the Junit test cases have run successfully. 

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/README
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/tuscany/java/sca/samples/simple-bigbank/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/simple-bigbank/build.xml?view=auto&rev=536637
==============================================================================
--- incubator/tuscany/java/sca/samples/simple-bigbank/build.xml (added)
+++ incubator/tuscany/java/sca/samples/simple-bigbank/build.xml Wed May  9 13:00:56 2007
@@ -0,0 +1,56 @@
+<!--
+ * 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.    
+-->
+<project name="simple-bigbank" default="run">
+    <property environment="env"/>
+	
+    <target name="init">
+        <mkdir dir="target/classes"/>
+    </target>
+	
+    <target name="compile" depends="init">
+        <javac srcdir="src/main/java"
+               destdir="target/classes"
+               debug="on"
+               source="1.5"
+               target="1.5">
+            <classpath>
+            	<pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </javac> 
+        <copy todir="target/classes">
+            <fileset dir="src/main/resources"/>
+        </copy>
+    </target>	
+	
+    <target name="run" depends="compile">
+        <java classname="bigbank.client.BigBankClient"
+              fork="true">
+            <classpath>
+                <pathelement path="target/classes"/>
+            	<pathelement location="../../lib/tuscany-sca-manifest.jar"/>
+            </classpath>
+        </java>
+    </target>
+	
+    <target name="clean">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="target"/>
+        </delete>
+    </target>
+</project>

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.png
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.png?view=auto&rev=536637
==============================================================================
Binary file - no diff available.

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg?view=auto&rev=536637
==============================================================================
--- incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg (added)
+++ incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg Wed May  9 13:00:56 2007
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1052.3622"
+   height="744.09448"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.44"
+   sodipodi:docbase="C:\simon\Projects\Tuscany\java\java-head\sca\samples\simple-bigbank"
+   sodipodi:docname="simple-bigbank.svg"
+   version="1.0"
+   inkscape:export-filename="C:\simon\Projects\Tuscany\java\java-head\sca\samples\simple-bigbank\simple-bigbank.png"
+   inkscape:export-xdpi="52.84"
+   inkscape:export-ydpi="52.84">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.4"
+     inkscape:cx="468.4064"
+     inkscape:cy="414.63224"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     inkscape:window-width="1054"
+     inkscape:window-height="721"
+     inkscape:window-x="120"
+     inkscape:window-y="172" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <g
+       id="g2997">
+      <rect
+         rx="15.307091"
+         ry="12.692303"
+         y="192.00233"
+         x="258.31146"
+         height="299.99988"
+         width="495.71429"
+         id="rect2067"
+         style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:1.99999964;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <flowRoot
+         id="flowRoot2954"
+         xml:space="preserve"><flowRegion
+           id="flowRegion2956"><rect
+             y="212.66591"
+             x="281.42856"
+             height="61.42857"
+             width="170"
+             id="rect2958" /></flowRegion><flowPara
+           id="flowPara2960">BigBank</flowPara></flowRoot>    </g>
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect2988"
+       width="115.66247"
+       height="85.862968"
+       x="339.91632"
+       y="310.73904"
+       rx="6.9961648"
+       ry="7.1230249" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot2966"
+       transform="translate(84.32554,112.8005)"><flowRegion
+         id="flowRegion2968"><rect
+           id="rect2970"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara2972">Account</flowPara><flowPara
+         id="flowPara1883">Service</flowPara><flowPara
+         id="flowPara1885">Component</flowPara></flowRoot>    <rect
+       style="opacity:1;fill:#fff62c;fill-opacity:1;stroke:#060000;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3006"
+       width="43.861084"
+       height="29.993773"
+       x="376.59262"
+       y="285.79593"
+       rx="21.930542"
+       ry="0" />
+    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 322.76581,342.58603 L 356.10085,342.58603 L 362.16176,355.71801 L 355.0907,367.83985 L 322.76581,367.83985 L 330.34196,355.71801 L 322.76581,342.58603 z "
+       id="path3017" />
+    <path
+       style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 436.01825,340.74775 L 469.35329,340.74775 L 475.4142,353.87973 L 468.34314,366.00157 L 436.01825,366.00157 L 443.5944,353.87973 L 436.01825,340.74775 z "
+       id="path3019" />
+    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 226.73063,330.75341 L 280.61512,330.75341 L 290.41229,356.14253 L 278.98226,379.57867 L 226.73063,379.57867 L 238.97711,356.14253 L 226.73063,330.75341 z "
+       id="path1887" />
+    <rect
+       style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect1889"
+       width="115.66247"
+       height="85.862968"
+       x="557.25488"
+       y="308.38455"
+       rx="6.9961648"
+       ry="7.1230249" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1891"
+       transform="translate(301.6641,110.446)"><flowRegion
+         id="flowRegion1893"><rect
+           id="rect1895"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591" /></flowRegion><flowPara
+         id="flowPara1897">Account</flowPara><flowPara
+         id="flowPara1909">Data</flowPara><flowPara
+         id="flowPara1899">Service</flowPara><flowPara
+         id="flowPara1901">Component</flowPara></flowRoot>    <path
+       style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 540.10438,340.23154 L 573.43942,340.23154 L 579.50033,353.36352 L 572.42927,365.48536 L 540.10438,365.48536 L 547.68053,353.36352 L 540.10438,340.23154 z "
+       id="path1905" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 290,355.52305 C 329.28571,355.52305 329.28571,355.52305 329.28571,355.52305"
+       id="path1913" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 475,353.3802 C 547.14286,352.66591 547.14286,352.66591 547.14286,352.66591"
+       id="path1919" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1921"
+       transform="translate(95.23912,80.79069)"
+       style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion1923"><rect
+           id="rect1925"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara1931">currency</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot1933"
+       transform="translate(-42.61803,130.0764)"
+       style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion1935"><rect
+           id="rect1937"
+           width="170"
+           height="61.42857"
+           x="281.42856"
+           y="212.66591"
+           style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans" /></flowRegion><flowPara
+         id="flowPara1939">Account</flowPara><flowPara
+         id="flowPara1941">Service</flowPara><flowPara
+         id="flowPara1943" /></flowRoot>  </g>
+</svg>

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/simple-bigbank.svg
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java?view=auto&rev=536637
==============================================================================
--- incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java (added)
+++ incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java Wed May  9 13:00:56 2007
@@ -0,0 +1,43 @@
+/*
+ * 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.    
+ */
+
+package bigbank.client;
+
+import org.apache.tuscany.host.embedded.SCADomain;
+
+import bigbank.account.AccountService;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class BigBankClient {
+    public static void main(String[] args) throws Exception {
+
+        SCADomain domain = SCADomain.newInstance("BigBank.composite");
+        
+        AccountService accountService = domain.getService(AccountService.class,
+                                                          "AccountServiceComponent");
+
+        System.out.println("Account summary: " + accountService.getAccountReport("Foo") );
+
+        domain.close();
+    }  
+
+}

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/simple-bigbank/src/main/java/bigbank/client/BigBankClient.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org