Author: ramkumar
Date: Thu Nov  6 08:42:59 2008
New Revision: 711901

URL: http://svn.apache.org/viewvc?rev=711901&view=rev
Log:
Fixes for TUSCANY-2666

Added:
    tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/
    tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/
    
tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/calculator/
    
tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/calculator/CalculatorServiceTestCase.java
    tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/
    tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/
    
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/checkaccount/
    
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/checkaccount/CheckAccountServiceTestCase.java
    tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/
    tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/
    tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/
    
tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/stockquote/
    
tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/stockquote/StockQuoteServiceTestCase.java
Modified:
    tuscany/java/sca/samples/simple-bigbank-spring/pom.xml
    
tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java
    
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java
    
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/resources/definitions.xml
    
tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java

Modified: tuscany/java/sca/samples/simple-bigbank-spring/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/simple-bigbank-spring/pom.xml?rev=711901&r1=711900&r2=711901&view=diff
==============================================================================
--- tuscany/java/sca/samples/simple-bigbank-spring/pom.xml (original)
+++ tuscany/java/sca/samples/simple-bigbank-spring/pom.xml Thu Nov  6 08:42:59 
2008
@@ -149,6 +149,13 @@
         
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>sample-spring-bigbank-checkaccount</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
             <version>1.4-SNAPSHOT</version>
             <scope>runtime</scope>
@@ -174,6 +181,24 @@
             <version>1.4-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
+        
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <version>2.5.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <version>2.5.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>2.5.5</version>
+        </dependency>
 
         <dependency>
             <groupId>junit</groupId>

Modified: 
tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java?rev=711901&r1=711900&r2=711901&view=diff
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java
 (original)
+++ 
tuscany/java/sca/samples/spring-bigbank-calculator/src/main/java/bigbank/calculator/server/CalculatorServer.java
 Thu Nov  6 08:42:59 2008
@@ -25,6 +25,10 @@
 public class CalculatorServer {
 
     public static void main(String[] args) throws Exception {
+        long timeout = -1L;
+        if (args.length > 0) {
+            timeout = Long.parseLong(args[0]);
+        }
 
         System.out.println("Starting the Sample SCA Calculator...");
 
@@ -32,13 +36,15 @@
         SCANode node = 
factory.createSCANodeFromClassLoader("Calculator.composite", 
CalculatorServer.class.getClassLoader());
         node.start();
 
-        System.out.println("Press Enter to Exit...");
-        System.in.read();
+        if (timeout < 0) {
+            System.out.println("Press Enter to Exit...");
+            System.in.read();
+        } else {
+            Thread.sleep(timeout);
+        }
 
         node.stop();
-
         System.out.println("Bye");
-        System.exit(0);
     }
 
 }

Added: 
tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/calculator/CalculatorServiceTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/calculator/CalculatorServiceTestCase.java?rev=711901&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/calculator/CalculatorServiceTestCase.java
 (added)
+++ 
tuscany/java/sca/samples/spring-bigbank-calculator/src/test/java/bigbank/calculator/CalculatorServiceTestCase.java
 Thu Nov  6 08:42:59 2008
@@ -0,0 +1,33 @@
+/*
+ * 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.calculator;
+
+import junit.framework.TestCase;
+import bigbank.calculator.server.CalculatorServer;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class CalculatorServiceTestCase extends TestCase {
+
+    public void testServer() throws Exception {
+        CalculatorServer.main(new String[] {"1000"});
+    }
+}

Modified: 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java?rev=711901&r1=711900&r2=711901&view=diff
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java
 (original)
+++ 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/java/bigbank/account/checking/server/CheckingAccountServer.java
 Thu Nov  6 08:42:59 2008
@@ -31,6 +31,11 @@
 public class CheckingAccountServer {
 
     public static void main(String[] args) {
+        long timeout = -1L;
+        if (args.length > 0) {
+            timeout = Long.parseLong(args[0]);
+        }
+        
         try {
             BrokerService jmsBroker;
             jmsBroker = new BrokerService(); 
@@ -43,8 +48,12 @@
             SCANode node = 
factory.createSCANodeFromClassLoader("CheckingsAccount.composite", 
CheckingAccountServer.class.getClassLoader());
             node.start();
 
-            System.out.println("CheckingsAccount server started (press enter 
to shutdown)");
-            System.in.read();
+            if (timeout < 0) {
+                System.out.println("CheckingsAccount server started (press 
enter to shutdown)");
+                System.in.read();
+            } else {
+                Thread.sleep(timeout);
+            }            
 
             node.stop();
             

Modified: 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/resources/definitions.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/resources/definitions.xml?rev=711901&r1=711900&r2=711901&view=diff
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/resources/definitions.xml
 (original)
+++ 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/main/resources/definitions.xml
 Thu Nov  6 08:42:59 2008
@@ -27,7 +27,7 @@
 
   
 <sca:intent name="authorization" 
-                        constrains="sca:implementation.java">
+                        constrains="sca:implementation.spring">
                         <description>
                                Authorization Intent
                         </description>
@@ -36,7 +36,7 @@
  <!-- WS Security POLICY SETS -->
  <sca:policySet name="wsAuthenticationPolicy"
        provides="authentication"
-       appliesTo="sca:service/sca:binding.ws">
+       appliesTo="sca:service/sca:binding.jms">
        <tuscany:wsConfigParam>
                <parameter name="InflowSecurity">
                        <action>
@@ -49,7 +49,7 @@
  
  <sca:policySet name="chkDeptAuthorizationPolicy"
        provides="bba:authorization"
-       appliesTo="sca:implementation.java">
+       appliesTo="sca:implementation.spring">
        <chk:AuthPolicy>
                <!-- need to evolve what should go in here -->
        </chk:AuthPolicy>

Added: 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/checkaccount/CheckAccountServiceTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/checkaccount/CheckAccountServiceTestCase.java?rev=711901&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/checkaccount/CheckAccountServiceTestCase.java
 (added)
+++ 
tuscany/java/sca/samples/spring-bigbank-checkaccount/src/test/java/bigbank/checkaccount/CheckAccountServiceTestCase.java
 Thu Nov  6 08:42:59 2008
@@ -0,0 +1,33 @@
+/*
+ * 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.checkaccount;
+
+import junit.framework.TestCase;
+import bigbank.account.checking.server.CheckingAccountServer;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class CheckAccountServiceTestCase extends TestCase {
+
+    public void testServer() throws Exception {
+        CheckingAccountServer.main(new String[] {"1000"});
+    }
+}

Modified: 
tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java?rev=711901&r1=711900&r2=711901&view=diff
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java
 (original)
+++ 
tuscany/java/sca/samples/spring-bigbank-stockquote/src/main/java/bigbank/stockquote/server/StockQuoteServer.java
 Thu Nov  6 08:42:59 2008
@@ -29,7 +29,11 @@
 public class StockQuoteServer {
 
     public static void main(String[] args) throws Exception {
-
+        long timeout = -1L;
+        if (args.length > 0) {
+            timeout = Long.parseLong(args[0]);
+        }
+        
         System.out.println("Starting the Sample SCA StockQuote Service...");
 
         SCANodeFactory factory = SCANodeFactory.newInstance();
@@ -41,8 +45,12 @@
         if (ctx.containsBean("StockQuoteServiceBean"))
             System.out.println("StockQuoteServiceBean is now available for 
use...");        
         
-        System.out.println("Press Enter to Exit...");
-        System.in.read();
+        if (timeout < 0) {
+            System.out.println("Press Enter to Exit...");
+            System.in.read();
+        } else {
+            Thread.sleep(timeout);
+        }
 
         node.stop();
         System.out.println("Bye");

Added: 
tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/stockquote/StockQuoteServiceTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/stockquote/StockQuoteServiceTestCase.java?rev=711901&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/stockquote/StockQuoteServiceTestCase.java
 (added)
+++ 
tuscany/java/sca/samples/spring-bigbank-stockquote/src/test/java/bigbank/stockquote/StockQuoteServiceTestCase.java
 Thu Nov  6 08:42:59 2008
@@ -0,0 +1,33 @@
+/*
+ * 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.stockquote;
+
+import junit.framework.TestCase;
+import bigbank.stockquote.server.StockQuoteServer;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class StockQuoteServiceTestCase extends TestCase {
+
+    public void testServer() throws Exception {
+        StockQuoteServer.main(new String[] {"1000"});
+    }
+}


Reply via email to