You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2007/08/23 13:24:56 UTC
svn commit: r568937 [14/17] - in /incubator/woden/trunk/java/test:
javax/xml/namespace/ org/apache/woden/ org/apache/woden/ant/
org/apache/woden/internal/ org/apache/woden/internal/wsdl20/validation/
org/apache/woden/resolver/ org/apache/woden/resolver...
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingFaultExtensions.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingFaultReferenceExtensions.wsdl
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingFaultReferenceExtensions.wsdl?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingFaultReferenceExtensions.wsdl (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingFaultReferenceExtensions.wsdl Thu Aug 23 04:24:51 2007
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
+<?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.
--->
-<description xmlns="http://www.w3.org/ns/wsdl"
- targetNamespace="http://ws.apache.woden/endpoint"
- xmlns:tns="http://ws.apache.woden/endpoint"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
- xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"
- xmlns:ghns = "urn:ghns"
- xsi:schemaLocation=
- "http://www.w3.org/ns/wsdl http://www.w3.org/ns/wsdl/wsdl20.xsd
- http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
-
- <documentation>
- Used by SOAPBindingFaultReferenceExtensionsTest to test the SOAPBindingFaultReferenceExtensions implementation.
- </documentation>
-
- <interface name="interface1">
- <fault name = "invalidDataFault"
- element = "ghns:invalidDataError" />
- <operation name="opCheckAvailability">
- <infault ref="tns:invalidDataFault" messageLabel="In"/>
- <outfault ref="tns:invalidDataFault" messageLabel="Out"/>
- </operation>
-
- </interface>
-
- <binding name="binding1"
- interface="tns:interface1"
- type="http://www.w3.org/ns/wsdl/soap">
-
- <operation ref="tns:opCheckAvailability">
-
- <infault ref="tns:invalidDataFault" messageLabel="In">
- <documentation>Test that 2 SOAPModule objects are created</documentation>
- <wsoap:module ref="urn:ccc" required="true" />
- <wsoap:module ref="urn:ddd" required="false" />
- </infault>
-
- <outfault ref="tns:invalidDataFault" messageLabel="Out">
- <documentation>Test that 1 SOAPModule objects are created</documentation>
- <wsoap:module ref="urn:eee" required="false" />
- </outfault>
-
- </operation>
-
- </binding>
-
- <service name="service1" interface="tns:interface1" />
-
+ *
+ * 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.
+-->
+<description xmlns="http://www.w3.org/ns/wsdl"
+ targetNamespace="http://ws.apache.woden/endpoint"
+ xmlns:tns="http://ws.apache.woden/endpoint"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
+ xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:ghns = "urn:ghns"
+ xsi:schemaLocation=
+ "http://www.w3.org/ns/wsdl http://www.w3.org/ns/wsdl/wsdl20.xsd
+ http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
+
+ <documentation>
+ Used by SOAPBindingFaultReferenceExtensionsTest to test the SOAPBindingFaultReferenceExtensions implementation.
+ </documentation>
+
+ <interface name="interface1">
+ <fault name = "invalidDataFault"
+ element = "ghns:invalidDataError" />
+ <operation name="opCheckAvailability">
+ <infault ref="tns:invalidDataFault" messageLabel="In"/>
+ <outfault ref="tns:invalidDataFault" messageLabel="Out"/>
+ </operation>
+
+ </interface>
+
+ <binding name="binding1"
+ interface="tns:interface1"
+ type="http://www.w3.org/ns/wsdl/soap">
+
+ <operation ref="tns:opCheckAvailability">
+
+ <infault ref="tns:invalidDataFault" messageLabel="In">
+ <documentation>Test that 2 SOAPModule objects are created</documentation>
+ <wsoap:module ref="urn:ccc" required="true" />
+ <wsoap:module ref="urn:ddd" required="false" />
+ </infault>
+
+ <outfault ref="tns:invalidDataFault" messageLabel="Out">
+ <documentation>Test that 1 SOAPModule objects are created</documentation>
+ <wsoap:module ref="urn:eee" required="false" />
+ </outfault>
+
+ </operation>
+
+ </binding>
+
+ <service name="service1" interface="tns:interface1" />
+
</description>
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingFaultReferenceExtensions.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingMessageReferenceExtensions.wsdl
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingMessageReferenceExtensions.wsdl?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingMessageReferenceExtensions.wsdl (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingMessageReferenceExtensions.wsdl Thu Aug 23 04:24:51 2007
@@ -1,62 +1,62 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
+<?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.
--->
-<description xmlns="http://www.w3.org/ns/wsdl"
- targetNamespace="http://ws.apache.woden/endpoint"
- xmlns:tns="http://ws.apache.woden/endpoint"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
- xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"
- xmlns:ghns = "urn:ghns"
- xsi:schemaLocation=
- "http://www.w3.org/ns/wsdl http://www.w3.org/ns/wsdl/wsdl20.xsd
- http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
-
- <documentation>
- Used by SOAPBindingMessageReferenceExtensionsTest to test the SOAPBindingMessageReferenceExtensions implementation.
- </documentation>
-
- <interface name="interface1" />
-
- <binding name="binding1"
- interface="tns:interface1"
- type="http://www.w3.org/ns/wsdl/soap">
-
- <operation>
-
- <input>
- <documentation>Test that 2 SOAPModule and 2 SOAPHeaderBlock objects are created</documentation>
- <wsoap:module ref="urn:ccc" required="true" />
- <wsoap:module ref="urn:ddd" required="false" />
- <wsoap:header element="ghns:checkAvailability" mustUnderstand="true" />
- <wsoap:header element="ghns:checkPrice" mustUnderstand="true" />
- </input>
-
- <output>
- <documentation>Test that 1 SOAPModule and 1 SOAPHeaderBlock objects are created</documentation>
- <wsoap:module ref="urn:eee" required="false" />
- <wsoap:header element="ghns:checkAvailability" mustUnderstand="false" />
- </output>
-
- </operation>
-
- </binding>
-
- <service name="service1" interface="tns:interface1" />
-
+ *
+ * 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.
+-->
+<description xmlns="http://www.w3.org/ns/wsdl"
+ targetNamespace="http://ws.apache.woden/endpoint"
+ xmlns:tns="http://ws.apache.woden/endpoint"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
+ xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:ghns = "urn:ghns"
+ xsi:schemaLocation=
+ "http://www.w3.org/ns/wsdl http://www.w3.org/ns/wsdl/wsdl20.xsd
+ http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
+
+ <documentation>
+ Used by SOAPBindingMessageReferenceExtensionsTest to test the SOAPBindingMessageReferenceExtensions implementation.
+ </documentation>
+
+ <interface name="interface1" />
+
+ <binding name="binding1"
+ interface="tns:interface1"
+ type="http://www.w3.org/ns/wsdl/soap">
+
+ <operation>
+
+ <input>
+ <documentation>Test that 2 SOAPModule and 2 SOAPHeaderBlock objects are created</documentation>
+ <wsoap:module ref="urn:ccc" required="true" />
+ <wsoap:module ref="urn:ddd" required="false" />
+ <wsoap:header element="ghns:checkAvailability" mustUnderstand="true" />
+ <wsoap:header element="ghns:checkPrice" mustUnderstand="true" />
+ </input>
+
+ <output>
+ <documentation>Test that 1 SOAPModule and 1 SOAPHeaderBlock objects are created</documentation>
+ <wsoap:module ref="urn:eee" required="false" />
+ <wsoap:header element="ghns:checkAvailability" mustUnderstand="false" />
+ </output>
+
+ </operation>
+
+ </binding>
+
+ <service name="service1" interface="tns:interface1" />
+
</description>
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingMessageReferenceExtensions.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingOperationExtensions.wsdl
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingOperationExtensions.wsdl?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingOperationExtensions.wsdl (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingOperationExtensions.wsdl Thu Aug 23 04:24:51 2007
@@ -1,74 +1,74 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
+<?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.
--->
-<description xmlns="http://www.w3.org/ns/wsdl"
- targetNamespace="http://ws.apache.woden/endpoint"
- xmlns:tns="http://ws.apache.woden/endpoint"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
- xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"
- xmlns:whttp= "http://www.w3.org/ns/wsdl/http"
- xmlns:ghns = "urn:ghns"
- xsi:schemaLocation=
- "http://www.w3.org/ns/wsdl http://www.w3.org/ns/wsdl/wsdl20.xsd
- http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
-
- <documentation>
- Used by SOAPBindingOperationExtensionsTest to test the SOAPBindingOperationExtensions implementation.
- </documentation>
-
- <interface name="interface1" />
-
- <binding name="binding1"
- interface="tns:interface1"
- type="http://www.w3.org/ns/wsdl/soap"
- wsoap:version="1.2"
- wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
-
- <operation
- wsoap:mep="urn:mep"
- wsoap:action="urn:action"
- whttp:queryParameterSeparator="$">
- <documentation>Test that mep and action attributes are parsed correctly.</documentation>
- <documentation>Test that 1 SOAPModule object is parsed.</documentation>
- <documentation>Test that query paramater separator is parsed correctly.</documentation>
- <wsoap:module ref="urn:ccc" required="true" />
- </operation>
-
- </binding>
-
- <binding name="binding2"
- interface="tns:interface1"
- type="http://www.w3.org/ns/wsdl/soap"
- wsoap:version="1.1"
- wsoap:protocol="http://www.w3.org/2006/01/soap11/bindings/HTTP/">
-
- <operation
- wsoap:mep="urn:mep"
- wsoap:action="urn:action">
- <documentation>Test that mep and action attributes are parsed correctly.</documentation>
- <documentation>Test that 1 SOAPModule object is parsed.</documentation>
- <documentation>Test that query paramater separator defaults to null if omitted from the WSDL.</documentation>
- <wsoap:module ref="urn:ccc" required="true" />
- </operation>
-
- </binding>
-
- <service name="service1" interface="tns:interface1" />
-
+ *
+ * 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.
+-->
+<description xmlns="http://www.w3.org/ns/wsdl"
+ targetNamespace="http://ws.apache.woden/endpoint"
+ xmlns:tns="http://ws.apache.woden/endpoint"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
+ xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:whttp= "http://www.w3.org/ns/wsdl/http"
+ xmlns:ghns = "urn:ghns"
+ xsi:schemaLocation=
+ "http://www.w3.org/ns/wsdl http://www.w3.org/ns/wsdl/wsdl20.xsd
+ http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">
+
+ <documentation>
+ Used by SOAPBindingOperationExtensionsTest to test the SOAPBindingOperationExtensions implementation.
+ </documentation>
+
+ <interface name="interface1" />
+
+ <binding name="binding1"
+ interface="tns:interface1"
+ type="http://www.w3.org/ns/wsdl/soap"
+ wsoap:version="1.2"
+ wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
+
+ <operation
+ wsoap:mep="urn:mep"
+ wsoap:action="urn:action"
+ whttp:queryParameterSeparator="$">
+ <documentation>Test that mep and action attributes are parsed correctly.</documentation>
+ <documentation>Test that 1 SOAPModule object is parsed.</documentation>
+ <documentation>Test that query paramater separator is parsed correctly.</documentation>
+ <wsoap:module ref="urn:ccc" required="true" />
+ </operation>
+
+ </binding>
+
+ <binding name="binding2"
+ interface="tns:interface1"
+ type="http://www.w3.org/ns/wsdl/soap"
+ wsoap:version="1.1"
+ wsoap:protocol="http://www.w3.org/2006/01/soap11/bindings/HTTP/">
+
+ <operation
+ wsoap:mep="urn:mep"
+ wsoap:action="urn:action">
+ <documentation>Test that mep and action attributes are parsed correctly.</documentation>
+ <documentation>Test that 1 SOAPModule object is parsed.</documentation>
+ <documentation>Test that query paramater separator defaults to null if omitted from the WSDL.</documentation>
+ <wsoap:module ref="urn:ccc" required="true" />
+ </operation>
+
+ </binding>
+
+ <service name="service1" interface="tns:interface1" />
+
</description>
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/extensions/soap/resources/SOAPBindingOperationExtensions.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java Thu Aug 23 04:24:51 2007
@@ -1,104 +1,104 @@
-package org.apache.woden.wsdl20.fragids;
-
-import java.net.URL;
-
-import org.apache.woden.WSDLFactory;
-import org.apache.woden.WSDLReader;
-import org.apache.woden.wsdl20.Description;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class FragmentIdentificationTest extends TestCase {
- private WSDLFactory factory;
- private WSDLReader reader;
-
- public static Test suite()
- {
- return new TestSuite(FragmentIdentificationTest.class);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- factory = WSDLFactory.newInstance();
- reader = factory.newWSDLReader();
- }
-
- public void testSerialisation(){
- Description desc = null;
-
- //Load in a WSDL 2.0 file
- URL wsdlURL2 = getClass().getClassLoader().getResource("org/apache/woden/wsdl20/fragids/greatH.wsdl");
-
- try {
- desc = reader.readWSDL(wsdlURL2.toString());
- } catch(Exception e) {
- fail("Failed with unexpected exception: " + e);
- }
-
- assertEquals("wsdl.description()", desc.toString());
- //Elements
- assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.elementDeclaration(ghns:checkAvailability)",
- desc.getElementDeclaration(new QName("http://greath.example.com/2004/schemas/resSvc","checkAvailability")).toString());
-
- assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.elementDeclaration(ghns:checkAvailabilityResponse)",
- desc.getElementDeclaration(new QName("http://greath.example.com/2004/schemas/resSvc","checkAvailabilityResponse")).toString());
-
- assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.elementDeclaration(ghns:invalidDataError)",
- desc.getElementDeclaration(new QName("http://greath.example.com/2004/schemas/resSvc","invalidDataError")).toString());
-
- //Types
- assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.typeDefinition(ghns:tCheckAvailability)",
- desc.getTypeDefinition(new QName("http://greath.example.com/2004/schemas/resSvc","tCheckAvailability")).toString());
-
- //Interface
- assertEquals("wsdl.interface(reservationInterface)",
- desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).toString());
-
- assertEquals("wsdl.interfaceFault(reservationInterface/invalidDataFault)",
- desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceFault(new QName("http://greath.example.com/2004/wsdl/resSvc", "invalidDataFault")).toString());
-
- assertEquals("wsdl.interfaceOperation(reservationInterface/opCheckAvailability)",
- desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability")).toString());
-
- assertEquals("wsdl.interfaceMessageReference(reservationInterface/opCheckAvailability/In)",
- desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability")).getInterfaceMessageReferences()[0].toString());
-
- assertEquals("wsdl.interfaceMessageReference(reservationInterface/opCheckAvailability/Out)",
- desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability")).getInterfaceMessageReferences()[1].toString());
-
- assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.interfaceFaultReference(reservationInterface/opCheckAvailability/Out/tns:invalidDataFault)",
- desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability", "tns")).getInterfaceFaultReferences()[0].toString());
-
- //Binding
- assertEquals("wsdl.binding(reservationSOAPBinding)",
- desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).toString());
-
- assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingFault(reservationSOAPBinding/tns:invalidDataFault)",
- desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingFaults()[0].toString());
-
- assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingOperation(reservationSOAPBinding/tns:opCheckAvailability)",
- desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].toString());
-
- assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingMessageReference(reservationSOAPBinding/tns:opCheckAvailability/In)",
- desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].getBindingMessageReferences()[0].toString());
-
- assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingMessageReference(reservationSOAPBinding/tns:opCheckAvailability/Out)",
- desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].getBindingMessageReferences()[1].toString());
-
- assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingFaultReference(reservationSOAPBinding/tns:opCheckAvailability/Out/tns:invalidDataFault)",
- desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].getBindingFaultReferences()[0].toString());
-
- //Service
- assertEquals("wsdl.service(reservationService)",
- desc.getService(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationService")).toString());
-
- assertEquals("wsdl.endpoint(reservationService/reservationEndpoint)",
- desc.getService(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationService")).getEndpoints()[0].toString());
-
- //TODO add tests for BindingMessageReference, BindingFaultReference, Extensions.
- }
-}
+package org.apache.woden.wsdl20.fragids;
+
+import java.net.URL;
+
+import org.apache.woden.WSDLFactory;
+import org.apache.woden.WSDLReader;
+import org.apache.woden.wsdl20.Description;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class FragmentIdentificationTest extends TestCase {
+ private WSDLFactory factory;
+ private WSDLReader reader;
+
+ public static Test suite()
+ {
+ return new TestSuite(FragmentIdentificationTest.class);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ factory = WSDLFactory.newInstance();
+ reader = factory.newWSDLReader();
+ }
+
+ public void testSerialisation(){
+ Description desc = null;
+
+ //Load in a WSDL 2.0 file
+ URL wsdlURL2 = getClass().getClassLoader().getResource("org/apache/woden/wsdl20/fragids/greatH.wsdl");
+
+ try {
+ desc = reader.readWSDL(wsdlURL2.toString());
+ } catch(Exception e) {
+ fail("Failed with unexpected exception: " + e);
+ }
+
+ assertEquals("wsdl.description()", desc.toString());
+ //Elements
+ assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.elementDeclaration(ghns:checkAvailability)",
+ desc.getElementDeclaration(new QName("http://greath.example.com/2004/schemas/resSvc","checkAvailability")).toString());
+
+ assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.elementDeclaration(ghns:checkAvailabilityResponse)",
+ desc.getElementDeclaration(new QName("http://greath.example.com/2004/schemas/resSvc","checkAvailabilityResponse")).toString());
+
+ assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.elementDeclaration(ghns:invalidDataError)",
+ desc.getElementDeclaration(new QName("http://greath.example.com/2004/schemas/resSvc","invalidDataError")).toString());
+
+ //Types
+ assertEquals("xmlns(ghns=http://greath.example.com/2004/schemas/resSvc)wsdl.typeDefinition(ghns:tCheckAvailability)",
+ desc.getTypeDefinition(new QName("http://greath.example.com/2004/schemas/resSvc","tCheckAvailability")).toString());
+
+ //Interface
+ assertEquals("wsdl.interface(reservationInterface)",
+ desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).toString());
+
+ assertEquals("wsdl.interfaceFault(reservationInterface/invalidDataFault)",
+ desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceFault(new QName("http://greath.example.com/2004/wsdl/resSvc", "invalidDataFault")).toString());
+
+ assertEquals("wsdl.interfaceOperation(reservationInterface/opCheckAvailability)",
+ desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability")).toString());
+
+ assertEquals("wsdl.interfaceMessageReference(reservationInterface/opCheckAvailability/In)",
+ desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability")).getInterfaceMessageReferences()[0].toString());
+
+ assertEquals("wsdl.interfaceMessageReference(reservationInterface/opCheckAvailability/Out)",
+ desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability")).getInterfaceMessageReferences()[1].toString());
+
+ assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.interfaceFaultReference(reservationInterface/opCheckAvailability/Out/tns:invalidDataFault)",
+ desc.getInterface(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationInterface")).getInterfaceOperation(new QName("http://greath.example.com/2004/wsdl/resSvc", "opCheckAvailability", "tns")).getInterfaceFaultReferences()[0].toString());
+
+ //Binding
+ assertEquals("wsdl.binding(reservationSOAPBinding)",
+ desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).toString());
+
+ assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingFault(reservationSOAPBinding/tns:invalidDataFault)",
+ desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingFaults()[0].toString());
+
+ assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingOperation(reservationSOAPBinding/tns:opCheckAvailability)",
+ desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].toString());
+
+ assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingMessageReference(reservationSOAPBinding/tns:opCheckAvailability/In)",
+ desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].getBindingMessageReferences()[0].toString());
+
+ assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingMessageReference(reservationSOAPBinding/tns:opCheckAvailability/Out)",
+ desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].getBindingMessageReferences()[1].toString());
+
+ assertEquals("xmlns(tns=http://greath.example.com/2004/wsdl/resSvc)wsdl.bindingFaultReference(reservationSOAPBinding/tns:opCheckAvailability/Out/tns:invalidDataFault)",
+ desc.getBinding(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationSOAPBinding")).getBindingOperations()[0].getBindingFaultReferences()[0].toString());
+
+ //Service
+ assertEquals("wsdl.service(reservationService)",
+ desc.getService(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationService")).toString());
+
+ assertEquals("wsdl.endpoint(reservationService/reservationEndpoint)",
+ desc.getService(new QName("http://greath.example.com/2004/wsdl/resSvc", "reservationService")).getEndpoints()[0].toString());
+
+ //TODO add tests for BindingMessageReference, BindingFaultReference, Extensions.
+ }
+}
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/greatH.wsdl
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/greatH.wsdl?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/greatH.wsdl (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/greatH.wsdl Thu Aug 23 04:24:51 2007
@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<description
- xmlns="http://www.w3.org/ns/wsdl"
- targetNamespace= "http://greath.example.com/2004/wsdl/resSvc"
- xmlns:tns= "http://greath.example.com/2004/wsdl/resSvc"
- xmlns:ghns = "http://greath.example.com/2004/schemas/resSvc"
- xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
- xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
- xmlns:wsdlx= "http://www.w3.org/ns/wsdl-extensions">
-
- <documentation>
- This document describes the GreatH Web service. Additional
- application-level requirements for use of this service --
- beyond what WSDL 2.0 is able to describe -- are available
- at http://greath.example.com/2004/reservation-documentation.html
- </documentation>
-
- <types>
- <xs:schema
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://greath.example.com/2004/schemas/resSvc"
- xmlns="http://greath.example.com/2004/schemas/resSvc">
-
- <xs:element name="checkAvailability" type="tCheckAvailability"/>
- <xs:complexType name="tCheckAvailability">
- <xs:sequence>
- <xs:element name="checkInDate" type="xs:date"/>
- <xs:element name="checkOutDate" type="xs:date"/>
- <xs:element name="roomType" type="xs:string"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="checkAvailabilityResponse" type="xs:double"/>
-
- <xs:element name="invalidDataError" type="xs:string"/>
-
- </xs:schema>
- </types>
-
- <interface name = "reservationInterface" >
-
- <fault name = "invalidDataFault"
- element = "ghns:invalidDataError"/>
-
- <operation name="opCheckAvailability"
- pattern="http://www.w3.org/ns/wsdl/in-out"
- style="http://www.w3.org/ns/wsdl/style/iri"
- wsdlx:safe = "true">
- <input messageLabel="In"
- element="ghns:checkAvailability" />
- <output messageLabel="Out"
- element="ghns:checkAvailabilityResponse" />
- <outfault ref="tns:invalidDataFault" messageLabel="Out"/>
- </operation>
-
- </interface>
-
- <binding name="reservationSOAPBinding"
- interface="tns:reservationInterface"
- type="http://www.w3.org/ns/wsdl/soap"
- wsoap:version="1.2"
- wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
-
- <fault ref="tns:invalidDataFault"
- wsoap:code="soap:Sender"/>
-
- <operation ref="tns:opCheckAvailability" wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response">
- <input />
- <output />
- <outfault ref="tns:invalidDataFault" />
- </operation>
-
- </binding>
-
- <service name="reservationService"
- interface="tns:reservationInterface">
-
- <endpoint name="reservationEndpoint"
- binding="tns:reservationSOAPBinding"
- address ="http://greath.example.com/2004/reservation"/>
-
- </service>
-
-</description>
+<?xml version="1.0" encoding="utf-8" ?>
+<description
+ xmlns="http://www.w3.org/ns/wsdl"
+ targetNamespace= "http://greath.example.com/2004/wsdl/resSvc"
+ xmlns:tns= "http://greath.example.com/2004/wsdl/resSvc"
+ xmlns:ghns = "http://greath.example.com/2004/schemas/resSvc"
+ xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
+ xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:wsdlx= "http://www.w3.org/ns/wsdl-extensions">
+
+ <documentation>
+ This document describes the GreatH Web service. Additional
+ application-level requirements for use of this service --
+ beyond what WSDL 2.0 is able to describe -- are available
+ at http://greath.example.com/2004/reservation-documentation.html
+ </documentation>
+
+ <types>
+ <xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://greath.example.com/2004/schemas/resSvc"
+ xmlns="http://greath.example.com/2004/schemas/resSvc">
+
+ <xs:element name="checkAvailability" type="tCheckAvailability"/>
+ <xs:complexType name="tCheckAvailability">
+ <xs:sequence>
+ <xs:element name="checkInDate" type="xs:date"/>
+ <xs:element name="checkOutDate" type="xs:date"/>
+ <xs:element name="roomType" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="checkAvailabilityResponse" type="xs:double"/>
+
+ <xs:element name="invalidDataError" type="xs:string"/>
+
+ </xs:schema>
+ </types>
+
+ <interface name = "reservationInterface" >
+
+ <fault name = "invalidDataFault"
+ element = "ghns:invalidDataError"/>
+
+ <operation name="opCheckAvailability"
+ pattern="http://www.w3.org/ns/wsdl/in-out"
+ style="http://www.w3.org/ns/wsdl/style/iri"
+ wsdlx:safe = "true">
+ <input messageLabel="In"
+ element="ghns:checkAvailability" />
+ <output messageLabel="Out"
+ element="ghns:checkAvailabilityResponse" />
+ <outfault ref="tns:invalidDataFault" messageLabel="Out"/>
+ </operation>
+
+ </interface>
+
+ <binding name="reservationSOAPBinding"
+ interface="tns:reservationInterface"
+ type="http://www.w3.org/ns/wsdl/soap"
+ wsoap:version="1.2"
+ wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
+
+ <fault ref="tns:invalidDataFault"
+ wsoap:code="soap:Sender"/>
+
+ <operation ref="tns:opCheckAvailability" wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response">
+ <input />
+ <output />
+ <outfault ref="tns:invalidDataFault" />
+ </operation>
+
+ </binding>
+
+ <service name="reservationService"
+ interface="tns:reservationInterface">
+
+ <endpoint name="reservationEndpoint"
+ binding="tns:reservationSOAPBinding"
+ address ="http://greath.example.com/2004/reservation"/>
+
+ </service>
+
+</description>
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/greatH.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java Thu Aug 23 04:24:51 2007
@@ -1,206 +1,206 @@
-/**
+/**
* 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.woden.wsdl20.xml;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.woden.WSDLException;
-import org.apache.woden.WSDLFactory;
-import org.apache.woden.internal.wsdl20.DescriptionImpl;
-import org.apache.woden.types.NCName;
-
-/**
- * Unit tests for the BindingElement class.
- *
- * @author Graham Turrell (gturrell@apache.org)
- */
-public class BindingElementTest extends TestCase {
-
- // create a parent Description to hang the Bindings off
- private DescriptionElement fDescriptionElement = null;
- private BindingElement fBindingElement = null;
- private URI fTypeURI = null;
- private WSDLFactory fFactory = null;
-
- public static Test suite()
- {
- return new TestSuite(BindingElementTest.class);
- }
-
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- try {
- fFactory = WSDLFactory.newInstance();
- } catch (WSDLException e) {
- fail("Can't instantiate the WSDLFactory object.");
- }
-
- fDescriptionElement = fFactory.newDescription();
- fBindingElement = fDescriptionElement.addBindingElement();
- fTypeURI = new URI("http://www.w3.org/0000/00/apacheType");
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /*
- * Optional attribute ("interface")
- * - setInterfaceName()
- * - getInterfaceName()
- */
- public void testGetSetInterfaceName()
- {
- // check the default
- QName uri = fBindingElement.getInterfaceName();
- assertNull("Retrieved BindingElement interface name should be null if none set -", uri);
-
- fBindingElement.setInterfaceName(new QName("InterfaceName"));
- uri = fBindingElement.getInterfaceName();
- assertNotNull(uri);
- assertEquals("Retrieved BindingElement interface name does not match that set -", "InterfaceName", uri.toString());
- }
-
- /* Utility method to obtain the InterfaceElement referenced by the (optional) "interface" attribute
- * - getInterfaceElement()
- */
- public void testGetInterfaceElement()
- {
- // check the default:
- InterfaceElement retrievedInterfaceElement = fBindingElement.getInterfaceElement();
- assertNull("Retrieved Interface Element should be null if none set -", retrievedInterfaceElement);
-
- // Create and name an Interface Element
- DescriptionElement desc = fFactory.newDescription();
- InterfaceElement interfaceElement = desc.addInterfaceElement();
- interfaceElement.setName(new NCName("interface1"));
-
- // Create a binding from the description
- fBindingElement = desc.addBindingElement();
-
- // getInterfaceElement() - interface attribute unspecified, but hierarchy in place:
- retrievedInterfaceElement = fBindingElement.getInterfaceElement();
- assertNull("Retrieved Interface Element should be null if interface attribute unspecified -", retrievedInterfaceElement);
-
- // getInterfaceElement() - interface attribute specified, and hierarchy in place:
- // Set the "interface" attribute to reference the new Interface Element
- fBindingElement.setInterfaceName(new QName("interface1"));
- retrievedInterfaceElement = fBindingElement.getInterfaceElement();
- assertEquals("Retrieved Interface Element was not that expected -", interfaceElement, retrievedInterfaceElement);
- }
-
- /*
- * Mandatory attribute ("name")
- * - setName()
- * - getName()
- */
- public void testGetSetName()
- {
- fBindingElement.setName(new NCName("BindingName"));
- QName uri = fBindingElement.getName();
- assertNotNull(uri);
- assertEquals("Retrieved BindingElement name does not match that set -", "BindingName", uri.toString());
- }
-
- /*
- * Mandatory attribute ("type")
- * - setType()
- * - getType()
- */
- public void testGetSetType()
- {
- fBindingElement.setType(fTypeURI);
- URI uri = fBindingElement.getType();
- assertEquals("Retrieved BindingElement type attribute does not match that set -", fTypeURI, uri);
- }
-
-
- /*
- * Optional element ("fault")
- * - addBindingFaultElement()
- * - getBindingFaultElements()
- */
- public void testAddGetBindingFaultElements()
- {
- // check the default:
- BindingFaultElement[] bfeArray = fBindingElement.getBindingFaultElements();
- assertNotNull("Expected an array of BindingFaultElements -", bfeArray);
- assertEquals("Retrieved BindingFaultElement group should be empty if none set -", 0, bfeArray.length);
-
- // addBindingFaultElement()
- BindingFaultElement bfe1 = fBindingElement.addBindingFaultElement();
- BindingFaultElement bfe2 = fBindingElement.addBindingFaultElement();
- assertNotNull(bfe1);
- assertNotNull(bfe2);
-
- // getBindingFaultElements()
- bfeArray = fBindingElement.getBindingFaultElements();
- assertNotNull("Expected an array of BindingFaultElements -", bfeArray);
- assertEquals("Incorrect number of retrieved BindingFaultElements -", 2, bfeArray.length);
-
- // verify all Fault objects returned
- List bfeL = Arrays.asList(bfeArray);
- assertTrue(bfeL.contains(bfe1));
- assertTrue(bfeL.contains(bfe2));
- }
-
- /*
- * Optional element ("operation")
- * - addBindingOperationElement()
- * - getBindingOperationElements()
- */
- public void testAddGetBindingOperationElements()
- {
- // check the default:
- BindingOperationElement[] bopArray = fBindingElement.getBindingOperationElements();
- assertNotNull("Expected an array of BindingOperationElements -", bopArray);
- assertEquals("Retrieved BindingOperationElement group should be empty if none set -", 0, bopArray.length);
-
- // addBindingOperationElement()
- BindingOperationElement bop1 = fBindingElement.addBindingOperationElement();
- BindingOperationElement bop2 = fBindingElement.addBindingOperationElement();
- assertNotNull(bop1);
- assertNotNull(bop2);
-
- // getBindingOperationElements()
- bopArray = fBindingElement.getBindingOperationElements();
- assertNotNull("Expected an array of BindingOperationElements -", bopArray);
- assertEquals("Incorrect number of retrieved BindingOperationElements -", 2, bopArray.length);
-
- // verify all Operation objects returned
- List ifopL = Arrays.asList(bopArray);
- assertTrue(ifopL.contains(bop1));
- assertTrue(ifopL.contains(bop2));
- }
-}
+ *
+ * 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.woden.wsdl20.xml;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
+import org.apache.woden.internal.wsdl20.DescriptionImpl;
+import org.apache.woden.types.NCName;
+
+/**
+ * Unit tests for the BindingElement class.
+ *
+ * @author Graham Turrell (gturrell@apache.org)
+ */
+public class BindingElementTest extends TestCase {
+
+ // create a parent Description to hang the Bindings off
+ private DescriptionElement fDescriptionElement = null;
+ private BindingElement fBindingElement = null;
+ private URI fTypeURI = null;
+ private WSDLFactory fFactory = null;
+
+ public static Test suite()
+ {
+ return new TestSuite(BindingElementTest.class);
+ }
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = fFactory.newDescription();
+ fBindingElement = fDescriptionElement.addBindingElement();
+ fTypeURI = new URI("http://www.w3.org/0000/00/apacheType");
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ /*
+ * Optional attribute ("interface")
+ * - setInterfaceName()
+ * - getInterfaceName()
+ */
+ public void testGetSetInterfaceName()
+ {
+ // check the default
+ QName uri = fBindingElement.getInterfaceName();
+ assertNull("Retrieved BindingElement interface name should be null if none set -", uri);
+
+ fBindingElement.setInterfaceName(new QName("InterfaceName"));
+ uri = fBindingElement.getInterfaceName();
+ assertNotNull(uri);
+ assertEquals("Retrieved BindingElement interface name does not match that set -", "InterfaceName", uri.toString());
+ }
+
+ /* Utility method to obtain the InterfaceElement referenced by the (optional) "interface" attribute
+ * - getInterfaceElement()
+ */
+ public void testGetInterfaceElement()
+ {
+ // check the default:
+ InterfaceElement retrievedInterfaceElement = fBindingElement.getInterfaceElement();
+ assertNull("Retrieved Interface Element should be null if none set -", retrievedInterfaceElement);
+
+ // Create and name an Interface Element
+ DescriptionElement desc = fFactory.newDescription();
+ InterfaceElement interfaceElement = desc.addInterfaceElement();
+ interfaceElement.setName(new NCName("interface1"));
+
+ // Create a binding from the description
+ fBindingElement = desc.addBindingElement();
+
+ // getInterfaceElement() - interface attribute unspecified, but hierarchy in place:
+ retrievedInterfaceElement = fBindingElement.getInterfaceElement();
+ assertNull("Retrieved Interface Element should be null if interface attribute unspecified -", retrievedInterfaceElement);
+
+ // getInterfaceElement() - interface attribute specified, and hierarchy in place:
+ // Set the "interface" attribute to reference the new Interface Element
+ fBindingElement.setInterfaceName(new QName("interface1"));
+ retrievedInterfaceElement = fBindingElement.getInterfaceElement();
+ assertEquals("Retrieved Interface Element was not that expected -", interfaceElement, retrievedInterfaceElement);
+ }
+
+ /*
+ * Mandatory attribute ("name")
+ * - setName()
+ * - getName()
+ */
+ public void testGetSetName()
+ {
+ fBindingElement.setName(new NCName("BindingName"));
+ QName uri = fBindingElement.getName();
+ assertNotNull(uri);
+ assertEquals("Retrieved BindingElement name does not match that set -", "BindingName", uri.toString());
+ }
+
+ /*
+ * Mandatory attribute ("type")
+ * - setType()
+ * - getType()
+ */
+ public void testGetSetType()
+ {
+ fBindingElement.setType(fTypeURI);
+ URI uri = fBindingElement.getType();
+ assertEquals("Retrieved BindingElement type attribute does not match that set -", fTypeURI, uri);
+ }
+
+
+ /*
+ * Optional element ("fault")
+ * - addBindingFaultElement()
+ * - getBindingFaultElements()
+ */
+ public void testAddGetBindingFaultElements()
+ {
+ // check the default:
+ BindingFaultElement[] bfeArray = fBindingElement.getBindingFaultElements();
+ assertNotNull("Expected an array of BindingFaultElements -", bfeArray);
+ assertEquals("Retrieved BindingFaultElement group should be empty if none set -", 0, bfeArray.length);
+
+ // addBindingFaultElement()
+ BindingFaultElement bfe1 = fBindingElement.addBindingFaultElement();
+ BindingFaultElement bfe2 = fBindingElement.addBindingFaultElement();
+ assertNotNull(bfe1);
+ assertNotNull(bfe2);
+
+ // getBindingFaultElements()
+ bfeArray = fBindingElement.getBindingFaultElements();
+ assertNotNull("Expected an array of BindingFaultElements -", bfeArray);
+ assertEquals("Incorrect number of retrieved BindingFaultElements -", 2, bfeArray.length);
+
+ // verify all Fault objects returned
+ List bfeL = Arrays.asList(bfeArray);
+ assertTrue(bfeL.contains(bfe1));
+ assertTrue(bfeL.contains(bfe2));
+ }
+
+ /*
+ * Optional element ("operation")
+ * - addBindingOperationElement()
+ * - getBindingOperationElements()
+ */
+ public void testAddGetBindingOperationElements()
+ {
+ // check the default:
+ BindingOperationElement[] bopArray = fBindingElement.getBindingOperationElements();
+ assertNotNull("Expected an array of BindingOperationElements -", bopArray);
+ assertEquals("Retrieved BindingOperationElement group should be empty if none set -", 0, bopArray.length);
+
+ // addBindingOperationElement()
+ BindingOperationElement bop1 = fBindingElement.addBindingOperationElement();
+ BindingOperationElement bop2 = fBindingElement.addBindingOperationElement();
+ assertNotNull(bop1);
+ assertNotNull(bop2);
+
+ // getBindingOperationElements()
+ bopArray = fBindingElement.getBindingOperationElements();
+ assertNotNull("Expected an array of BindingOperationElements -", bopArray);
+ assertEquals("Incorrect number of retrieved BindingOperationElements -", 2, bopArray.length);
+
+ // verify all Operation objects returned
+ List ifopL = Arrays.asList(bopArray);
+ assertTrue(ifopL.contains(bop1));
+ assertTrue(ifopL.contains(bop2));
+ }
+}
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java Thu Aug 23 04:24:51 2007
@@ -1,107 +1,107 @@
-/**
+/**
* 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.woden.wsdl20.xml;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.woden.WSDLException;
-import org.apache.woden.WSDLFactory;
-import org.apache.woden.internal.wsdl20.BindingFaultImpl;
-import org.apache.woden.internal.wsdl20.DescriptionImpl;
-import org.apache.woden.types.NCName;
-
-/**
- * Unit tests for the BindingFaultElement class.
- *
- * @author Graham Turrell (gturrell@apache.org)
- */
-public class BindingFaultElementTest extends TestCase {
-
- private BindingFaultElement fFault = null;
-
- public static Test suite()
- {
- return new TestSuite(BindingFaultElementTest.class);
-
- }
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
- fFault = new BindingFaultImpl();
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /*
- * Test that the (Mandatory) BindingFault reference attribute ("ref") can be successfully set and retrieved
- */
- public void testSetGetRef()
- {
- QName faultRefName = new QName("faultRefName");
- fFault.setRef(faultRefName);
- assertEquals("The retrieved BindingFault reference is not that which was set",
- faultRefName, fFault.getRef());
- }
-
- /*
- * Test that the (Mandatory) InterfaceFault can be successfully retrieved.
- */
- public void testGetInterfaceFaultElement()
- {
- WSDLFactory factory = null;
- try {
- factory = WSDLFactory.newInstance();
- } catch (WSDLException e) {
- fail("Can't instantiate the WSDLFactory object.");
- }
-
- DescriptionElement descriptionElement = factory.newDescription();
-
- // Create the BindingElement<->InterfaceElement->InterfaceFaultElement hierarchy
- BindingElement bindingElement = descriptionElement.addBindingElement();
- bindingElement.setInterfaceName(new QName("interface1"));
-
- InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
- interfaceElement.setName(new NCName("interface1"));
-
- InterfaceFaultElement iffElement = interfaceElement.addInterfaceFaultElement();
- iffElement.setName(new NCName("fault1"));
-
- // Create the BindingOperationElement->BindingFaultReferenceElement hierarchy
- BindingOperationElement bopElement = bindingElement.addBindingOperationElement();
- bopElement.setRef(new QName("operation1"));
- fFault = bindingElement.addBindingFaultElement();
- fFault.setRef(new QName("fault1"));
-
- InterfaceFaultElement retrievedFault = fFault.getInterfaceFaultElement();
- assertEquals("The retrieved InterfaceFaultElement is not that which was set",
- iffElement, retrievedFault);
- }
-}
+ *
+ * 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.woden.wsdl20.xml;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
+import org.apache.woden.internal.wsdl20.BindingFaultImpl;
+import org.apache.woden.internal.wsdl20.DescriptionImpl;
+import org.apache.woden.types.NCName;
+
+/**
+ * Unit tests for the BindingFaultElement class.
+ *
+ * @author Graham Turrell (gturrell@apache.org)
+ */
+public class BindingFaultElementTest extends TestCase {
+
+ private BindingFaultElement fFault = null;
+
+ public static Test suite()
+ {
+ return new TestSuite(BindingFaultElementTest.class);
+
+ }
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ fFault = new BindingFaultImpl();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ /*
+ * Test that the (Mandatory) BindingFault reference attribute ("ref") can be successfully set and retrieved
+ */
+ public void testSetGetRef()
+ {
+ QName faultRefName = new QName("faultRefName");
+ fFault.setRef(faultRefName);
+ assertEquals("The retrieved BindingFault reference is not that which was set",
+ faultRefName, fFault.getRef());
+ }
+
+ /*
+ * Test that the (Mandatory) InterfaceFault can be successfully retrieved.
+ */
+ public void testGetInterfaceFaultElement()
+ {
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
+
+ // Create the BindingElement<->InterfaceElement->InterfaceFaultElement hierarchy
+ BindingElement bindingElement = descriptionElement.addBindingElement();
+ bindingElement.setInterfaceName(new QName("interface1"));
+
+ InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
+ interfaceElement.setName(new NCName("interface1"));
+
+ InterfaceFaultElement iffElement = interfaceElement.addInterfaceFaultElement();
+ iffElement.setName(new NCName("fault1"));
+
+ // Create the BindingOperationElement->BindingFaultReferenceElement hierarchy
+ BindingOperationElement bopElement = bindingElement.addBindingOperationElement();
+ bopElement.setRef(new QName("operation1"));
+ fFault = bindingElement.addBindingFaultElement();
+ fFault.setRef(new QName("fault1"));
+
+ InterfaceFaultElement retrievedFault = fFault.getInterfaceFaultElement();
+ assertEquals("The retrieved InterfaceFaultElement is not that which was set",
+ iffElement, retrievedFault);
+ }
+}
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java Thu Aug 23 04:24:51 2007
@@ -1,130 +1,130 @@
-/**
+/**
* 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.woden.wsdl20.xml;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.woden.WSDLException;
-import org.apache.woden.WSDLFactory;
-import org.apache.woden.internal.wsdl20.BindingFaultReferenceImpl;
-import org.apache.woden.internal.wsdl20.DescriptionImpl;
-import org.apache.woden.types.NCName;
-
-/**
- * Unit tests for the BindingFaultReferenceElement class.
- *
- * @author Graham Turrell (gturrell@apache.org)
- */
-public class BindingFaultReferenceElementTest extends TestCase {
-
- private BindingFaultReferenceElement fFaultReference = null;
-
- public static Test suite()
- {
- return new TestSuite(BindingFaultReferenceElementTest.class);
-
- }
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
- fFaultReference = new BindingFaultReferenceImpl();
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /*
- * Test that the (Mandatory) message label attribute ("messageLabel") can be successfully set and retrieved
- */
- public void testSetGetMessageLabel()
- {
- NCName faultRefNCName = new NCName("faultRefName");
- fFaultReference.setMessageLabel(faultRefNCName);
- assertEquals("The retrieved Element name is not that which was set",
- faultRefNCName, fFaultReference.getMessageLabel());
- }
-
- /*
- * Test that the (Mandatory) BindingFault reference attribute ("ref") can be successfully set and retrieved
- */
- public void testSetGetRef()
- {
- QName faultRefName = new QName("faultRefName");
- fFaultReference.setRef(faultRefName);
- assertEquals("The retrieved Element name is not that which was set",
- faultRefName, fFaultReference.getRef());
- }
-
- /*
- * Test that the (Mandatory) InterfaceFaultReference can be successfully retrieved.
- * The fault reference is to an Interface Fault associated with the grandparent BindingElement.
- */
- public void testGetInterfaceFaultReferenceElement()
- {
- WSDLFactory factory = null;
- try {
- factory = WSDLFactory.newInstance();
- } catch (WSDLException e) {
- fail("Can't instantiate the WSDLFactory object.");
- }
-
- DescriptionElement descriptionElement = factory.newDescription();
-
- // Create the BindingElement<->InterfaceElement->InterfaceOperationElement->InterfaceFaultReferenceElement hierarchy
- BindingElement bindingElement = descriptionElement.addBindingElement();
- bindingElement.setInterfaceName(new QName("interface1"));
-
- InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
- interfaceElement.setName(new NCName("interface1"));
-
- InterfaceOperationElement ifopElement = interfaceElement.addInterfaceOperationElement();
- ifopElement.setName(new NCName("operation1"));
- InterfaceFaultReferenceElement iffrElement = ifopElement.addInterfaceFaultReferenceElement();
- iffrElement.setMessageLabel(new NCName("Fault1MessageLabel"));
- iffrElement.setRef(new QName("Fault1Ref"));
-
- // Create the BindingOperationElement->BindingFaultReferenceElement hierarchy
- BindingOperationElement bopElement = bindingElement.addBindingOperationElement();
- bopElement.setRef(new QName("operation1"));
- fFaultReference = bopElement.addBindingFaultReferenceElement();
- fFaultReference.setMessageLabel(new NCName("Fault1MessageLabel"));
- fFaultReference.setRef(new QName("Fault1Ref"));
-
- descriptionElement.toComponent();
- // Note : Description's list of interfaces does not get setup until toComponent() is invoked.
- // therefore cannot successfully traverse the element model without creating the component model.
- // Creating the component model requires that the extension registry is instantiated.
- // TODO Note that neither this, not creating an extension registry is necessary on BindingFaultTest,
- // so there is some perceived inconsistency in the API.
-
- InterfaceFaultReferenceElement retrievedFault = fFaultReference.getInterfaceFaultReferenceElement();
- assertEquals("The retrieved InterfaceFaultReferenceElement is not that which was set",
- iffrElement, retrievedFault);
- }
-}
+ *
+ * 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.woden.wsdl20.xml;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
+import org.apache.woden.internal.wsdl20.BindingFaultReferenceImpl;
+import org.apache.woden.internal.wsdl20.DescriptionImpl;
+import org.apache.woden.types.NCName;
+
+/**
+ * Unit tests for the BindingFaultReferenceElement class.
+ *
+ * @author Graham Turrell (gturrell@apache.org)
+ */
+public class BindingFaultReferenceElementTest extends TestCase {
+
+ private BindingFaultReferenceElement fFaultReference = null;
+
+ public static Test suite()
+ {
+ return new TestSuite(BindingFaultReferenceElementTest.class);
+
+ }
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ fFaultReference = new BindingFaultReferenceImpl();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ /*
+ * Test that the (Mandatory) message label attribute ("messageLabel") can be successfully set and retrieved
+ */
+ public void testSetGetMessageLabel()
+ {
+ NCName faultRefNCName = new NCName("faultRefName");
+ fFaultReference.setMessageLabel(faultRefNCName);
+ assertEquals("The retrieved Element name is not that which was set",
+ faultRefNCName, fFaultReference.getMessageLabel());
+ }
+
+ /*
+ * Test that the (Mandatory) BindingFault reference attribute ("ref") can be successfully set and retrieved
+ */
+ public void testSetGetRef()
+ {
+ QName faultRefName = new QName("faultRefName");
+ fFaultReference.setRef(faultRefName);
+ assertEquals("The retrieved Element name is not that which was set",
+ faultRefName, fFaultReference.getRef());
+ }
+
+ /*
+ * Test that the (Mandatory) InterfaceFaultReference can be successfully retrieved.
+ * The fault reference is to an Interface Fault associated with the grandparent BindingElement.
+ */
+ public void testGetInterfaceFaultReferenceElement()
+ {
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
+
+ // Create the BindingElement<->InterfaceElement->InterfaceOperationElement->InterfaceFaultReferenceElement hierarchy
+ BindingElement bindingElement = descriptionElement.addBindingElement();
+ bindingElement.setInterfaceName(new QName("interface1"));
+
+ InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
+ interfaceElement.setName(new NCName("interface1"));
+
+ InterfaceOperationElement ifopElement = interfaceElement.addInterfaceOperationElement();
+ ifopElement.setName(new NCName("operation1"));
+ InterfaceFaultReferenceElement iffrElement = ifopElement.addInterfaceFaultReferenceElement();
+ iffrElement.setMessageLabel(new NCName("Fault1MessageLabel"));
+ iffrElement.setRef(new QName("Fault1Ref"));
+
+ // Create the BindingOperationElement->BindingFaultReferenceElement hierarchy
+ BindingOperationElement bopElement = bindingElement.addBindingOperationElement();
+ bopElement.setRef(new QName("operation1"));
+ fFaultReference = bopElement.addBindingFaultReferenceElement();
+ fFaultReference.setMessageLabel(new NCName("Fault1MessageLabel"));
+ fFaultReference.setRef(new QName("Fault1Ref"));
+
+ descriptionElement.toComponent();
+ // Note : Description's list of interfaces does not get setup until toComponent() is invoked.
+ // therefore cannot successfully traverse the element model without creating the component model.
+ // Creating the component model requires that the extension registry is instantiated.
+ // TODO Note that neither this, not creating an extension registry is necessary on BindingFaultTest,
+ // so there is some perceived inconsistency in the API.
+
+ InterfaceFaultReferenceElement retrievedFault = fFaultReference.getInterfaceFaultReferenceElement();
+ assertEquals("The retrieved InterfaceFaultReferenceElement is not that which was set",
+ iffrElement, retrievedFault);
+ }
+}
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingMessageReferenceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingMessageReferenceElementTest.java?rev=568937&r1=568936&r2=568937&view=diff
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingMessageReferenceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingMessageReferenceElementTest.java Thu Aug 23 04:24:51 2007
@@ -1,83 +1,83 @@
-/**
- * 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.woden.wsdl20.xml;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.apache.woden.internal.wsdl20.BindingMessageReferenceImpl;
-import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.enumeration.Direction;
-
-
-
-/**
- * Unit tests for the BindingMessageReferenceElement class.
- *
- * @author Graham Turrell (gturrell@apache.org)
- */
-public class BindingMessageReferenceElementTest extends TestCase {
-
- private BindingMessageReferenceElement fMessageReference = null;
-
- public static Test suite()
- {
- return new TestSuite(BindingMessageReferenceElementTest.class);
-
- }
- /*
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
- fMessageReference = new BindingMessageReferenceImpl();
- }
-
- /*
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /*
- * Test that a (mandatory) direction can be successfully set and retrieved
- */
- public void testSetGetDirection()
- {
- // Default case
- assertNull("The retrieved Direction when unset should be null", fMessageReference.getDirection());
-
- fMessageReference.setDirection(Direction.OUT);
- assertEquals("The retrieved MessageReference direction is not that which was set",
- Direction.OUT, fMessageReference.getDirection());
- }
-
- /*
- * Test that the (Mandatory) message label attribute ("messageLabel") can be successfully set and retrieved
- */
- public void testSetGetMessageLabel()
- {
- NCName messageRefNCName = new NCName("messageRefName");
- fMessageReference.setMessageLabel(messageRefNCName);
- assertEquals("The retrieved messageLabel is not that which was set",
- messageRefNCName, fMessageReference.getMessageLabel());
- }
-}
+/**
+ * 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.woden.wsdl20.xml;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.internal.wsdl20.BindingMessageReferenceImpl;
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.enumeration.Direction;
+
+
+
+/**
+ * Unit tests for the BindingMessageReferenceElement class.
+ *
+ * @author Graham Turrell (gturrell@apache.org)
+ */
+public class BindingMessageReferenceElementTest extends TestCase {
+
+ private BindingMessageReferenceElement fMessageReference = null;
+
+ public static Test suite()
+ {
+ return new TestSuite(BindingMessageReferenceElementTest.class);
+
+ }
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ fMessageReference = new BindingMessageReferenceImpl();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ /*
+ * Test that a (mandatory) direction can be successfully set and retrieved
+ */
+ public void testSetGetDirection()
+ {
+ // Default case
+ assertNull("The retrieved Direction when unset should be null", fMessageReference.getDirection());
+
+ fMessageReference.setDirection(Direction.OUT);
+ assertEquals("The retrieved MessageReference direction is not that which was set",
+ Direction.OUT, fMessageReference.getDirection());
+ }
+
+ /*
+ * Test that the (Mandatory) message label attribute ("messageLabel") can be successfully set and retrieved
+ */
+ public void testSetGetMessageLabel()
+ {
+ NCName messageRefNCName = new NCName("messageRefName");
+ fMessageReference.setMessageLabel(messageRefNCName);
+ assertEquals("The retrieved messageLabel is not that which was set",
+ messageRefNCName, fMessageReference.getMessageLabel());
+ }
+}
Propchange: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingMessageReferenceElementTest.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org