Author: rfeng
Date: Tue Aug 21 15:35:03 2007
New Revision: 568313
URL: http://svn.apache.org/viewvc?rev=568313&view=rev
Log:
Add an itest for CallableReference/ServiceReference
Added:
incubator/tuscany/java/sca/itest/callablereferences/ (with props)
incubator/tuscany/java/sca/itest/callablereferences/pom.xml (with props)
incubator/tuscany/java/sca/itest/callablereferences/src/
incubator/tuscany/java/sca/itest/callablereferences/src/main/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java
(with props)
incubator/tuscany/java/sca/itest/callablereferences/src/main/resources/
incubator/tuscany/java/sca/itest/callablereferences/src/main/resources/CallableReferenceTest.composite
incubator/tuscany/java/sca/itest/callablereferences/src/test/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
(with props)
Propchange: incubator/tuscany/java/sca/itest/callablereferences/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 21 15:35:03 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/sca/itest/callablereferences/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/pom.xml?rev=568313&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/callablereferences/pom.xml (added)
+++ incubator/tuscany/java/sca/itest/callablereferences/pom.xml Tue Aug 21
15:35:03 2007
@@ -0,0 +1,46 @@
+<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callablereferences</artifactId>
+ <name>Apache Tuscany Callable References Integration Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+</project>
Propchange: incubator/tuscany/java/sca/itest/callablereferences/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/callablereferences/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java
Tue Aug 21 15:35:03 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.itest.callableref;
+
+public interface AComponent {
+ String foo();
+
+ String fooB();
+
+ String fooC();
+ String fooC1();
+
+ String fooD();
+
+ String fooBC();
+
+ DComponent getDReference();
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,84 @@
+/*
+ * 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.itest.callableref;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
[EMAIL PROTECTED](AComponent.class)
+public class AComponentImpl implements AComponent {
+
+ @Context
+ protected ComponentContext componentContext;
+
+ @Reference(name = "bReference")
+ protected BComponent b;
+
+ @Reference
+ protected CComponent cReference;
+
+ // TODO: to be implemented
+ @Reference
+ protected ServiceReference<CComponent> cServiceReference;
+
+ @Reference(required=false)
+ protected DComponent dReference;
+
+ protected DComponent dReference1;
+
+ @Reference(name = "dReference1")
+ public void setDReference(DComponent dReference) {
+ this.dReference1 = dReference;
+ }
+
+ public String foo() {
+ return "AComponent";
+ }
+
+ public String fooB() {
+ return b.foo();
+ }
+
+ public String fooC() {
+ return cReference.foo();
+ }
+
+ public String fooC1() {
+ return cServiceReference.getService().foo();
+ }
+
+ public String fooBC() {
+ CallableReference<CComponent> cReference =
componentContext.getServiceReference(CComponent.class, "cReference");
+ return b.fooC(cReference);
+ }
+
+ public String fooD() {
+ CallableReference<AComponent> aReference =
componentContext.createSelfReference(AComponent.class);
+ return dReference1.foo(aReference);
+ }
+
+ public DComponent getDReference() {
+ return dReference;
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java
Tue Aug 21 15:35:03 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.itest.callableref;
+
+import org.osoa.sca.CallableReference;
+
+public interface BComponent {
+
+ String foo();
+
+ String fooC(CallableReference<CComponent> cComponent);
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.itest.callableref;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.annotations.Service;
+
[EMAIL PROTECTED](BComponent.class)
+public class BComponentImpl implements BComponent {
+
+ public BComponentImpl() {
+ }
+
+ public String foo() {
+ return "BComponent";
+ }
+
+ public String fooC(CallableReference<CComponent> cReference) {
+ return "B" + cReference.getService().foo();
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,24 @@
+/*
+ * 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.itest.callableref;
+
+public interface CComponent {
+
+ String foo();
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,30 @@
+/*
+ * 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.itest.callableref;
+
+import org.osoa.sca.annotations.Service;
+
[EMAIL PROTECTED](CComponent.class)
+public class CComponentImpl implements CComponent {
+
+ public String foo() {
+ return "CComponent";
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,26 @@
+/*
+ * 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.itest.callableref;
+
+import org.osoa.sca.CallableReference;
+
+public interface DComponent {
+
+ String foo(CallableReference<AComponent> aReference);
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.itest.callableref;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.annotations.Service;
+
[EMAIL PROTECTED](DComponent.class)
+public class DComponentImpl implements DComponent {
+
+ public String foo(CallableReference<AComponent> aReference) {
+ /*
+ try {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(bos);
+ oos.writeObject(aReference);
+ ObjectInputStream ois = new ObjectInputStream(new
ByteArrayInputStream(bos.toByteArray()));
+ Object obj = ois.readObject();
+ aReference = (CallableReference<AComponent>) obj;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ */
+ return "D" + aReference.getService().foo();
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/main/resources/CallableReferenceTest.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/main/resources/CallableReferenceTest.composite?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/main/resources/CallableReferenceTest.composite
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/main/resources/CallableReferenceTest.composite
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,47 @@
+<?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
+ * 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" xmlns:foo="http://foo"
targetNamespace="http://foo"
+ name="InnerReferencesTest"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <service name="AComponent" promote="AComponent">
+ <interface.java
interface="org.apache.tuscany.sca.itest.callableref.AComponent" />
+ </service>
+
+ <component name="AComponent">
+ <implementation.java
class="org.apache.tuscany.sca.itest.callableref.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ <reference name="cReference" target="CComponent" />
+ <reference name="cServiceReference" target="CComponent" />
+ <reference name="dReference1" target="DComponent" />
+ <reference name="DReference2" target="DComponent" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java
class="org.apache.tuscany.sca.itest.callableref.BComponentImpl" />
+ <reference name="cReference" target="CComponent" />
+ </component>
+
+ <component name="CComponent">
+ <implementation.java
class="org.apache.tuscany.sca.itest.callableref.CComponentImpl" />
+ </component>
+
+ <component name="DComponent">
+ <implementation.java
class="org.apache.tuscany.sca.itest.callableref.DComponentImpl" />
+ </component>
+</composite>
\ No newline at end of file
Added:
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java?rev=568313&view=auto
==============================================================================
---
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
(added)
+++
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
Tue Aug 21 15:35:03 2007
@@ -0,0 +1,78 @@
+/*
+ * 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.itest.callableref;
+
+import static junit.framework.Assert.assertEquals;
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class CallableReferenceTestCase {
+ private static SCADomain domain;
+ private static AComponent acomponent;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ domain = SCADomain.newInstance("CallableReferenceTest.composite");
+ acomponent = domain.getService(AComponent.class, "AComponent");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ domain.close();
+ }
+
+ @Test
+ public void testBReference() {
+ assertEquals("BComponent", acomponent.fooB());
+ }
+
+ @Test
+ public void testCReference() {
+ assertEquals("CComponent", acomponent.fooC());
+ }
+
+ @Test
+ public void testCServiceReference() {
+ assertEquals("CComponent", acomponent.fooC1());
+ }
+
+ @Test
+ public void testDReference() {
+ assertEquals("DAComponent", acomponent.fooD());
+ }
+
+ @Test
+ public void testBCReference() {
+ assertEquals("BCComponent", acomponent.fooBC());
+ }
+
+ @Test
+ public void testRequiredFalseReference() {
+ try {
+ acomponent.getDReference().foo(null);
+ } catch (Exception e) {
+ Assert.assertTrue(true);
+ }
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/itest/callablereferences/src/test/java/org/apache/tuscany/sca/itest/callableref/CallableReferenceTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]