Author: hughesj
Date: Wed Aug  2 06:40:53 2006
New Revision: 427979

URL: http://svn.apache.org/viewvc?rev=427979&view=rev
Log:
Refactored duplicate test:
OMServiceElementTest.testAddAndGetEndpointElementFromOM and 
ServiceElementTest.testAddAndGetEndpointElementFrom
were identical. Moved this test into ChildElementCreationTest and enhanced it.

Modified:
    
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.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/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java?rev=427979&r1=427978&r2=427979&view=diff
==============================================================================
--- 
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java
 (original)
+++ 
incubator/woden/branches/WODEN-40/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java
 Wed Aug  2 06:40:53 2006
@@ -131,4 +131,13 @@
         assertTrue("InterfaceMessageReferenceElement has incorrect parent", 
interfaceMREl.getParentElement() == interfaceOpEl);
     }
     
+    public void testEndpointElement() {
+        DescriptionElement descEl = new DescriptionImpl();
+        ServiceElement serviceEl = descEl.createServiceElement();
+        EndpointElement endpointEl = serviceEl.addEndpointElement();
+        
+        assertTrue("ServiceElement doesn't have correct EndpointElement",
+                
Arrays.asList(serviceEl.getEndpointElements()).contains(endpointEl));
+        assertTrue("EndpointElement has incorrect parent", 
endpointEl.getParentElement() == serviceEl);
+    }
 }

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=427979&r1=427978&r2=427979&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:40:53 2006
@@ -156,18 +156,4 @@
         assertTrue("ServiceElement.getEndpointElements() did not return 3 
endpoints, as expected.",
                 endpoints.length == 3);
     }
-
-    /**
-     * Test that the EndpointElement added by the addEndpointElement method is
-     * present in the array returned by getEndpointElements.
-     */
-    public void testAddAndGetEndpointElementFromOM(){
-        DescriptionElement descEl = new DescriptionImpl();
-        ServiceElement service = descEl.createServiceElement();
-        EndpointElement endpoint = service.addEndpointElement();
-        endpoint.setName(new NCName("endpoint99"));
-        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=427979&r1=427978&r2=427979&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:40:53 2006
@@ -166,18 +166,4 @@
         assertTrue("ServiceElement.getEndpointElements() did not return 3 
endpoints, as expected.",
                 endpoints.length == 3);
     }
-
-    /**
-     * Test that the EndpointElement added by the addEndpointElement method is
-     * present in the array returned by getEndpointElements.
-     */
-    public void testAddAndGetEndpointElementFromOM(){
-        DescriptionElement descEl = new DescriptionImpl();
-        ServiceElement service = descEl.createServiceElement();
-        EndpointElement endpoint = service.addEndpointElement();
-        endpoint.setName(new NCName("endpoint99"));
-        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]

Reply via email to