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 [3/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/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,193 @@
+/*
+ * 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 junit.framework.Assert;
+
+import org.osoa.sca.NoRegisteredCallbackException;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CallBackSetCallbackClient.class)
+public class CallBackSetCallbackClientImpl implements CallBackSetCallbackClient {
+
+ @Reference
+ protected CallBackSetCalbackService aCallBackService;
+ @Reference
+ protected CallBackSetCallbackCallback callBack;
+
+ public void run() {
+
+ // This test various aspects of the setCallback() API in a stateless
+ // scope.
+
+ /*
+ * test4 Client does not implement the callback interface but calls
+ * setCallback with a service reference before invoking the target,
+ * Verify successful executon.
+ */
+
+ test4();
+
+ /*
+ * test5 The client does not implement the callback interface and does
+ * not call setCallback() before invoking the target. Verify a
+ * NoRegisteredCallbackException is thrown.
+ */
+
+ test5();
+
+ /*
+ * test6() The client calls setCallback() with an object that is not a
+ * service reference and the callback interface is stateless. Verify
+ * that an appropriate exception is thrown. When calling setCallback
+ * with an object the interface must be stateful. Stateless interfaces
+ * require a service Reference.
+ */
+
+ test6();
+
+ /*
+ * test10 The target calls setCallback() on its own service reference,
+ * e.g. getRequestContext().getServiceReference().getCallback(). Verify
+ * an appropriate exeception occurs.
+ */
+
+ test10();
+
+ return;
+ }
+
+ private void test4() {
+
+ //
+ // Since callbacks do not synchronously return and this test results in
+ // a callback to a component other
+ // than this client I am using a marker file to determine the outcome.
+ // The presence of the marker
+ // file will be used for the Assertion test. If it exists then the
+ // callback occurred and all is good.
+ //
+
+ // Make sure the marker file is not present before starting the test.
+ File aFile = new File("target/test4_marker");
+ if (aFile.exists())
+ aFile.delete();
+
+ ((ServiceReference)aCallBackService).setCallback(callBack);
+
+ aCallBackService.knockKnock("Knock Knock");
+
+ // Lets give the callback a little time to complete....
+
+ int count = 0;
+ long timeout = 1000;
+
+ while (count++ < 30 && (aFile.exists() == false)) {
+ try {
+ Thread.sleep(timeout);
+ } catch (InterruptedException ie) {
+ }
+ }
+
+ Assert.assertEquals("CallBackSetCallback - Test4", true, aFile.exists());
+
+ }
+
+ private void test5() {
+
+ boolean correctException = false;
+
+ //
+ // The backend service is expecting a callback reference to be set. This
+ // test will not
+ // set one so an exception is expected. According to the spec if a
+ // client calls a method on
+ // a service reference prior to calling setCallback() then a
+ // NoRegisteredCallbackException
+ // will be thrown on the client.
+ //
+
+ try {
+ aCallBackService.knockKnock("Knock Knock");
+ } catch (NoRegisteredCallbackException NotRegEx) {
+ correctException = true;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals("CallBackSetCallback - Test5", true, correctException);
+
+ }
+
+ private void test6() {
+
+ boolean correctException = false;
+
+ //
+ // This test is to specify an Object that is not a service reference
+ // that does impliment
+ // the callback interface. However because this callback service is
+ // stateless the expected
+ // result is an appropriate exception.
+ //
+
+ try {
+ ((ServiceReference)aCallBackService).setCallback(new CallBackSetCallbackObjectCallback());
+ aCallBackService.knockKnock("Knock Knock");
+ }
+ //
+ // This should catch an appropriate exception.
+ //
+ catch (NoRegisteredCallbackException NotRegEx) {
+ correctException = true;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ Assert.assertEquals("CallBackSetCallback - Test6", true, correctException);
+
+ }
+
+ private void test10() {
+ //
+ // Since callbacks do not synchronously return and this test results in
+ // a failure on the service
+ // side of the fence I am using a marker file to determine the outcome.
+ // The presence of the marker
+ // file will be used for the Assertion test. If it exists then all is
+ // good.
+ //
+
+ // Make sure the marker file is not present before starting the test.
+ File aFile = new File("target/test10_marker");
+ if (aFile.exists())
+ aFile.delete();
+
+ aCallBackService.setCallbackIllegally("Try to set callback on your own service reference");
+
+ Assert.assertEquals("CallBackSetCallback - Test10", true, aFile.exists());
+
+ return;
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackClientImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,44 @@
+/*
+ * 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 CallBackSetCallbackObjectCallback implements CallBackSetCallbackCallback {
+
+ private int callBackCount = 0;
+
+ public CallBackSetCallbackObjectCallback() {
+ super();
+ }
+
+ public void incrementCallBackCount() {
+ callBackCount++;
+ }
+
+ public void callBackMessage(String aString) {
+
+ System.out.println("Entering CallBackSetCallbackObjectCallback callBackMessage: " + aString);
+
+ }
+
+ 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/CallBackSetCallbackObjectCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackObjectCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,103 @@
+/*
+ * 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.Service;
+
+@Service(CallBackSetCalbackService.class)
+public class CallBackSetCallbackServiceImpl implements CallBackSetCalbackService {
+
+ @Callback
+ private CallBackSetCallbackCallback 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 needs to be removed once
+ // appropriate exception is
+ // identified.
+ {
+ // 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/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/java/org/apache/tuscany/sca/test/CallBackSetCallbackServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/main/resources/META-INF/sca/default.scdl Fri Jan 12 09:51:22 2007
@@ -0,0 +1,40 @@
+<?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="CallBackSetCallbackTest">
+
+ <component name="CallBackSetCallbackClient">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackClientImpl"/>
+ <reference name="aCallBackService">
+ CallBackSetCallbackService
+ </reference>
+ <reference name="callBack">
+ CallBackSetCallbackCallback
+ </reference>
+ </component>
+
+ <component name="CallBackSetCallbackCallback">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackCallbackImpl"/>
+ </component>
+
+ <component name="CallBackSetCallbackService">
+ <implementation.java class="org.apache.tuscany.sca.test.CallBackSetCallbackServiceImpl"/>
+ </component>
+</composite>
Added: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackITest.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackITest.java (added)
+++ incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackITest.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 CallBackSetCallbackITest extends TestCase {
+
+ private CallBackSetCallbackClient aCallBackClient;
+
+ public void testCallBackSetCallback() {
+ aCallBackClient.run();
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ aCallBackClient =
+ CurrentCompositeContext.getContext().locateService(CallBackSetCallbackClient.class,
+ "CallBackSetCallbackClient");
+ }
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackITest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/callBackSetCallbackTest/src/test/java/org/apache/tuscany/sca/test/CallBackSetCallbackITest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/
------------------------------------------------------------------------------
--- 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/conversationsTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/pom.xml?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/pom.xml (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/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>conversationsTest</artifactId>
+ <version>${testing.version}</version>
+ <packaging>jar</packaging>
+ <name>Test Suite for SCA conversations</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/conversationsTest/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherService.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherService.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherService.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,18 @@
+package org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.ServiceReference;
+
+@Remotable
+
+/**
+ *
+ */
+public interface AnotherService {
+
+ public void setService(ServiceReference aServiceReference);
+ public void add(int anInt);
+ public int getCount();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,59 @@
+package org.apache.tuscany.sca.test;
+
+import junit.framework.Assert;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Scope;
+import java.io.File;
+import org.apache.tuscany.sca.test.ConversationsClient;
+
+@Service(AnotherService.class)
+@Scope("CONVERSATION")
+
+public class AnotherServiceImpl implements AnotherService {
+
+ // This is a simple pass-thru service used to test propogation
+ // of ServiceReference and maintenance of Session state.
+
+ private ServiceReference aServiceReference;
+
+ public void add(int anInt) {
+
+ Assert.assertNotNull("AnotherServiceImpl - add ", aServiceReference);
+ ((ConversationsService) aServiceReference).add(anInt);
+
+ }
+
+
+ public void initializeCount() {
+
+ Assert.assertNotNull("AnotherServiceImpl - initializeCount ", aServiceReference);
+ ((ConversationsService) aServiceReference).initializeCount();
+
+ }
+
+
+ public void setService(ServiceReference aRef) {
+
+ Assert.assertNotNull("AnotherServiceImpl - setService ", aRef);
+ aServiceReference = aRef;
+
+ }
+
+
+ public int getCount() {
+
+ Assert.assertNotNull("AnotherServiceImpl - getCount ", aServiceReference);
+ return ((ConversationsService) aServiceReference).getLocalCount();
+ }
+
+
+}
+
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/AnotherServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsCallback.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsCallback.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsCallback.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsCallback.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,18 @@
+/**
+ *
+ */
+package org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @author lamodeo
+ *
+ */
+public interface ConversationsCallback {
+
+ public void callBackMessage(String aString);
+ public void callBackIncrement(String aString);
+ public void callBackEndSession();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,12 @@
+package org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+
+@Remotable
+public interface ConversationsClient {
+
+ public void run();
+ public int count();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient2.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient2.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient2.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,11 @@
+package org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+
+@Remotable
+public interface ConversationsClient2 {
+ public String getDateTime();
+
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClient2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClientImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClientImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClientImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,457 @@
+package org.apache.tuscany.sca.test;
+
+import java.io.File;
+import java.text.DateFormat;
+
+import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.ConversationEndedException;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.ConversationID;
+import org.osoa.sca.annotations.Conversation;
+
+
+import org.osoa.sca.RequestContext;
+import junit.framework.Assert;
+
+@Service(interfaces={ConversationsClient.class,ConversationsClient2.class})
+
+
+@Scope("CONVERSATION")
+@Conversation(maxIdleTime="10 minutes",
+ singlePrincipal=false)
+
+
+public class ConversationsClientImpl implements ConversationsClient, ConversationsClient2, ConversationsCallback {
+
+ @Reference
+ protected ConversationsService aService;
+ @Reference
+ protected AnotherService anotherService;
+ @Reference
+ protected ConversationsLifeCycleService aLifeCycleService;
+ @Context
+ protected CompositeContext myContext; // This is broken Tuscany-965 defect has been opened.
+ @ConversationID
+ protected String conversationID;
+
+ private Object monitor = new Object();
+ private int count=0;
+ private String message;
+ private String initialState;
+ private int initialCount = 56;
+ private String dateTime;
+ private final static String markerFileName = "target/testConversations_test3_marker";
+
+ public void run() {
+
+ // This tests various aspects of session lifecycle and maintenance of session state.
+ // None of these test are working due to various issues.
+
+ /* test0()
+ This test verifies annotations and API's for ConversationID.
+ */
+ test0(); // - Tuscany-1001.
+
+ /* test1()
+ Test stateful callbacks. Verify that the clientÂ’s state is maintained throughout the execution of
+ all callback methods.
+ */
+ test1(); // This test is working for MODULE scope. Cant claim succcess because it needs Conversation scope.
+
+ /* test2()
+ Test each method of starting a session. Test @Init.
+ */
+ test2(); // Tuscany-965, Tuscany-1001
+
+ /* test3()
+ Test each method of ending a session. Test @Destroy.
+ */
+ test3(); // Tuscany-965, Tuscany-1001
+
+ /* test4()
+ Pass an existing service reference with an active session to another service. Verify the session is maintained
+ */
+ test4(); // Tuscany-964, Tuscant-1001
+
+ /* test5()
+ Call the createServiceReferenceForSession() API to get a service reference for the active session.
+ Pass the service reference to another service. Verify the session is maintained.
+ */
+ test5();
+
+ /* test6()
+ * Allow a session to timeout.
+ */
+ test6(); // Tuscany-965, Tuscany-1001
+
+
+ return;
+ }
+
+ private void test0()
+ {
+
+ // Verify that conversationID was injected.
+ Assert.assertNotNull("test0 - conversationID injected", conversationID);
+ System.out.println("ConversationID: " + conversationID);
+
+ //
+ // The client may access the ConversationID by calling getConversationID on a Service Reference.
+ // This also verifies a session was created during injection of this Service Reference.
+ //
+ Object aServicesSessionID =((ServiceReference)aService).getSessionID();
+ Assert.assertNotNull("test0 - ConversationID from service reference", aServicesSessionID);
+
+ Object aLifeCycleServicesSessionID =((ServiceReference)aLifeCycleService).getSessionID();
+ Assert.assertNotNull("test0 - ConversationID from LifeCycleService service reference", aLifeCycleServicesSessionID);
+
+ // This will verify the @Init() is working for a session created during injection. See test2().
+ aLifeCycleService.knockKnock("Hello");
+
+ }
+
+ private void test1()
+ {
+
+ //
+ // This test verifies that the state of the client is preserved across method calls. Each
+ // call to the service results in 2 callbacks. One to increment a count and the other to set a string.
+ // At the end of the test the count should equal 5 and the string should be set. Also the original strings
+ // values should be preserved.
+ //
+ //
+ initialState = "Initial State";
+
+ int numCalls = 0;
+
+ for(int i=0; i < 10; i++)
+ {
+ aService.knockKnock("Knock Knock " + ++numCalls);
+ }
+
+ // I want to drive multiple callbacks and then give them time to complete. Don't want to
+ // force serialization. After 20 seconds check the assertions.
+
+ synchronized(monitor)
+ {
+ try
+ {
+ monitor.wait(20000L);
+ }
+ catch (Exception ex)
+ {ex.printStackTrace();}
+ }
+
+ // Here we test for the expected state of several different variables. State needs to be maintained
+ // across method calls to the service. If the same client instance is used then the state should match
+ // the following assertions.
+
+ // instance variable count should equal the number of calls to the backend service. count is incremented
+ // during callback processing.
+ Assert.assertEquals("Conversations - Test1 count", numCalls, count);
+ // The returned message should be like the following.
+ Assert.assertEquals("Conversations - Test1 message", true, message.startsWith("Who's There"));
+ // any initial state set prior to running the callbacks should be maintained.
+ Assert.assertEquals("Conversations - Test1 initialState", "Initial State", initialState);
+ Assert.assertEquals("Conversations - Test1 initialCount", 56, initialCount);
+
+ return;
+
+ }
+
+ private void test2()
+ {
+
+ // Verify the various methods to create a new Session.
+ // Sesssions can be started:
+ //
+ // 1) When a service reference is injected into a client. This is verified in test0().
+ // 2) By the client calling newSession() API with and without a ConversationID.
+ //
+ // Verify init() is called prior to any business methods. This is performed in the Service when any
+ // business methos is called.
+
+ myContext = CurrentCompositeContext.getContext();
+ Assert.assertNotNull("current composite context",myContext);
+
+ // This tests creating a conversational session. And that @Init is run prior to business method.
+ ServiceReference aServRef;
+ aServRef = myContext.newSession("ConversationsLifeCycleService");
+ Assert.assertNotNull("Conversations - Test2 Service Reference 1 not returned", aServRef);
+
+ //Get the session ID.
+ Object aConversationID = aServRef.getSessionID();
+ ConversationsLifeCycleService aConversationsLifeCycleService = (ConversationsLifeCycleService) aServRef;
+ aConversationsLifeCycleService.knockKnock("Hello");
+
+ //Create a new session this time specifying a session ID. Verify the seesion id is what was specified.
+ aServRef = myContext.newSession("ConversationsLifeCycleService","Test2-12345");
+ Assert.assertNotNull("Conversations - Test2 Service Reference 2 not returned", aServRef);
+ //Get the session ID.
+ Object aConversationID2 = aServRef.getSessionID();
+ Assert.assertEquals("Conversations - Test2 Session not created with specified ConversationID", "Test2-12345", aConversationID2);
+ aConversationsLifeCycleService = (ConversationsLifeCycleService) aServRef;
+ aConversationsLifeCycleService.knockKnock("Hello");
+
+ Assert.assertNotSame("Conversations - Test2 sessions are not different", aConversationID, aConversationID2);
+
+ }
+
+ private void test3()
+ {
+
+ // Note: The @EndSesion and @EndConversation anotations are not implemented.
+ // So #1 an #2 cannot be done.
+
+ //
+ // Verify the various methods to end a session.
+ // Sesssions can be ended:
+ //
+ // 1) Server operation annotated with @EndConversation.
+ // 2) Server operation calls an @EndSession annotated callback method.
+ // 3) Servers conversation lifetime times out. This is test6() so its not implimented in the test3 method.
+ // 4) The client calls ServiceReference.endSession();
+ //
+ // Verify @Destroy annotated method get called after completion of the business
+ // method that called the endSession.
+ //
+
+ ConversationsLifeCycleService aConversationsLifeCycleService;
+ Object aConversationID;
+ myContext = CurrentCompositeContext.getContext();
+ Assert.assertNotNull("current composite context",myContext);
+ ServiceReference aServRef;
+ this.removeMarkerFile();
+
+ //
+ // test3 variation #1 - Cannot be done annotation not implimented yet. 12/15/2006
+ //
+
+ aServRef = myContext.newSession("ConversationsLifeCycleService");
+ Assert.assertNotNull("Conversations - Test3-1 Service Reference not returned", aServRef);
+
+ aConversationsLifeCycleService = (ConversationsLifeCycleService) aServRef;
+ aConversationsLifeCycleService.knockKnock("Hello");
+ aConversationID = aServRef.getSessionID();
+ Assert.assertNotNull("Conversations - Test3-1 ConversationID not found", aConversationID);
+
+ //Call the business method annotated with @EndConversation.
+ aConversationsLifeCycleService.endThisSession(); // This should also drive @Destroy method.
+
+ // Verify session has ended. The ConversationID should be null;
+ aConversationID = aServRef.getSessionID();
+ Assert.assertNull("Conversations - Test3-1 session not null after endSession()", aConversationID);
+
+ // Verify Destroy was run. The baxckend service creates a marker file when @Destroy annotated method is run.
+ Assert.assertEquals("Conversations - Test3-1 @Destroy method not invoked", true, this.isMarkerFilePresent());
+ this.removeMarkerFile();
+
+ //
+ // test3 variation #2 - Cannot be done annotation not implimented yet. 12/15/2006
+ //
+
+ aServRef = myContext.newSession("ConversationsLifeCycleService");
+ Assert.assertNotNull("Conversations - Test3-2 Service Reference not returned", aServRef);
+
+ aConversationsLifeCycleService = (ConversationsLifeCycleService) aServRef;
+ aConversationsLifeCycleService.knockKnock("Hello");
+ aConversationID = aServRef.getSessionID();
+ Assert.assertNotNull("Conversations - Test3-2 ConversationID not found", aConversationID);
+
+ //Call the business method that will invoke my @EndSession callback method.
+ aConversationsLifeCycleService.endThisSessionUsingCallback(); // This should also drive @Destroy method.
+
+ // Verify session has ended. The ConversationID should be null;
+ aConversationID = aServRef.getSessionID();
+ Assert.assertNull("Conversations - Test3-2 session not null after endSession()", aConversationID);
+
+ // Verify Destroy was run. The baxckend service creates a marker file when @Destroy annotated method is run.
+ Assert.assertEquals("Conversations - Test3-2 @Destroy method not invoked", true, this.isMarkerFilePresent());
+ this.removeMarkerFile();
+
+ //
+ // test3 variation #4 - Client calls endSession()
+ //
+
+ aServRef = myContext.newSession("ConversationsLifeCycleService");
+ Assert.assertNotNull("Conversations - Test3-4 Service Reference not returned", aServRef);
+
+ aConversationsLifeCycleService = (ConversationsLifeCycleService) aServRef;
+ aConversationsLifeCycleService.knockKnock("Hello");
+ aConversationID = aServRef.getSessionID();
+ Assert.assertNotNull("Conversations - Test3-4 ConversationID not found", aConversationID);
+
+ //Call the endSession() API on the Service Reference.
+ aServRef.endSession(); // This should also drive @Destroy method.
+
+ // Verify session has ended. The ConversationID should be null;
+ aConversationID = aServRef.getSessionID();
+ Assert.assertNull("Conversations - Test3-4 session not null after endSession()", aConversationID);
+
+ // Verify Destroy was run. The baxckend service creates a marker file when @Destroy annotated method is run.
+ Assert.assertEquals("Conversations - Test3-4 @Destroy method not invoked", true, this.isMarkerFilePresent());
+ this.removeMarkerFile();
+ }
+
+ public void test4()
+ {
+
+ //
+ // This test uses the injected active session for the ConversationsService. It starts a conversation
+ // in this method building up state with a counter. It then passes this reference to another backend service adding
+ // additional state. It then returns and adds more state using original service and then performs the Assertions.
+ //
+
+ aService.initializeCount();
+ aService.add(1);
+ anotherService.setService((ServiceReference)aService);
+ anotherService.add(1);
+ anotherService.add(1);
+ aService.add(1);
+ aService.add(1);
+ int count = anotherService.getCount();
+
+ Assert.assertEquals("test4 - ConversationsClientImpl ", 5, count);
+
+ return;
+ }
+
+
+ public void test5()
+ {
+
+ // The first test verifies that the createServiceReferenceForSession(this) API is functioning.
+ // This is done in the backend serviced as it needs a single interface defined. The 2nd test
+ // uses the variant of this API when > 1 interfaces are implemented.
+ //
+ // The 2nd test obtains a service reference for myself and passes that reference to a backend service.
+ // The backend service then invokes the count() method on my service reference. It then returns
+ // the count that it retrieved. The test then asserts that the count returned from the backend
+ // service matches the client services internal state.
+ //
+
+ myContext = CurrentCompositeContext.getContext();
+ Assert.assertNotNull("current composite context",myContext);
+
+ boolean result = aService.createServiceReferenceForSelf();
+ System.out.println("Laa: returned from createServiceReferenceForSelf() " + result);
+ Assert.assertEquals("test5 - createServiceReferenceForSelf",true,result);
+
+ count = 6;
+ int returnCount = 0;
+ ServiceReference myServiceReference = myContext.createServiceReferenceForSession(this,"ConversationsClient2");
+ Assert.assertNotNull("test5 - createServiceReferenceForSession - myContext.createServiceReferenceForSession(this,ConversationsClient);", myServiceReference);
+ returnCount = aService.getCount(myServiceReference);
+
+ Assert.assertEquals("test5 - createServiceReferenceForSession(this,ConversationsClient2)",count,returnCount);
+ String aRemoteDateTime = aService.getDateTime(myServiceReference);
+ Assert.assertEquals("test5 - createServiceReferenceForSession(this,ConversationsClient2 - dateTime)", dateTime, aRemoteDateTime);
+
+ return;
+ }
+
+ public void test6()
+ {
+
+ //
+ // Create a session and allow it to timeout and verify that it did.
+ // Invoking a business method on a service that has timed out should result in
+ // a SessionEndedException.
+ //
+
+ myContext = CurrentCompositeContext.getContext();
+ Assert.assertNotNull("current composite context",myContext);
+
+ // This tests creating a conversational session. This service has a maxAge="5 seconds".
+ ServiceReference aServRef;
+ aServRef = myContext.newSession("ConversationsLifeCycleService");
+ Assert.assertNotNull("Conversations - Test6 Service Reference not returned", aServRef);
+
+ // Run a business method.
+ ConversationsLifeCycleService aConversationsLifeCycleService = (ConversationsLifeCycleService) aServRef;
+ aConversationsLifeCycleService.knockKnock("Hello");
+
+ //
+ // wait 10 seconds so session will time out.
+ //
+ try {
+ Thread.sleep(10000L);
+ }
+ catch (InterruptedException ex)
+ {
+ ex.printStackTrace();
+ }
+
+ // Run a busineess method after timeout period has elapsed.
+ boolean sessionEnded = false;
+ try
+ {
+ aConversationsLifeCycleService.knockKnock("Hello");
+ }
+ catch (ConversationEndedException sex)
+ {
+ sessionEnded = true;
+ }
+
+ Assert.assertEquals("Conversations - Test6 Session did not timeout ", true, sessionEnded);
+
+ return;
+ }
+
+
+ public synchronized void callBackIncrement(String aString) {
+
+ count++;
+ System.out.println("Laa: callBackIncrement invoked on client. count = " + count);
+
+ }
+
+ public synchronized void callBackMessage(String aString) {
+
+ message = aString;
+ System.out.println("Laa: callBackIMessage invoked on client. message = " + message);
+
+ }
+
+ // @EndSession - This is for test3() variation #2.
+ public void callBackEndSession() {
+
+ System.out.println("Laa: callBackEndSession method invoked on client.");
+
+ }
+
+ public int count()
+ {
+ return this.count;
+ }
+
+ public String getDateTime() {
+
+ dateTime = DateFormat.getDateTimeInstance().toString();
+ return dateTime;
+
+ }
+
+ private void removeMarkerFile()
+ {
+ // Make sure the marker file is not present before starting the test.
+ File aFile = new File(markerFileName);
+ if (aFile.exists())
+ aFile.delete();
+ }
+
+ private boolean isMarkerFilePresent()
+ {
+ File aFile = new File(markerFileName);
+ return aFile.exists();
+ }
+
+
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClientImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsClientImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleService.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleService.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleService.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,20 @@
+package org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.ServiceReference;
+
+@Remotable
+@Callback(ConversationsCallback.class)
+
+/**
+ *
+ */
+public interface ConversationsLifeCycleService {
+
+ public String knockKnock(String aString);
+ public void endThisSession();
+ public void endThisSessionUsingCallback();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,81 @@
+package org.apache.tuscany.sca.test;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Conversation;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.EndConversation;
+import org.apache.tuscany.sca.test.ConversationsClient;
+
+@Service(ConversationsLifeCycleService.class)
+@Scope("CONVERSATION")
+@Conversation(maxAge="5 seconds")
+
+// This is a short-lived conversational service.
+
+public class ConversationsLifeCycleServiceImpl implements ConversationsLifeCycleService {
+
+ @Callback
+ protected ConversationsCallback callback;
+
+ private String state = "NOT READY";
+ private final static String markerFileName = "target/testConversations_test3_marker";
+
+
+ public String knockKnock(String aString) {
+
+ // Prior to any business methods being invoked the state must have been set to READY using the @Init.
+ System.out.println("ConversationsLifeCycleServiceImpl.knockKnock - State = " + state);
+ Assert.assertEquals("ConversationsLifeCycleServiceImpl.knockKnock - not in READY state ", "READY", state);
+
+ return "Who's There!";
+ }
+
+ @Init
+ public void init()
+ {
+ state = "READY";
+ System.out.println("ConversationsLifeCycleServiceImpl.init()");
+ }
+
+
+ @Destroy
+ public void destroy()
+ {
+ state = "DESTROYED";
+
+ File aFile = new File(markerFileName);
+ try
+ {
+ aFile.createNewFile();
+ }
+ catch (Exception ex)
+ {
+ System.out.println("Error Creating " + markerFileName);
+ ex.printStackTrace();
+ }
+ System.out.println("ConversationsLifeCycleServiceImpl.destroy()");
+ }
+
+// @EndConversation
+ public void endThisSession() {
+ //This method will end the current session by annotation.
+ System.out.println("ConversationsLifeCycleServiceImpl.endThisSession()");
+
+ }
+
+ public void endThisSessionUsingCallback() {
+
+ //This method will end the current session by a callback method annotated with @EndSession.
+ callback.callBackEndSession();
+ System.out.println("ConversationsLifeCycleServiceImpl.endThisSessionUsingCallback()");
+ }
+
+}
+
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsLifeCycleServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsService.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsService.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsService.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,24 @@
+package org.apache.tuscany.sca.test;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.ServiceReference;
+
+@Remotable
+@Callback(ConversationsCallback.class)
+
+/**
+ *
+ */
+public interface ConversationsService {
+
+ public void knockKnock(String aString);
+ public void add(int anInt);
+ public void initializeCount();
+ public int getCount(ServiceReference aServiceReference);
+ public int getLocalCount();
+ public String getDateTime(ServiceReference aServiceReference);
+ public boolean createServiceReferenceForSelf();
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsServiceImpl.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsServiceImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,134 @@
+package org.apache.tuscany.sca.test;
+
+import junit.framework.Assert;
+
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Remotable;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Scope;
+import java.io.File;
+import org.apache.tuscany.sca.test.ConversationsClient;
+
+@Service(ConversationsService.class)
+@Scope("CONVERSATION")
+
+public class ConversationsServiceImpl implements ConversationsService {
+
+ @Callback
+ // Note injection is not working with a private access modifier.
+ protected ConversationsCallback callback;
+ private int count=0;
+
+ public void knockKnock(String aString) {
+
+ try
+ {
+ count++;
+ //System.out.println("ConversationsServiceImpl message received: " + aString);
+ callback.callBackMessage("Who's There " + count);
+ callback.callBackIncrement("Add one please");
+ //System.out.println("ConversationsServiceImpl responses sent");
+ return;
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ }
+
+ public int getCount(ServiceReference aServiceReference)
+ {
+
+ //
+ // Invoke a method on the service reference and return back the result.
+ //
+
+ int count=0;
+ try
+ {
+ count = ((ConversationsClient) aServiceReference).count();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ return count;
+
+ }
+
+ public int getLocalCount()
+ {
+
+ //
+ // Return my localc instance count. This is used for test4.
+ //
+
+ return count;
+
+ }
+
+ public String getDateTime(ServiceReference aServiceReference)
+ {
+
+ //
+ // Invoke a method on the service reference and return back the result.
+ //
+
+ String dateTime;
+ dateTime = ((ConversationsClient2) aServiceReference).getDateTime();
+ return dateTime;
+
+ }
+
+ public void add(int anInt) {
+
+ count +=anInt;
+
+ }
+
+ public void initializeCount() {
+
+ count =0;
+
+ }
+
+ public boolean createServiceReferenceForSelf() {
+
+ // This is done here because we need to test getting a ServiceReference
+ // from a component that implements a single interface. The client in this test
+ // impliments 2 interfaces to test the variant of this that takes interface name as an argumnet.
+
+ boolean aBoolean = false;
+
+ ServiceReference myServiceReference = null;
+ CompositeContext ctx = CurrentCompositeContext.getContext();
+
+ try
+ {
+ myServiceReference = ctx.createServiceReferenceForSession(this);
+ System.out.println("Laa: Created Service Reference for Session:" + myServiceReference);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+
+ if (myServiceReference != null)
+ {
+ aBoolean = true;
+ System.out.println("Laa: Service Reference is not null");
+ }
+
+ return aBoolean;
+ }
+
+
+}
+
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/java/org/apache/tuscany/sca/test/ConversationsServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/main/resources/META-INF/sca/default.scdl Fri Jan 12 09:51:22 2007
@@ -0,0 +1,48 @@
+<?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="ConversationsTest">
+
+ <component name="ConversationsClient">
+ <implementation.java class="org.apache.tuscany.sca.test.ConversationsClientImpl"/>
+ <reference name="aService">
+ ConversationsService
+ </reference>
+ <reference name="anotherService">
+ AnotherService
+ </reference>
+ <reference name="aLifeCycleService">
+ ConversationLifeCycleService
+ </reference>
+ </component>
+
+ <component name="ConversationsService">
+ <implementation.java class="org.apache.tuscany.sca.test.ConversationsServiceImpl"/>
+ </component>
+
+ <component name="AnotherService">
+ <implementation.java class="org.apache.tuscany.sca.test.AnotherServiceImpl"/>
+ </component>
+
+ <component name="ConversationLifeCycleService">
+ <implementation.java class="org.apache.tuscany.sca.test.ConversationsLifeCycleServiceImpl"/>
+ </component>
+
+</composite>
Added: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/test/java/org/apache/tuscany/sca/test/ConversationsITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/conversationsTest/src/test/java/org/apache/tuscany/sca/test/ConversationsITest.java?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/conversationsTest/src/test/java/org/apache/tuscany/sca/test/ConversationsITest.java (added)
+++ incubator/tuscany/java/testing/sca/itest/conversationsTest/src/test/java/org/apache/tuscany/sca/test/ConversationsITest.java Fri Jan 12 09:51:22 2007
@@ -0,0 +1,23 @@
+package org.apache.tuscany.sca.test;
+
+import junit.framework.TestCase;
+import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.annotations.Reference;
+
+public class ConversationsITest extends TestCase {
+
+ private ConversationsClient aConversationsClient;
+
+ public void testConversations() {
+ aConversationsClient.run();
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ aConversationsClient = CurrentCompositeContext.getContext().locateService(ConversationsClient.class, "ConversationsClient/org.apache.tuscany.sca.test.ConversationsClient");
+
+ }
+
+
+
+}
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/test/java/org/apache/tuscany/sca/test/ConversationsITest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/conversationsTest/src/test/java/org/apache/tuscany/sca/test/ConversationsITest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/testing/sca/itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/pom.xml?view=auto&rev=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/pom.xml (added)
+++ incubator/tuscany/java/testing/sca/itest/pom.xml Fri Jan 12 09:51:22 2007
@@ -0,0 +1,122 @@
+<?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</groupId>
+ <artifactId>parent</artifactId>
+ <version>2-incubator-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.testing</groupId>
+ <artifactId>sca-itest</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Tuscany SCA Integration Test Suite</name>
+
+ <properties>
+ <sca.version>1.0-incubator-SNAPSHOT</sca.version>
+ <sdo.version>1.0-incubator-SNAPSHOT</sdo.version>
+ <testing.version>1.0-incubator-SNAPSHOT</testing.version>
+ </properties>
+
+ <modules>
+ <module>specTest</module>
+ <module>propertyTest</module>
+ <module>bindingsTest</module>
+ <module>callBackAPITest</module>
+ <module>callBackBasicTest</module>
+ <module>callBackCTypeTest</module>
+ <module>callBackIDTest</module>
+ <module>callBackSetCallbackTest</module>
+ <module>callBackSetCallbackConvTest</module>
+ <module>conversationsTest</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r0.95</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <artifactId>tuscany-itest-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>start</id>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/*ITest.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop</id>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*ITest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
\ No newline at end of file
Propchange: incubator/tuscany/java/testing/sca/itest/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/testing/sca/itest/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml?view=diff&rev=495660&r1=495659&r2=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml (original)
+++ incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml Fri Jan 12 09:51:22 2007
@@ -1,78 +1,60 @@
+<?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>tuscany-testing-sca</artifactId>
+ <artifactId>sca-itest</artifactId>
<version>1.0-incubator-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.tuscany.testing</groupId>
<artifactId>propertyTest</artifactId>
- <version>SNAPSHOT</version>
+ <version>${testing.version}</version>
<packaging>jar</packaging>
+ <name>Test Suite for SCA properties</name>
<dependencies>
<dependency>
<groupId>org.osoa</groupId>
<artifactId>sca-api-r0.95</artifactId>
- <version>1.0-incubator-M2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
</dependency>
</dependencies>
<build>
- <defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
</plugin>
<plugin>
<groupId>org.apache.tuscany.sca.plugins</groupId>
<artifactId>tuscany-itest-plugin</artifactId>
- <executions>
- <execution>
- <id>start</id>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>test</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <includes>
- <include>**/*ITest.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>stop</id>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/*ITest.java</exclude>
- </excludes>
- </configuration>
</plugin>
</plugins>
</build>
Modified: incubator/tuscany/java/testing/sca/itest/specTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/specTest/pom.xml?view=diff&rev=495660&r1=495659&r2=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/specTest/pom.xml (original)
+++ incubator/tuscany/java/testing/sca/itest/specTest/pom.xml Fri Jan 12 09:51:22 2007
@@ -1,76 +1,90 @@
+<?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>tuscany-testing-sca</artifactId>
+ <artifactId>sca-itest</artifactId>
<version>1.0-incubator-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>specTest</artifactId>
<version>SNAPSHOT</version>
<packaging>jar</packaging>
+ <name>Test Suite for SCA Spec APIs</name>
<dependencies>
<dependency>
<groupId>org.osoa</groupId>
<artifactId>sca-api-r0.95</artifactId>
- <version>1.0-incubator-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
</dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.sca.plugins</groupId>
- <artifactId>tuscany-itest-plugin</artifactId>
- <executions>
- <execution>
- <id>start</id>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>test</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <includes>
- <include>**/*Test.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>stop</id>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/*Test.java</exclude>
- </excludes>
- </configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <artifactId>tuscany-itest-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>start</id>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop</id>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*Test.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
Modified: incubator/tuscany/java/testing/sca/itest/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java?view=diff&rev=495660&r1=495659&r2=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java (original)
+++ incubator/tuscany/java/testing/sca/itest/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java Fri Jan 12 09:51:22 2007
@@ -31,7 +31,7 @@
public class MyListServiceImpl implements MyListService, MyListServiceByYear {
// This is multiplicity=1:n
- @Reference(name = "myListServiceList", required = true)
+ @Reference(name = "myListServiceList", required = false)
public List<MyListService> myListServicesList;
// This is multiplicity=0:n
Modified: incubator/tuscany/java/testing/sca/itest/specTest/src/main/resources/META-INF/sca/myListService.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/specTest/src/main/resources/META-INF/sca/myListService.scdl?view=diff&rev=495660&r1=495659&r2=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/specTest/src/main/resources/META-INF/sca/myListService.scdl (original)
+++ incubator/tuscany/java/testing/sca/itest/specTest/src/main/resources/META-INF/sca/myListService.scdl Fri Jan 12 09:51:22 2007
@@ -23,8 +23,10 @@
<component name="MyNewListService">
<implementation.java class="org.apache.tuscany.sca.test.spec.impl.MyListServiceImpl"/>
+ <!--
<reference name="myListServiceList">MyNCService/MyListService</reference>
<reference name="myListServiceArray">MyListServiceFor2006/MyListService</reference>
+ -->
<property name="serviceYear">2007</property>
</component>
Modified: incubator/tuscany/java/testing/sca/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/pom.xml?view=diff&rev=495660&r1=495659&r2=495660
==============================================================================
--- incubator/tuscany/java/testing/sca/pom.xml (original)
+++ incubator/tuscany/java/testing/sca/pom.xml Fri Jan 12 09:51:22 2007
@@ -36,68 +36,15 @@
</properties>
<modules>
- <module>itest/specTest</module>
- <module>itest/propertyTest</module>
+ <module>itest</module>
<!--
<module>interop</module>
-->
</modules>
-<!--
- <dependencies>
- <dependency>
- <groupId>org.osoa</groupId>
- <artifactId>sca-api-r0.95</artifactId>
- <version>1.0-incubator-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.kernel</groupId>
- <artifactId>core</artifactId>
- <version>${sca.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.services.bindings</groupId>
- <artifactId>axis2</artifactId>
- <version>${sca.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.services.databinding</groupId>
- <artifactId>databinding-sdo</artifactId>
- <version>${sca.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.services.databinding</groupId>
- <artifactId>databinding-axiom</artifactId>
- <version>${sca.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.services.idl</groupId>
- <artifactId>wsdl</artifactId>
- <version>${sca.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>test</artifactId>
- <version>${sca.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
--->
-
<build>
- <defaultGoal>install</defaultGoal>
+ <defaultGoal>test</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org