|
Lines 18-24
Link Here
|
| 18 |
import java.util.List; |
18 |
import java.util.List; |
| 19 |
|
19 |
|
| 20 |
import javax.wsdl.OperationType; |
20 |
import javax.wsdl.OperationType; |
|
|
21 |
import javax.wsdl.Port; |
| 22 |
import javax.wsdl.WSDLException; |
| 21 |
import javax.wsdl.extensions.ExtensibilityElement; |
23 |
import javax.wsdl.extensions.ExtensibilityElement; |
|
|
24 |
import javax.wsdl.xml.WSDLReader; |
| 22 |
import javax.xml.XMLConstants; |
25 |
import javax.xml.XMLConstants; |
| 23 |
import javax.xml.namespace.QName; |
26 |
import javax.xml.namespace.QName; |
| 24 |
|
27 |
|
|
Lines 47-52
Link Here
|
| 47 |
import org.eclipse.wst.wsdl.Types; |
50 |
import org.eclipse.wst.wsdl.Types; |
| 48 |
import org.eclipse.wst.wsdl.WSDLFactory; |
51 |
import org.eclipse.wst.wsdl.WSDLFactory; |
| 49 |
import org.eclipse.wst.wsdl.WSDLPackage; |
52 |
import org.eclipse.wst.wsdl.WSDLPackage; |
|
|
53 |
import org.eclipse.wst.wsdl.WSDLPlugin; |
| 50 |
import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; |
54 |
import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement; |
| 51 |
import org.eclipse.wst.wsdl.binding.mime.MIMEContent; |
55 |
import org.eclipse.wst.wsdl.binding.mime.MIMEContent; |
| 52 |
import org.eclipse.wst.wsdl.binding.mime.MIMEFactory; |
56 |
import org.eclipse.wst.wsdl.binding.mime.MIMEFactory; |
|
Lines 221-226
Link Here
|
| 221 |
} |
225 |
} |
| 222 |
}); |
226 |
}); |
| 223 |
|
227 |
|
|
|
228 |
suite.addTest(new BugFixesTest("SupportsLocalNSForExtensibilityElements") //$NON-NLS-1$ |
| 229 |
{ |
| 230 |
protected void runTest() |
| 231 |
{ |
| 232 |
testSupportsLocalNSForExtensibilityElements(); |
| 233 |
} |
| 234 |
}); |
| 235 |
|
| 224 |
return suite; |
236 |
return suite; |
| 225 |
} |
237 |
} |
| 226 |
|
238 |
|
|
Lines 1062-1067
Link Here
|
| 1062 |
Assert.fail("Test failed due to an exception: " + e.getLocalizedMessage()); |
1074 |
Assert.fail("Test failed due to an exception: " + e.getLocalizedMessage()); |
| 1063 |
} |
1075 |
} |
| 1064 |
} |
1076 |
} |
|
|
1077 |
|
| 1078 |
/** |
| 1079 |
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=198390 |
| 1080 |
*/ |
| 1081 |
public void testSupportsLocalNSForExtensibilityElements() |
| 1082 |
{ |
| 1083 |
try |
| 1084 |
{ |
| 1085 |
String uri = PLUGIN_ABSOLUTE_PATH + "samples/BugFixes/LocalNamespace/LocalNamespace2.wsdl"; //$NON-NLS-1$ |
| 1086 |
javax.wsdl.factory.WSDLFactory factory = WSDLPlugin.INSTANCE.createWSDL4JFactory(); |
| 1087 |
WSDLReader wsdlReader = factory.newWSDLReader(); |
| 1088 |
javax.wsdl.Definition definition = wsdlReader.readWSDL(uri); |
| 1089 |
|
| 1090 |
String targetNamespace = "http://www.example.org/example/"; //$NON-NLS-1$ |
| 1091 |
|
| 1092 |
// Test a local SOAP namespace prefix declaration. |
| 1093 |
|
| 1094 |
QName bindingQName = new QName(targetNamespace, "exampleSOAP"); //$NON-NLS-1$ |
| 1095 |
javax.wsdl.Binding binding = definition.getBinding(bindingQName); |
| 1096 |
assertNotNull(binding); |
| 1097 |
List extensibilityElements = binding.getExtensibilityElements(); |
| 1098 |
assertEquals(1, extensibilityElements.size()); |
| 1099 |
ExtensibilityElement soapBinding = (ExtensibilityElement)extensibilityElements.get(0); |
| 1100 |
assertNotNull(soapBinding); |
| 1101 |
QName bindingElementType = soapBinding.getElementType(); |
| 1102 |
assertNotNull(bindingElementType); |
| 1103 |
String localPart = bindingElementType.getLocalPart(); |
| 1104 |
assertEquals(SOAPConstants.BINDING_ELEMENT_TAG, localPart); |
| 1105 |
String namespaceURI = bindingElementType.getNamespaceURI(); |
| 1106 |
assertEquals(SOAPConstants.SOAP_NAMESPACE_URI, namespaceURI); |
| 1107 |
assertTrue(soapBinding instanceof javax.wsdl.extensions.soap.SOAPBinding); |
| 1108 |
|
| 1109 |
// Test a default SOAP namespace declaration at the port level. |
| 1110 |
|
| 1111 |
QName serviceQName = new QName(targetNamespace, "example"); //$NON-NLS-1$ |
| 1112 |
javax.wsdl.Service service = definition.getService(serviceQName); |
| 1113 |
Port port = service.getPort("exampleSOAP"); |
| 1114 |
extensibilityElements = port.getExtensibilityElements(); |
| 1115 |
assertEquals(1, extensibilityElements.size()); |
| 1116 |
ExtensibilityElement soapAddress = (ExtensibilityElement)extensibilityElements.get(0); |
| 1117 |
assertNotNull(soapAddress); |
| 1118 |
QName portElementType = soapAddress.getElementType(); |
| 1119 |
assertNotNull(portElementType); |
| 1120 |
localPart = portElementType.getLocalPart(); |
| 1121 |
assertEquals(SOAPConstants.ADDRESS_ELEMENT_TAG, localPart); |
| 1122 |
namespaceURI = portElementType.getNamespaceURI(); |
| 1123 |
assertEquals(SOAPConstants.SOAP_NAMESPACE_URI, namespaceURI); |
| 1124 |
assertTrue(soapAddress instanceof javax.wsdl.extensions.soap.SOAPAddress); |
| 1125 |
} |
| 1126 |
catch (WSDLException e) |
| 1127 |
{ |
| 1128 |
e.printStackTrace(); |
| 1129 |
fail(); |
| 1130 |
} |
| 1131 |
} |
| 1065 |
|
1132 |
|
| 1066 |
private Element getNextElement(Element anElement) |
1133 |
private Element getNextElement(Element anElement) |
| 1067 |
{ |
1134 |
{ |