You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by na...@apache.org on 2008/07/23 23:46:40 UTC

svn commit: r679205 - in /tuscany/branches/sca-java-1.3: itest/builder/src/main/resources/scenario10/ itest/builder/src/main/resources/scenario11/ itest/builder/src/main/resources/scenario13/ itest/builder/src/main/resources/scenario13/META-INF/ itest/...

Author: nash
Date: Wed Jul 23 14:46:39 2008
New Revision: 679205

URL: http://svn.apache.org/viewvc?rev=679205&view=rev
Log:
Extend TUSCANY-2324 fix for multiplicity > 1

Added:
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/service3.wsdl
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/service3.wsdl
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/META-INF/
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13.composite
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13a.composite
Modified:
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/scenario10a.composite
    tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/scenario11.composite
    tuscany/branches/sca-java-1.3/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
    tuscany/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java

Modified: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/scenario10a.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/scenario10a.composite?rev=679205&r1=679204&r2=679205&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/scenario10a.composite (original)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/scenario10a.composite Wed Jul 23 14:46:39 2008
@@ -33,7 +33,8 @@
     </reference>
     <reference name="reference2a" promote="ComponentD/reference3a">
         <!-- bindings and/or interfaces may or may not be specified explicitly here -->
-         <binding.ws />
+        <interface.wsdl interface="http://scenarios#wsdl.interface(Service3)" />
+        <binding.ws />
     </reference>    
 
     <component name="ComponentD">

Added: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/service3.wsdl
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/service3.wsdl?rev=679205&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/service3.wsdl (added)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario10/service3.wsdl Wed Jul 23 14:46:39 2008
@@ -0,0 +1,63 @@
+<?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.    
+-->
+<wsdl:definitions name="Service3Service"
+                  targetNamespace="http://scenarios"
+                  xmlns:tns="http://scenarios"
+                  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+  <wsdl:types>
+    <xs:schema attributeFormDefault="qualified"
+               elementFormDefault="unqualified"
+               targetNamespace="http://scenarios"
+               xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:element name="getGreetings">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="getGreetingsResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:schema>
+  </wsdl:types>
+
+  <wsdl:message name="getGreetings">
+    <wsdl:part name="getGreetings" element="tns:getGreetings" />
+  </wsdl:message>
+
+  <wsdl:message name="getGreetingsResponse">
+    <wsdl:part name="getGreetingsResponse" element="tns:getGreetingsResponse" />
+  </wsdl:message>
+
+  <wsdl:portType name="Service3">
+    <wsdl:operation name="getGreetings">
+      <wsdl:input message="tns:getGreetings" />
+      <wsdl:output message="tns:getGreetingsResponse" />
+    </wsdl:operation>
+  </wsdl:portType>
+
+</wsdl:definitions>

Modified: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/scenario11.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/scenario11.composite?rev=679205&r1=679204&r2=679205&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/scenario11.composite (original)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/scenario11.composite Wed Jul 23 14:46:39 2008
@@ -45,6 +45,7 @@
         </reference>
         <reference name="reference2a" target="ComponentF">
             <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+            <interface.wsdl interface="http://scenarios#wsdl.interface(Service3)" />
             <binding.ws />
         </reference>        
     </component>

Added: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/service3.wsdl
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/service3.wsdl?rev=679205&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/service3.wsdl (added)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario11/service3.wsdl Wed Jul 23 14:46:39 2008
@@ -0,0 +1,63 @@
+<?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.    
+-->
+<wsdl:definitions name="Service3Service"
+                  targetNamespace="http://scenarios"
+                  xmlns:tns="http://scenarios"
+                  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+  <wsdl:types>
+    <xs:schema attributeFormDefault="qualified"
+               elementFormDefault="unqualified"
+               targetNamespace="http://scenarios"
+               xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:element name="getGreetings">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="getGreetingsResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:schema>
+  </wsdl:types>
+
+  <wsdl:message name="getGreetings">
+    <wsdl:part name="getGreetings" element="tns:getGreetings" />
+  </wsdl:message>
+
+  <wsdl:message name="getGreetingsResponse">
+    <wsdl:part name="getGreetingsResponse" element="tns:getGreetingsResponse" />
+  </wsdl:message>
+
+  <wsdl:portType name="Service3">
+    <wsdl:operation name="getGreetings">
+      <wsdl:input message="tns:getGreetings" />
+      <wsdl:output message="tns:getGreetingsResponse" />
+    </wsdl:operation>
+  </wsdl:portType>
+
+</wsdl:definitions>

Added: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml?rev=679205&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml (added)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml Wed Jul 23 14:46:39 2008
@@ -0,0 +1,24 @@
+<?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.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+              targetNamespace="http://scenario13"
+              xmlns:ns13="http://scenario13">
+   <deployable composite="ns13:CompositeA" />
+</contribution>

Added: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13.composite?rev=679205&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13.composite (added)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13.composite Wed Jul 23 14:46:39 2008
@@ -0,0 +1,58 @@
+<?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"
+        targetNamespace="http://scenario13"
+        xmlns:tns="http://scenario13"
+        name="CompositeA">
+
+    <service name="Service1" promote="ComponentB/Service2">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </service>
+    <reference name="reference1" promote="ComponentB/reference2">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </reference>
+    <reference name="reference1a" promote="ComponentB/reference2a">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </reference>    
+
+    <component name="ComponentB">
+        <implementation.composite name="tns:CompositeC" />
+        <service name="Service2">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+        </service>
+        <service name="Service2a">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+        </service>
+        <reference name="reference2">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+        </reference>
+        <reference name="reference2a">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+        </reference>        
+    </component>
+    
+    <component name="ComponentF">
+        <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+        <service name="Service3">
+            <binding.sca />
+            <binding.ws />
+        </service>
+    </component>            
+</composite>

Added: tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13a.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13a.composite?rev=679205&view=auto
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13a.composite (added)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/main/resources/scenario13/scenario13a.composite Wed Jul 23 14:46:39 2008
@@ -0,0 +1,64 @@
+<?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"
+        targetNamespace="http://scenario13"
+        xmlns:tns="http://scenario13"
+        name="CompositeC">
+
+    <service name="Service2" promote="ComponentD/Service3">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </service>
+    <service name="Service2a" promote="ComponentD/Service3a">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </service>
+    <reference name="reference2" promote="ComponentD/reference3">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </reference>
+    <reference name="reference2a" promote="ComponentD/reference3a">
+        <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+    </reference>    
+
+    <component name="ComponentD">
+        <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDReferenceMultiplicityImpl"/>
+        <service name="Service3">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+        </service>
+        <service name="Service3a">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+            <binding.ws uri="http://foo.com/bar" />
+        </service>
+        <reference name="reference3" target="ComponentD/Service3a">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+            <binding.ws/>
+        </reference>
+        <reference name="reference3a" target="ComponentE">
+            <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+            <binding.ws />
+        </reference>        
+    </component>
+    
+    <component name="ComponentE">
+        <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentEImpl"/>
+        <service name="Service3">
+            <binding.sca />
+            <binding.ws />
+        </service>
+    </component>    
+</composite>

Modified: tuscany/branches/sca-java-1.3/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java?rev=679205&r1=679204&r2=679205&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java (original)
+++ tuscany/branches/sca-java-1.3/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java Wed Jul 23 14:46:39 2008
@@ -451,7 +451,7 @@
             for (ComponentReference reference : componentD.getReferences()) {
                 if ("reference3".equals(reference.getName())) {
                     wsBinding = reference.getBinding(WebServiceBinding.class);
-                    assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+                    assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
                 }
             }
             assert "http://foo.com/bar".equals(wsBinding.getURI());
@@ -540,7 +540,8 @@
             for (ComponentReference reference : componentD.getReferences()) {
                 if ("reference3".equals(reference.getName())) {
                     wsBinding = reference.getBinding(WebServiceBinding.class);
-                    assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+                    assert reference.getBindings().size() == 1;
+                    assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
                 }
             }
             assert "http://foo.com/bar".equals(wsBinding.getURI());
@@ -692,7 +693,7 @@
         assert wsBinding.getWSDLDocument() == null;
     }
 
-    // Scenario 9: targets in references CDR1A and CBR2A and binding.ws at CDR3A
+    // Scenario 9: targets in references CBR2A and CDR3A and binding.ws at CDR3A
     public void testScenario9() throws Exception {
         System.out.println("====>Running testScenario9");
         customBuilder = new CustomCompositeBuilder(false);
@@ -706,18 +707,19 @@
         Composite domainComposite = customBuilder.getDomainComposite();
 
         Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
-        WebServiceBinding wsBinding = null;
+        ComponentReference componentRef = null;
         for (ComponentReference reference : componentD.getReferences()) {
             if ("reference3a".equals(reference.getName())) {
+                componentRef = reference;
                 assertTrue(reference.getBindings().size() == 2);
                 assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
                 assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
             }
         }
-     
+        assertTrue(componentRef != null);
     }
     
-    // Scenario 10: targets in references CDR1A and CBR2A and binding.ws at CCR2A
+    // Scenario 10: targets in references CBR2A and CDR3A and binding.ws at CCR2A
     public void testScenario10() throws Exception {
         System.out.println("====>Running testScenario10");
         customBuilder = new CustomCompositeBuilder(false);
@@ -727,7 +729,7 @@
         checkScenario10And11Results();
     }
     
-    // Scenario 11: targets in references CDR1A and CBR2A and binding.ws at CBR2A
+    // Scenario 11: targets in references CBR2A and CDR3A and binding.ws at CBR2A
     public void testScenario11() throws Exception {
         System.out.println("====>Running testScenario11");
         customBuilder = new CustomCompositeBuilder(false);
@@ -741,18 +743,23 @@
         Composite domainComposite = customBuilder.getDomainComposite();
 
         Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
-        WebServiceBinding wsBinding = null;
+        ComponentReference componentRef = null;
         for (ComponentReference reference : componentD.getReferences()) {
             if ("reference3a".equals(reference.getName())) {
+                componentRef = reference;
                 assertTrue(reference.getBindings().size() == 2);
-                assertTrue(reference.getBindings().get(0) instanceof SCABinding);
-                assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
+                Binding binding1 = reference.getBindings().get(0);
+                assertTrue(binding1 instanceof SCABinding);
+                assertTrue(reference.getInterfaceContract(binding1) instanceof JavaInterfaceContract);
+                Binding binding2 = reference.getBindings().get(1);
+                assertTrue(binding2 instanceof WebServiceBinding);
+                assertTrue(reference.getInterfaceContract(binding2) instanceof WSDLInterfaceContract);
             }
         }
-     
+        assertTrue(componentRef != null);
     }  
 
-    // Scenario 12: targets in references CDR1A and CBR2A and binding.ws at CAR1A
+    // Scenario 12: target in reference CDR3A and binding.ws uri= at CAR1A
     public void testScenario12() throws Exception {
         System.out.println("====>Running testScenario12");
         customBuilder = new CustomCompositeBuilder(false);
@@ -766,14 +773,41 @@
         Composite domainComposite = customBuilder.getDomainComposite();
 
         Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
-        WebServiceBinding wsBinding = null;
+        ComponentReference componentRef = null;
         for (ComponentReference reference : componentD.getReferences()) {
             if ("reference3a".equals(reference.getName())) {
+                componentRef = reference;
                 assertTrue(reference.getBindings().size() == 2);
                 assertTrue(reference.getBindings().get(0) instanceof SCABinding);
                 assertTrue(reference.getBindings().get(1) instanceof SCABinding);
             }
         }
-     
+        assertTrue(componentRef != null);
     }    
+
+    // Scenario 13: target in reference CDR3A
+    public void testScenario13() throws Exception {
+        System.out.println("====>Running testScenario13");
+        customBuilder = new CustomCompositeBuilder(false);
+        customBuilder.loadContribution("scenario13.composite", "TestContribution", "src/main/resources/scenario13/");
+        //TestUtils.printResults(customBuilder);
+        TestUtils.checkProblems(customBuilder);
+        checkScenario13Results();
+    }
+
+    private void checkScenario13Results() {
+        Composite domainComposite = customBuilder.getDomainComposite();
+
+        Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+        ComponentReference componentRef = null;
+        for (ComponentReference reference : componentD.getReferences()) {
+            if ("reference3a".equals(reference.getName())) {
+                componentRef = reference;
+                assertTrue(reference.getBindings().size() == 1);
+                assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
+            }
+        }
+        assertTrue(componentRef != null);
+    }
+
 }

Modified: tuscany/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java?rev=679205&r1=679204&r2=679205&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java (original)
+++ tuscany/branches/sca-java-1.3/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGenerator.java Wed Jul 23 14:46:39 2008
@@ -30,6 +30,7 @@
 
 import org.apache.tuscany.sca.assembly.AbstractContract;
 import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.Contract;
 import org.apache.tuscany.sca.assembly.builder.BindingBuilderExtension;
 import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
@@ -190,14 +191,14 @@
         WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
         XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class);
 
-        if (contract.getInterfaceContract() == null) {
+        if (((Contract)contract).getInterfaceContract(wsBinding) == null) {
             // can happen if incorrect component service name
             fatal(monitor, "MissingInterfaceContract", wsBinding, component.getName(), contract.getName()); 
         }
 
         InterfaceContract icontract = wsBinding.getBindingInterfaceContract();
         if (icontract == null) {
-            icontract = contract.getInterfaceContract().makeUnidirectional(false);
+            icontract = ((Contract)contract).getInterfaceContract(wsBinding).makeUnidirectional(false);
             if (icontract instanceof JavaInterfaceContract) {
                 ModelResolver resolver = component instanceof ResolverExtension ?
                                              ((ResolverExtension)component).getModelResolver() : null;