You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/01/12 18:51:34 UTC
svn commit: r495660 [2/3] - in /incubator/tuscany/java/testing/sca: ./
itest/ itest/bindingsTest/ itest/bindingsTest/bindingsclient/
itest/bindingsTest/bindingsclient/.settings/
itest/bindingsTest/bindingscomposite/ itest/bindingsTest/bindingscomposite...
Added: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,63 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Service;
+
+@Service(CallBackCTypeService.class)
+public class CallBackCTypeServiceImpl implements CallBackCTypeService {
+
+ @Callback
+ protected CallBackCTypeCallBack callback;
+
+ public CallBackCTypeServiceImpl() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public void knockKnock(String aString) {
+
+ System.out.println("CallBackCTypeServiceImpl message received: " + aString);
+ callback.callBackMessage("Who's There");
+ System.out.println("CallBackCTypeServiceImpl response sent");
+ return;
+
+ }
+
+ public void multiCallBack(String aString) {
+
+ System.out.println("CallBackCTypeServiceImpl message received: " + aString);
+ callback.callBackIncrement("Who's There 1");
+ System.out.println("CallBackCTypeServiceImpl response sent");
+ callback.callBackIncrement("Who's There 2");
+ System.out.println("CallBackCTypeServiceImpl response sent");
+ callback.callBackIncrement("Who's There 3");
+ System.out.println("CallBackCTypeServiceImpl response sent");
+ return;
+
+ }
+
+ public void noCallBack(String aString) {
+
+ System.out.println("CallBackCTypeServiceImpl message received: " + aString);
+ System.out.println("CallBackCTypeServiceImpl No response desired");
+ return;
+
+ }
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/main/resources/META-INF/sca/default.scdl Fri Jan 12 09:51:22 2007
@@ -0,0 +1,34 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ name="CallBackCTypeTest">
+
+ <component name="CallBackCTypeClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackCTypeClientImpl"/>
+ <reference name="aCallBackService">
+ CallBackCTypeService
+ </reference>
+ </component>
+
+ <component name="CallBackCTypeService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackCTypeServiceImpl"/>
+ </component>
+
+</composite>
Added: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeITest.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeITest.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeITest.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,39 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import junit.framework.TestCase;
+
+import org.osoa.sca.CurrentCompositeContext;
+
+public class CallBackCTypeITest extends TestCase {
+
+ private CallBackCTypeClient aCallBackClient;
+
+ public void testCallBackBasic() {
+ aCallBackClient.run();
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ aCallBackClient =
+ CurrentCompositeContext.getContext().locateService(CallBackCTypeClient.class, "CallBackCTypeClient");
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeITest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackCTypeTest/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeITest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 12 09:51:22 2007
@@ -0,0 +1,13 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/pom.xml?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/pom.xml (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/pom.xml Fri Jan 12 09:51:22 2007
@@ -0,0 +1,61 @@
+<?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.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>sca-itest</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>callbackIDTest</artifactId>
+ <version>${testing.version}</version>
+ <packaging>jar</packaging>
+ <name>Test Suite for SCA Callback ID</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r0.95</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <artifactId>tuscany-itest-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,31 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+/**
+ * @author lamodeo
+ */
+public interface CallBackIdCallBack {
+
+ public void callBackMessage(String aString);
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdCallBack.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,28 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface CallBackIdClient {
+
+ public void run();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,145 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import junit.framework.Assert;
+
+@Service(CallBackIdClient.class)
+public class CallBackIdClientImpl implements CallBackIdClient, CallBackIdCallBack {
+
+ @Context
+ private CompositeContext compositeContext;
+ @Reference
+ protected CallBackIdService aCallBackService;
+
+ private static String returnMessage = null;
+ private static Object monitor = new Object();
+ private static Object callBackId;
+
+ public void run() {
+
+ // This tests the use of the set/get callbackId API both SCA generated
+ // and client specified.
+
+ // Test1 uses a SCA generated callback ID and compare that with the
+ // callbackID returned during callback.
+ test11a();
+
+ // Test2 uses a Client specified callback ID and compare that with the
+ // callbackID returned during callback.
+ test11b();
+
+ return;
+ }
+
+ private void test11a() {
+
+ // Retrieve this services callback ID and save it. Once the callback is
+ // received the callback ID will be compared with the one
+ // returned. Equal is good.
+
+ Object origCallBackId = ((ServiceReference)aCallBackService).getCallbackID();
+ aCallBackService.knockKnock("Knock Knock - Test1");
+ int count = 0;
+
+ //
+ // If we cannot get a response in 30 seconds consider this a failure
+ //
+
+ synchronized (monitor) {
+ while (returnMessage == null && count++ < 30) {
+ try {
+ monitor.wait(1000L);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ Assert.assertEquals("CallBackIdITest - test11a - SCA Generated Id", origCallBackId, this.getCallBackId());
+
+ }
+
+ private void test11b() {
+
+ // Set the services callback ID and save it. Once the callback is
+ // received the callback ID will be compared with the one
+ // returned. Equal is good.
+
+ String origCallBackId = "CallBackId1";
+ ((ServiceReference)aCallBackService).setCallbackID(origCallBackId);
+
+ aCallBackService.knockKnock("Knock Knock - Test2");
+ int count = 0;
+
+ //
+ // If we cant get a response in 30 seconds consider this a failure
+ //
+
+ synchronized (monitor) {
+ while (returnMessage == null && count++ < 30) {
+ try {
+ monitor.wait(1000L);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ Assert
+ .assertEquals("CallBackIdITest - 11b - Client Specified Id", origCallBackId, (String)this.getCallBackId());
+
+ }
+
+ public String getReturnMessage() {
+ return returnMessage;
+ }
+
+ public void setReturnMessage(String aReturnMessage) {
+ returnMessage = aReturnMessage;
+ }
+
+ public void callBackMessage(String aString) {
+
+ System.out.println("Entering callback callBackMessage: " + aString);
+ RequestContext rc = compositeContext.getRequestContext();
+ Object callBackId = rc.getServiceReference().getCallbackID();
+
+ synchronized (monitor) {
+ this.setReturnMessage(aString);
+ this.setCallBackId(callBackId);
+ monitor.notify();
+ }
+ }
+
+ protected Object getCallBackId() {
+ return callBackId;
+ }
+
+ protected void setCallBackId(Object aCallBackId) {
+ callBackId = aCallBackId;
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdClientImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java Fri Jan 12 09:51:22 2007
@@ -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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+@Callback(CallBackIdCallBack.class)
+/**
+ *
+ */
+public interface CallBackIdService {
+
+ public void knockKnock(String aString);
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Service;
+
+@Service(CallBackIdService.class)
+public class CallBackIdServiceImpl implements CallBackIdService {
+
+ @Callback
+ protected CallBackIdCallBack callback;
+ @Context
+ protected CompositeContext compositeContext;
+
+ public void knockKnock(String aString) {
+
+ System.out.println("CallBackIdServiceImpl message received: " + aString);
+ RequestContext rc = compositeContext.getRequestContext();
+ Object callBackId = rc.getServiceReference().getCallbackID();
+ System.out.println("CallBackIdServiceImpl callbackID: " + callBackId.toString());
+
+ callback.callBackMessage("Who's There");
+ System.out.println("CallBackIdServiceImpl response sent");
+ return;
+
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/java/org/apache/tuscany/sca/test/CallBackIdServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/main/resources/META-INF/sca/default.scdl Fri Jan 12 09:51:22 2007
@@ -0,0 +1,34 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ name="CallBackIdTest">
+
+ <component name="CallBackIdClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackIdClientImpl"/>
+ <reference name="aCallBackService">
+ CallBackIdService
+ </reference>
+ </component>
+
+ <component name="CallBackIdService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackIdServiceImpl"/>
+ </component>
+
+</composite>
Added: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/test/java/org/apache/tuscany/sca/test/CallBackIdITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/test/java/org/apache/tuscany/sca/test/CallBackIdITest.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/test/java/org/apache/tuscany/sca/test/CallBackIdITest.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/test/java/org/apache/tuscany/sca/test/CallBackIdITest.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,22 @@
+package org.apache.tuscany.sca.test;
+
+import junit.framework.TestCase;
+import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.annotations.Reference;
+
+public class CallBackIdITest extends TestCase {
+
+ private CallBackIdClient aCallBackClient;
+
+ public void testCallBackBasic() {
+ aCallBackClient.run();
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ aCallBackClient = CurrentCompositeContext.getContext().locateService(CallBackIdClient.class, "CallBackIdClient");
+ }
+
+
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/test/java/org/apache/tuscany/sca/test/CallBackIdITest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackIDTest/src/test/java/org/apache/tuscany/sca/test/CallBackIdITest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 12 09:51:22 2007
@@ -0,0 +1,13 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/pom.xml?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/pom.xml (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/pom.xml Fri Jan 12 09:51:22 2007
@@ -0,0 +1,61 @@
+<?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.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>sca-itest</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>callbackSetCallbackConvTest</artifactId>
+ <version>${testing.version}</version>
+ <packaging>jar</packaging>
+ <name>Test Suite for SCA Callback SetCallback Conversation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r0.95</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <artifactId>tuscany-itest-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,40 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import java.io.Serializable;
+
+import junit.framework.Assert;
+
+public class CallBackSetCallbackConvBadCallback implements Serializable {
+
+ public CallBackSetCallbackConvBadCallback() {
+ super();
+ }
+
+ public void callback(String aString) {
+ //
+ // This callback method should never be called.
+ //
+ System.out.println("CallBackSetCallbackBadCallback: callback called");
+ Assert.fail("CallBackSetCallbackConvBadCallback: callback called");
+ return;
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvBadCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,31 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+// @Remotable
+/**
+ * @author lamodeo
+ */
+public interface CallBackSetCallbackConvCallback {
+
+ public void callBackMessage(String aString);
+
+ public void callBackIncrement(String aString);
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,28 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface CallBackSetCallbackConvClient {
+
+ public void run();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,175 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import junit.framework.Assert;
+
+import org.osoa.sca.NoRegisteredCallbackException;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+@Service(CallBackSetCallbackConvClient.class)
+@Scope("CONVERSATION")
+public class CallBackSetCallbackConvClientImpl implements CallBackSetCallbackConvClient {
+
+ @Reference
+ protected CallBackSetCallbackConvService aCallBackService;
+ @Reference
+ protected CallBackSetCallbackConvCallback callBack;
+ private CallBackSetCallbackConvObjectCallback aCallbackObject = null;
+ private Object monitor = new Object();
+
+ public void run() {
+
+ // This tests aspects of the setCallback() API within a conversational
+ // scope.
+
+ /*
+ * test7 The client calls setCallback() with an object that is not a
+ * service reference and the callback interface is stateful. Verify
+ * successful execution.
+ */
+ test7();
+
+ /*
+ * test8() The client calls setCallback() with an object that does not
+ * implement the callback interface. Verify an appropriate exception is
+ * thrown. This requires a STATEFUL interface.
+ */
+ test8();
+
+ /*
+ * test9 The client calls setCallback() with an object that is not
+ * serializable. Verify an appropriate exception is thrown. This
+ * requires a STATEFUL callback interface. Move from the stateless test
+ * case.
+ */
+ test9();
+
+ return;
+ }
+
+ private void test7() {
+
+ //
+ // This test is to specify an Object that is not a service reference
+ // that does implement
+ // the callback interface and is Serializeable. Verify successful
+ // execution.
+ //
+
+ aCallbackObject = new CallBackSetCallbackConvObjectCallback();
+ aCallbackObject.incrementCallBackCount();
+ aCallbackObject.setMonitor(monitor);
+
+ ((ServiceReference)aCallBackService).setCallback(aCallbackObject);
+ aCallBackService.knockKnock("Knock Knock");
+
+ // Lets give the callback a little time to complete....
+
+ int count = 0;
+
+ synchronized (monitor) {
+ while (aCallbackObject.getCount() != 2 && count++ < 30) {
+ try {
+ monitor.wait(1000L);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ Assert.assertEquals("CallBackSetCallbackConv - Test7", 2, aCallbackObject.getCount());
+
+ }
+
+ private void test8() {
+
+ boolean correctException = false;
+
+ //
+ // This test is to specify an Object that is not a service reference
+ // that does not impliment
+ // the callback interface. The expected result is an appropriate
+ // exception.
+ //
+
+ try {
+ ((ServiceReference)aCallBackService).setCallback(new CallBackSetCallbackConvBadCallback());
+ aCallBackService.knockKnock("Knock Knock");
+ }
+
+ //
+ // This should catch an appropriate exception.
+ //
+
+ catch (NoRegisteredCallbackException NotRegEx) // This needs to be
+ // changed to proper
+ // exception once we
+ // know what it is ;-)
+ {
+ correctException = true;
+ }
+
+ catch (Exception ex) {
+ // This means an inappropriate exception occurred
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals("CallBackSetCallbackConv - Test8", true, correctException);
+
+ }
+
+ private void test9() {
+
+ boolean correctException = false;
+
+ //
+ // This test is to specify an Object that is not a service reference
+ // that does impliment
+ // the callback interface but does not implement Serializeable. Verify
+ // an appropriate exception
+ // is thrown.
+ //
+
+ try {
+ ((ServiceReference)aCallBackService).setCallback(new CallBackSetCallbackConvNonSerCallback());
+ aCallBackService.knockKnock("Knock Knock");
+ }
+ //
+ // This should catch an appropriate exception.
+ //
+ catch (NoRegisteredCallbackException NotRegEx) // This needs to be
+ // changed to
+ // appropriate exception
+ // when we know what it
+ // is ;-)
+ {
+ correctException = true;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals("CallBackSetCallbackConv - Test9", true, correctException);
+
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvClientImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,58 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+public class CallBackSetCallbackConvNonSerCallback implements CallBackSetCallbackConvCallback {
+
+ private int callBackCount = 0;
+ private Object monitor;
+
+ public CallBackSetCallbackConvNonSerCallback() {
+ super();
+ }
+
+ public synchronized void incrementCallBackCount() {
+ callBackCount++;
+ }
+
+ public synchronized int getCount() {
+ return callBackCount;
+ }
+
+ public void setMonitor(Object anObject) {
+ monitor = anObject;
+ }
+
+ public void callBackMessage(String aString) {
+
+ System.out.println("Entering CallBackSetCallbackConvNonSerCallback callBackMessage: " + aString);
+
+ }
+
+ public void callBackIncrement(String aString) {
+
+ System.out.println("Entering callback increment: " + aString);
+
+ synchronized (monitor) {
+ this.incrementCallBackCount();
+ monitor.notify();
+ }
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvNonSerCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,60 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import java.io.Serializable;
+
+public class CallBackSetCallbackConvObjectCallback implements CallBackSetCallbackConvCallback, Serializable {
+
+ private int callBackCount = 0;
+ private Object monitor;
+
+ public CallBackSetCallbackConvObjectCallback() {
+ super();
+ }
+
+ public synchronized void incrementCallBackCount() {
+ callBackCount++;
+ }
+
+ public synchronized int getCount() {
+ return callBackCount;
+ }
+
+ public void setMonitor(Object anObject) {
+ monitor = anObject;
+ }
+
+ public void callBackMessage(String aString) {
+
+ System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString);
+
+ }
+
+ public void callBackIncrement(String aString) {
+
+ System.out.println("Entering callback increment: " + aString);
+
+ synchronized (monitor) {
+ this.incrementCallBackCount();
+ monitor.notify();
+ }
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvObjectCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,36 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+
+// @Remotable
+@Callback(CallBackSetCallbackConvCallback.class)
+/**
+ *
+ */
+public interface CallBackSetCallbackConvService {
+
+ public void knockKnock(String aString);
+
+ public void setCallbackIllegally(String aString);
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,102 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import java.io.File;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+@Service(CallBackSetCallbackConvService.class)
+@Scope("CONVERSATION")
+public class CallBackSetCallbackConvServiceImpl implements CallBackSetCallbackConvService {
+
+ @Callback
+ private CallBackSetCallbackConvCallback callback;
+ @Context
+ private CompositeContext context;
+
+ public void knockKnock(String aString) {
+
+ try {
+ System.out.println("CallBackBasicServiceImpl message received: " + aString);
+ callback.callBackMessage("Who's There");
+ System.out.println("CallBackBasicServiceImpl response sent");
+ return;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ }
+
+ public void setCallbackIllegally(String aString) {
+
+ System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);
+
+ boolean exceptionProduced = false;
+ RequestContext requestContext = null;
+ ServiceReference serviceRef = null;
+
+ // Context is not working properly so we can't trust that this is
+ // working.....
+ try {
+ requestContext = context.getRequestContext();
+ serviceRef = requestContext.getServiceReference();
+ } catch (Exception ex) {
+ System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + ex.toString());
+ ex.printStackTrace();
+ return;
+ }
+
+ // Ok, call setCallback with my own service reference.
+ try {
+ serviceRef.setCallback(serviceRef);
+ } catch (NullPointerException npe) {
+ // This is not an appropriate exception.
+ System.out.println("Test10 NPE exception during setCallback to own service reference");
+ npe.printStackTrace();
+ return;
+ }
+ // This needs to catch the appropriate exception, once we figure out
+ // what is needs to be!
+ catch (Exception ex) {
+ exceptionProduced = true;
+ System.out.println("Test10 appropriate exception caught during setCallback to own service reference");
+ }
+ ;
+
+ // If we get the exception we are looking for then create the marker
+ // file.
+ if (exceptionProduced == true) {
+ File aFile = new File("target/test10_marker");
+ try {
+ aFile.createNewFile();
+ } catch (Exception ex) {
+ System.out.println("Error Creating target/test10_marker marker file");
+ ex.printStackTrace();
+ }
+ }
+
+ }
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/main/resources/META-INF/sca/default.scdl Fri Jan 12 09:51:22 2007
@@ -0,0 +1,34 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ name="CallBackSetCallbackConvTest">
+
+ <component name="CallBackSetCallbackConvClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackConvClientImpl"/>
+ <reference name="aCallBackService">
+ CallBackSetCallbackConvService
+ </reference>
+ </component>
+
+
+ <component name="CallBackSetCallbackConvService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackConvServiceImpl"/>
+ </component>
+</composite>
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvITest.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvITest.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvITest.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,40 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import junit.framework.TestCase;
+
+import org.osoa.sca.CurrentCompositeContext;
+
+public class CallBackSetCallbackConvITest extends TestCase {
+
+ private CallBackSetCallbackConvClient aCallBackClient;
+
+ public void testCallBackSetCallback() {
+ aCallBackClient.run();
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ aCallBackClient =
+ CurrentCompositeContext.getContext().locateService(CallBackSetCallbackConvClient.class,
+ "CallBackSetCallbackConvClient");
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvITest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackConvTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackConvITest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 12 09:51:22 2007
@@ -0,0 +1,13 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/pom.xml?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/pom.xml (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/pom.xml Fri Jan 12 09:51:22 2007
@@ -0,0 +1,61 @@
+<?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.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>sca-itest</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>callbackSetCallbackTest</artifactId>
+ <version>${testing.version}</version>
+ <packaging>jar</packaging>
+ <name>Test Suite for SCA Callback SetCallback</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r0.95</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <artifactId>tuscany-itest-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,34 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Callback;
+
+// @Remotable
+@Callback(CallBackSetCallbackCallback.class)
+/**
+ *
+ */
+public interface CallBackSetCalbackService {
+
+ public void knockKnock(String aString);
+
+ public void setCallbackIllegally(String aString);
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCalbackService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,41 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import junit.framework.Assert;
+
+public class CallBackSetCallbackBadCallback {
+
+ private String anAttribure = null;
+ private int anIntAttribute = 0;
+
+ public CallBackSetCallbackBadCallback() {
+ super();
+ }
+
+ public void callback(String aString) {
+ //
+ // This callback method should never be called.
+ //
+ System.out.println("CallBackSetCallbackBadCallback: callback called");
+ Assert.fail("CallBackSetCallbackBadCallback: callback called");
+ return;
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackBadCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,31 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+// @Remotable
+/**
+ * @author lamodeo
+ */
+public interface CallBackSetCallbackCallback {
+
+ public void callBackMessage(String aString);
+
+ public void callBackIncrement(String aString);
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,66 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import java.io.File;
+
+import org.osoa.sca.annotations.Service;
+
+@Service(CallBackSetCallbackCallback.class)
+public class CallBackSetCallbackCallbackImpl implements CallBackSetCallbackCallback {
+
+ private static String returnMessage = null;
+ private static int callBackCount = 0;
+
+ public String getReturnMessage() {
+ return returnMessage;
+ }
+
+ public void setReturnMessage(String aReturnMessage) {
+ returnMessage = aReturnMessage;
+ }
+
+ public int getCallBackCount() {
+ return callBackCount;
+ }
+
+ public void incrementCallBackCount() {
+ callBackCount++;
+ }
+
+ public void callBackMessage(String aString) {
+
+ System.out.println("Entering CallBackSetCallbackCallbackImpl callBackMessage: " + aString);
+
+ File aFile = new File("target/test4_marker");
+ try {
+ aFile.createNewFile();
+ } catch (Exception ex) {
+ System.out.println("Error Creating target/test4_marker marker file");
+ ex.printStackTrace();
+ }
+
+ }
+
+ public void callBackIncrement(String aString) {
+ System.out.println("Entering callback increment: " + aString);
+ this.incrementCallBackCount();
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackCallbackImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,28 @@
+/*
+ * 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 org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface CallBackSetCallbackClient {
+
+ public void run();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClient.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