You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2011/08/05 14:49:17 UTC

svn commit: r1154191 - in /tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite: ./ src/ src/main/ src/main/java/ src/main/java/policy/ src/main/java/recursive/ src/main/resources/ src/main/resources/bindingoverride/ src/main/resources/pol...

Author: slaws
Date: Fri Aug  5 12:49:16 2011
New Revision: 1154191

URL: http://svn.apache.org/viewvc?rev=1154191&view=rev
Log:
TUSCANY-3907 - Fix up and appropriate what was the recursive-ws to become an implementation-composite test. Initially I needed a test to look into the problem described by TUSCANY-3907 and found that recursive-ws want actually in the build and hadn't been ported properly to 2.x. It seems more widely useful that just ws testing hence the name change. 

Added:
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/pom.xml
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/Target.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetClientImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetServiceImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/Composer.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClient.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClientImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerServer.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/InnerComposite.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/OuterComposite.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyInnerComposite.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyOuterComposite.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/definitions.xml
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Client.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Inner.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Outer.composite
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/BindingOverrideTestCase.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/PolicyTestCase.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/ComposerClientTestCase.java
    tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/CompositeMulitStartTestCase.java

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug  5 12:49:16 2011
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/pom.xml?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/pom.xml Fri Aug  5 12:49:16 2011
@@ -0,0 +1,53 @@
+<?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>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-implementation-composite</artifactId>
+    <name>Apache Tuscany SCA iTest implementation-composite</name>
+    <version>2.0-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-base-runtime-pom</artifactId>
+            <type>pom</type>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+
+       <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+            <version>2.0-SNAPSHOT</version>
+       </dependency>
+                
+        <dependency>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty</artifactId>
+            <version>6.1.19</version>
+        </dependency>
+    </dependencies>
+
+</project>

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/Target.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/Target.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/Target.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/Target.java Fri Aug  5 12:49:16 2011
@@ -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 policy;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Target {
+    String hello(String arg);
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetClientImpl.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetClientImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetClientImpl.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package policy;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Target.class)
+public class TargetClientImpl implements Target {
+
+    @Reference
+    protected Target targetService;
+
+    public String hello(String arg) {
+        return "Target: Hello " + targetService.hello(arg) + "!";
+    }
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetServiceImpl.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetServiceImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/policy/TargetServiceImpl.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,29 @@
+/*
+ * 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 policy;
+
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Target.class)
+public class TargetServiceImpl implements Target {
+
+    public String hello(String arg) {
+        return "Target: Hello " + arg + "!";
+    }
+}

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/Composer.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/Composer.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/Composer.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/Composer.java Fri Aug  5 12:49:16 2011
@@ -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 recursive;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Composer {
+    public String Compose(String s);
+}
\ No newline at end of file

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClient.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClient.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClient.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClient.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,42 @@
+/*
+ * 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 recursive;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+
+/**
+ *  For testing purpose
+ */
+public class ComposerClient {
+
+    public final static void main(String[] args) throws Exception {
+    	NodeFactory factory = NodeFactory.newInstance();
+        Node node = factory.createNode(new File("src/main/resources/Client.composite").toURI().toURL().toString(),
+                new Contribution("TestContribution", new File("src/main/resources/").toURI().toURL().toString()));
+        node.start();
+        Composer composer = node.getService(Composer.class, "ClientComponent/Composer");
+        System.out.println(composer.Compose("ABC"));
+        node.stop();
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClientImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClientImpl.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClientImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerClientImpl.java Fri Aug  5 12:49:16 2011
@@ -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 recursive;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * @version $Rev: 905603 $ $Date: 2010-02-02 12:18:47 +0000 (Tue, 02 Feb 2010) $
+ */
+public class ComposerClientImpl implements Composer {
+    @Reference
+    protected Composer composerWS;
+    
+    /**
+     * @see recursive.Composer#Compose(java.lang.String)
+     */
+    public String Compose(String s) {
+        return composerWS.Compose(s);
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerImpl.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerImpl.java Fri Aug  5 12:49:16 2011
@@ -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 recursive;
+
+/**
+ * Composer Component Implementation
+ * 
+ */
+
+public class ComposerImpl implements Composer {
+
+    public String Compose(String s) {
+        System.out.println("Composing " + s + "...");
+        return "Composed: " + s;
+
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerServer.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerServer.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerServer.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/java/recursive/ComposerServer.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,42 @@
+/*
+ * 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 recursive;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+
+/**
+ *  For testing purpose
+ */
+public class ComposerServer {
+
+    public final static void main(String[] args) throws Exception {
+    	NodeFactory factory = NodeFactory.newInstance();
+        Node node = factory.createNode(new File("src/main/resources/Outer.composite").toURI().toURL().toString(),
+                new Contribution("TestContribution", new File("src/main/resources/").toURI().toURL().toString()));
+        node.start();
+        System.out.println("Press Enter to exit...");
+        System.in.read();
+        node.stop();
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/InnerComposite.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/InnerComposite.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/InnerComposite.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/InnerComposite.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,36 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+    targetNamespace="http://bindingoverride"
+    xmlns:bindingoverride="http://bindingoverride"
+    name="BindingOverrideInnerComposite">
+
+   	<service name="InnerService" promote="InnerServiceComponent"> 
+        <interface.java interface="policy.Target"/>
+    </service>
+	
+    <component name="InnerServiceComponent">
+		<implementation.java class="policy.TargetServiceImpl"/> 
+        <service name="Target">
+            <interface.java interface="policy.Target"/>
+        </service>		
+    </component>
+
+</composite>

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/OuterComposite.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/OuterComposite.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/OuterComposite.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/bindingoverride/OuterComposite.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,38 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+    targetNamespace="http://bindingoverride"
+    xmlns:bindingoverride="http://bindingoverride"
+    name="BindingOverrideOuterComposite">
+    
+    <component name="OuterClientComponent">
+        <implementation.java class="policy.TargetClientImpl"/>
+        <reference name="targetService" target="OuterServiceComponent"/>
+    </component>
+    
+    <component name="OuterServiceComponent">
+        <implementation.composite name="bindingoverride:BindingOverrideInnerComposite"/>
+        <service name="InnerService">
+            <interface.java interface="policy.Target"/>
+            <binding.ws uri="http://localhost:8085/OuterTargetServiceComponent"/>
+        </service>
+    </component>
+
+</composite>

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyInnerComposite.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyInnerComposite.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyInnerComposite.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyInnerComposite.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,37 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+    targetNamespace="http://policy"
+    xmlns:policy="http://policy"
+    name="PolicyInnerComposite">
+
+   	<service name="TargetService" promote="TargetServiceComponent"> 
+            <interface.java interface="policy.Target"/>
+    </service>
+	
+    <component name="TargetServiceComponent">
+		<implementation.java class="policy.TargetServiceImpl"/> 
+        <service name="Target">
+            <interface.java interface="policy.Target"/>
+            <binding.ws uri="http://localhost:8085/TargetServiceComponent"/>
+        </service>		
+    </component>
+
+</composite>

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyOuterComposite.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyOuterComposite.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyOuterComposite.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/PolicyOuterComposite.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,39 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+    targetNamespace="http://policy"
+    xmlns:policy="http://policy"
+    name="PolicyOuterComposite"
+    requires="policy:TestIntent_1">
+    
+    <component name="TargetClientComponent">
+        <implementation.java class="policy.TargetClientImpl"/>
+        <reference name="targetService" target="OuterTargetServiceComponent"/>
+    </component>
+    
+    <component name="OuterTargetServiceComponent">
+        <implementation.composite name="policy:PolicyInnerComposite"/>
+        <service name="TargetService">
+            <interface.java interface="policy.Target"/>
+            <binding.ws uri="http://localhost:8085/OuterTargetServiceComponent"/>
+        </service>
+    </component>
+
+</composite>

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/definitions.xml?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/definitions.xml (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/policy/definitions.xml Fri Aug  5 12:49:16 2011
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+    * 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.    
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" 
+             targetNamespace="http://policy"
+             xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+             xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+             xmlns:ip="http://policy" >
+
+    <!-- Policy Intents -->
+    <sca:intent name="TestIntent_1" constrains="sca:binding.ws">
+        <description>Test Intent One</description>
+    </sca:intent>
+
+    <!--  Policy Sets -->
+    <sca:policySet name="TestPolicySet_1_binding" 
+                   provides="ip:TestIntent_1" 
+                   appliesTo="sca:binding.ws"
+                   xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+        <wsp:Policy />
+    </sca:policySet>
+
+</definitions>
\ No newline at end of file

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Client.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Client.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Client.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Client.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,29 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912" 
+           targetNamespace="http://client" name="Client">
+    <component name="ClientComponent">
+        <implementation.java class="recursive.ComposerClientImpl" />
+        <reference name="composerWS">
+            <binding.ws uri="http://localhost:8085/OuterService"/>
+        </reference>
+    </component>
+</composite>

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Inner.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Inner.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Inner.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Inner.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,27 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912" 
+           targetNamespace="http://inner" name="Inner">
+    <component name="InnerComponent">
+        <implementation.java class="recursive.ComposerImpl" />
+    </component>
+    <service name="OuterService" promote="InnerComponent"/>
+</composite>

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Outer.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Outer.composite?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Outer.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/main/resources/recursive/Outer.composite Fri Aug  5 12:49:16 2011
@@ -0,0 +1,32 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912" 
+    targetNamespace="http://outer" xmlns:inner="http://inner"
+    name="Outer">
+    <component name="OuterComponent">
+        <implementation.composite name="inner:Inner" />
+        <service name="OuterService">
+            <interface.java interface="recursive.Composer" />
+            <binding.ws uri="http://localhost:8085/OuterService" />
+        </service>
+    </component>
+
+</composite>

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/BindingOverrideTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/BindingOverrideTestCase.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/BindingOverrideTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/bindingoverride/BindingOverrideTestCase.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,62 @@
+/*
+ * 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 bindingoverride;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import policy.Target;
+
+public class BindingOverrideTestCase{
+
+    private Node node;
+    private Target targetClient;
+
+    @Before
+    public void setUp() throws Exception {
+        try {
+            NodeFactory factory = NodeFactory.newInstance();
+            node = factory.createNode(new File("src/main/resources/bindingoverride/OuterComposite.composite").toURI().toURL().toString(),
+                    new Contribution("TestContribution", new File("src/main/resources/bindingoverride/").toURI().toURL().toString()));
+            node.start();
+            targetClient = node.getService(Target.class, "OuterClientComponent");
+        } catch(Exception ex) {
+            System.out.println(ex.toString());
+        }
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        node.stop();
+    }
+
+    @Test
+    public void test() throws Exception {
+        Assert.assertEquals("Target: Hello Target: Hello Fred!!", targetClient.hello("Fred"));
+    }
+}

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/PolicyTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/PolicyTestCase.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/PolicyTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/policy/PolicyTestCase.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,82 @@
+/*
+ * 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 policy;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.impl.CompositeImpl;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore("Doesn't work after porting")
+public class PolicyTestCase{
+
+    private Node node;
+    private Target targetClient;
+
+    @Before
+    public void setUp() throws Exception {
+        try {
+        	NodeFactory factory = NodeFactory.newInstance();
+            node = factory.createNode(new File("src/main/resources/policy/PolicyOuterComposite.composite").toURI().toURL().toString(),
+                    new Contribution("TestContribution", new File("src/main/resources/policy/").toURI().toURL().toString()));
+            node.start();
+            targetClient = node.getService(Target.class, "TargetClientComponent");
+        } catch(Exception ex) {
+            System.out.println(ex.toString());
+        }
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        node.stop();
+    }
+
+    @Test
+    public void test() throws Exception {
+    	//Check that the binding policy sets do flow down to the component but not down to the
+    	//component inside implementation.composite
+    	Component outerComponent = ((NodeImpl)node).getDomainComposite().getComponent("OuterTargetServiceComponent");
+    	
+    	// The outer component service bindings should have policy sets attached
+    	Assert.assertEquals(1, outerComponent.getServices().get(0).getPolicySets().size());
+    	
+    	Component component = ((CompositeImpl)outerComponent.getImplementation()).getComponents().get(0);
+    	
+    	// The original inner component service binding should not have policy sets attached
+    	Assert.assertEquals(0, ((PolicySet)component.getServices().get(0).getBindings().get(0)).getReferencedPolicySets().size());
+        
+        // The promoted inner component service binding should have policy sets attached
+    	Assert.assertEquals(1, ((PolicySet)component.getServices().get(1).getBindings().get(0)).getReferencedPolicySets().size());
+    	
+        String result = targetClient.hello("Fred");
+
+        System.out.println(result);
+    }
+}

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/ComposerClientTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/ComposerClientTestCase.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/ComposerClientTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/ComposerClientTestCase.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,68 @@
+/*
+ * 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 recursive;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import recursive.Composer;
+
+/**
+ * Test case for hweb service client 
+ */
+public class ComposerClientTestCase {
+
+    private Node node;
+    private Composer composer;
+
+    @Before
+    public void startClient() throws Exception {
+        try {
+            TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
+            node = tuscanyRuntime.createNode("myDomain");
+            
+            node.installContribution("contrib1", "src/main/resources/recursive", null, null);
+            node.startComposite("contrib1", "Outer.composite");
+            node.startComposite("contrib1", "Client.composite");
+
+            composer = node.getService(Composer.class, "ClientComponent/Composer");
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+    }
+    
+    @Test
+    public void testWSClient() throws Exception {
+        String msg = composer.Compose("ABC");
+        Assert.assertEquals("Composed: ABC", msg);
+    }
+    
+    @After
+    public void stopClient() throws Exception {
+        node.stop();
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/CompositeMulitStartTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/CompositeMulitStartTestCase.java?rev=1154191&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/CompositeMulitStartTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/implementation-composite/src/test/java/recursive/CompositeMulitStartTestCase.java Fri Aug  5 12:49:16 2011
@@ -0,0 +1,73 @@
+/*
+ * 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 recursive;
+
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import recursive.Composer;
+
+/**
+ * TUSCANY-3907
+ * Tests that a composite can be started at the top level and as a nested composite without
+ * have the fact the the composite will be built twice mess things up
+ */
+public class CompositeMulitStartTestCase {
+
+    private Node node;
+    private Composer composer;
+
+    @Before
+    public void startClient() throws Exception {
+        try {
+            TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
+            node = tuscanyRuntime.createNode("myDomain");
+            
+            node.installContribution("contrib1", "src/main/resources/recursive", null, null);
+            
+            node.startComposite("contrib1", "Inner.composite");
+            node.startComposite("contrib1", "Outer.composite");
+            node.startComposite("contrib1", "Client.composite");
+            
+            composer = node.getService(Composer.class, "ClientComponent/Composer");
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+    }
+    
+    @Test
+    public void testWSClient() throws Exception {
+        String msg = composer.Compose("ABC");
+        Assert.assertEquals("Composed: ABC", msg);
+    }
+    
+    @After
+    public void stopClient() throws Exception {
+        node.stop();
+    }
+
+}