Author: hughesj
Date: Wed Aug 2 06:32:34 2006
New Revision: 427977
URL: http://svn.apache.org/viewvc?rev=427977&view=rev
Log:
Moved/renamed DescriptionElement.createEndpointElement() to
ServiceElement.addEndpointElement()
Which replaces ServiceElement.addEndpointElement(EndpointElement)
Updated the tests
Modified:
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/wsdl20/ServiceImpl.java
incubator/woden/branches/WODEN-40/src/org/apache/woden/wsdl20/xml/ServiceElement.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidatorTest.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
Modified:
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java
(original)
+++
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/DOMWSDLReader.java
Wed Aug 2 06:32:34 2006
@@ -1563,7 +1563,7 @@
}
else if (QNameUtils.matches(Constants.Q_ELEM_ENDPOINT, tempEl))
{
- service.addEndpointElement(parseEndpoint(tempEl, desc,
service));
+ parseEndpoint(tempEl, desc, service);
}
else if (QNameUtils.matches(Constants.Q_ELEM_FEATURE, tempEl))
{
@@ -1587,10 +1587,10 @@
private EndpointElement parseEndpoint(Element endpointEl,
DescriptionElement desc,
- WSDLElement parent)
+ ServiceElement parent)
throws WSDLException
{
- EndpointElement endpoint = desc.createEndpointElement();
+ EndpointElement endpoint = parent.addEndpointElement();
endpoint.setParentElement(parent);
String name = DOMUtils.getAttribute(endpointEl, Constants.ATTR_NAME);
Modified:
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java
(original)
+++
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/OMWSDLReader.java
Wed Aug 2 06:32:34 2006
@@ -295,7 +295,7 @@
service.addDocumentationElement(parseDocumentation(serviceElChild, desc));
}
else if (QNameUtils.matches(Constants.Q_ELEM_ENDPOINT,
serviceElChild)){
- service.addEndpointElement(parseEndpoint(serviceElChild, desc,
service));
+ parseEndpoint(serviceElChild, desc, service);
}
else if (QNameUtils.matches(Constants.Q_ELEM_FEATURE,
serviceElChild)){
service.addFeatureElement(parseFeature(serviceElChild, desc,
service));
@@ -313,10 +313,10 @@
private EndpointElement parseEndpoint(OMElement endpointEl,
DescriptionElement desc,
- WSDLElement parent)
+ ServiceElement parent)
throws WSDLException{
- EndpointElement endpoint = desc.createEndpointElement();
+ EndpointElement endpoint = parent.addEndpointElement();
endpoint.setParentElement(parent);
String name = OMUtils.getAttribute(endpointEl, Constants.ATTR_NAME);
Modified:
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/wsdl20/ServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/wsdl20/ServiceImpl.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/wsdl20/ServiceImpl.java
(original)
+++
incubator/woden/branches/WODEN-40/src/org/apache/woden/internal/wsdl20/ServiceImpl.java
Wed Aug 2 06:32:34 2006
@@ -169,14 +169,14 @@
}
/* (non-Javadoc)
- * @see
org.apache.woden.wsdl20.xml.ServiceElement#addEndpointElement(org.apache.woden.wsdl20.xml.EndpointElement)
+ * @see org.apache.woden.wsdl20.xml.ServiceElement#addEndpointElement()
*/
- public void addEndpointElement(EndpointElement endpoint)
+ public EndpointElement addEndpointElement()
{
- if(endpoint != null) {
- fEndpoints.add(endpoint);
- endpoint.setParentElement(this);
- }
+ EndpointElement endpoint = new EndpointImpl();
+ fEndpoints.add(endpoint);
+ endpoint.setParentElement(this);
+ return endpoint;
}
/* (non-Javadoc)
Modified:
incubator/woden/branches/WODEN-40/src/org/apache/woden/wsdl20/xml/ServiceElement.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/src/org/apache/woden/wsdl20/xml/ServiceElement.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/src/org/apache/woden/wsdl20/xml/ServiceElement.java
(original)
+++
incubator/woden/branches/WODEN-40/src/org/apache/woden/wsdl20/xml/ServiceElement.java
Wed Aug 2 06:32:34 2006
@@ -35,6 +35,6 @@
public QName getInterfaceName();
public InterfaceElement getInterfaceElement();
- public void addEndpointElement(EndpointElement endpoint);
+ public EndpointElement addEndpointElement();
public EndpointElement[] getEndpointElements();
}
Modified:
incubator/woden/branches/WODEN-40/test/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidatorTest.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidatorTest.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/test/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidatorTest.java
(original)
+++
incubator/woden/branches/WODEN-40/test/org/apache/woden/internal/wsdl20/validation/WSDLComponentValidatorTest.java
Wed Aug 2 06:32:34 2006
@@ -3175,8 +3175,7 @@
{
DescriptionImpl desc = new DescriptionImpl();
ServiceElement service = desc.createServiceElement();
- EndpointElement endpoint = desc.createEndpointElement();
- service.addEndpointElement(endpoint);
+ EndpointElement endpoint = service.addEndpointElement();
if(!val.testAssertionEndpoint0066(desc.getServices()[0].getEndpoints()[0],
reporter))
{
fail("The testAssertionEndpoint0066 method returned false for an
endpoint with no binding defined.");
@@ -3216,9 +3215,8 @@
binding.setName(name2);
ServiceElement service = desc.createServiceElement();
service.setInterfaceName(name1QN);
- EndpointElement endpoint = desc.createEndpointElement();
+ EndpointElement endpoint = service.addEndpointElement();
endpoint.setBindingName(name2QN);
- service.addEndpointElement(endpoint);
if(!val.testAssertionEndpoint0066(desc.getServices()[0].getEndpoints()[0],
reporter))
{
fail("The testAssertionEndpoint0066 method returned false for an
endpoint that specifies a binding with no specified interface.");
@@ -3241,9 +3239,8 @@
binding.setInterfaceName(name1QN);
ServiceElement service = desc.createServiceElement();
service.setInterfaceName(name1QN);
- EndpointElement endpoint = desc.createEndpointElement();
+ EndpointElement endpoint = service.addEndpointElement();
endpoint.setBindingName(name2QN);
- service.addEndpointElement(endpoint);
if(!val.testAssertionEndpoint0066(desc.getServices()[0].getEndpoints()[0],
reporter))
{
fail("The testAssertionEndpoint0066 method returned false for an
endpoint that specifies a binding with the same interface specified as the
parent service specifies.");
@@ -3269,9 +3266,8 @@
binding.setInterfaceName(name2QN);
ServiceElement service = desc.createServiceElement();
service.setInterfaceName(name1QN);
- EndpointElement endpoint = desc.createEndpointElement();
+ EndpointElement endpoint = service.addEndpointElement();
endpoint.setBindingName(name3QN);
- service.addEndpointElement(endpoint);
if(val.testAssertionEndpoint0066(desc.getServices()[0].getEndpoints()[0],
reporter))
{
fail("The testAssertionEndpoint0066 method returned true for an
endpoint that specifies a binding with a different interface specified than the
parent service specifies.");
Modified:
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
(original)
+++
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
Wed Aug 2 06:32:34 2006
@@ -162,10 +162,10 @@
* present in the array returned by getEndpointElements.
*/
public void testAddAndGetEndpointElementFromOM(){
- EndpointElement endpoint = new EndpointImpl();
+ DescriptionElement descEl = new DescriptionImpl();
+ ServiceElement service = descEl.createServiceElement();
+ EndpointElement endpoint = service.addEndpointElement();
endpoint.setName(new NCName("endpoint99"));
- ServiceElement service = new ServiceImpl();
- service.addEndpointElement(endpoint);
assertTrue("The EndpointElement added by the
ServiceElement.addEndpointElement method " +
"was not returned by ServiceElement.getEndpointElements()",
endpoint == service.getEndpointElements()[0]);
Modified:
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java?rev=427977&r1=427976&r2=427977&view=diff
==============================================================================
---
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
(original)
+++
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
Wed Aug 2 06:32:34 2006
@@ -171,16 +171,13 @@
* Test that the EndpointElement added by the addEndpointElement method is
* present in the array returned by getEndpointElements.
*/
- public void testAddAndGetEndpointElement()
- {
- EndpointElement endpoint = new EndpointImpl();
+ public void testAddAndGetEndpointElementFromOM(){
+ DescriptionElement descEl = new DescriptionImpl();
+ ServiceElement service = descEl.createServiceElement();
+ EndpointElement endpoint = service.addEndpointElement();
endpoint.setName(new NCName("endpoint99"));
- ServiceElement service = new ServiceImpl();
- service.addEndpointElement(endpoint);
assertTrue("The EndpointElement added by the
ServiceElement.addEndpointElement method " +
"was not returned by ServiceElement.getEndpointElements()",
endpoint == service.getEndpointElements()[0]);
-
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]