tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fm...@apache.org
Subject svn commit: r1127722 - in /tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test: java/org/apache/tuscany/sca/test/StockService.java java/org/apache/tuscany/sca/test/StockServiceImpl.java resources/test.composite
Date Wed, 25 May 2011 23:20:49 GMT
Author: fmoga
Date: Wed May 25 23:20:48 2011
New Revision: 1127722

URL: http://svn.apache.org/viewvc?rev=1127722&view=rev
Log:
Update testcase for binding-comet-runtime with callbacks.

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/resources/test.composite

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java?rev=1127722&r1=1127721&r2=1127722&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java
Wed May 25 23:20:48 2011
@@ -18,11 +18,16 @@
  */
 package org.apache.tuscany.sca.test;
 
+import org.apache.tuscany.sca.binding.comet.runtime.callback.CometCallback;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.OneWay;
 import org.oasisopen.sca.annotation.Remotable;
 
+@Callback(CometCallback.class)
 @Remotable
 public interface StockService {
 
-    String getQuotes();
+	@OneWay
+	void subscribeForQuotes();
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java?rev=1127722&r1=1127721&r2=1127722&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java
Wed May 25 23:20:48 2011
@@ -22,18 +22,23 @@ import java.text.DecimalFormat;
 import java.util.Date;
 import java.util.Random;
 
+import org.apache.tuscany.sca.binding.comet.runtime.callback.CometCallback;
+import org.oasisopen.sca.annotation.Callback;
 import org.oasisopen.sca.annotation.Service;
 
 @Service(StockService.class)
 public class StockServiceImpl implements StockService {
 
-    public static final int MAX_VALUE = 1000;
-    private final Random random = new Random(new Date().getTime());
+	@Callback
+	protected CometCallback callback;
 
-    @Override
-    public String getQuotes() {
-        final Double value = Math.abs(this.random.nextDouble() * this.random.nextInt(StockServiceImpl.MAX_VALUE));
-        return "ASF" + "#" + Double.valueOf(new DecimalFormat("#.##").format(value));
-    }
+	public static final int MAX_VALUE = 1000;
+	private final Random random = new Random(new Date().getTime());
+
+	@Override
+	public void subscribeForQuotes() {
+		final Double value = Math.abs(this.random.nextDouble() * this.random.nextInt(StockServiceImpl.MAX_VALUE));
+		callback.sendMessage("ASF" + "#" + Double.valueOf(new DecimalFormat("#.##").format(value)));
+	}
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/resources/test.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/resources/test.composite?rev=1127722&r1=1127721&r2=1127722&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/resources/test.composite
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/test/resources/test.composite
Wed May 25 23:20:48 2011
@@ -25,8 +25,12 @@
 	<component name="test">
 		<implementation.java class="org.apache.tuscany.sca.test.StockServiceImpl"/>
 		<service name="StockService">
-			<interface.java interface="org.apache.tuscany.sca.test.StockService"/>
+			<interface.java interface="org.apache.tuscany.sca.test.StockService" 
+				callbackInterface="org.apache.tuscany.sca.binding.comet.runtime.callback.CometCallback"/>
 			<tuscany:binding.comet/>
+			<callback>
+				<tuscany:binding.comet/>
+			</callback>
 		</service>
 	</component>
 	



Mime
View raw message