ws-woden-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkapu...@apache.org
Subject svn commit: r549106 - in /incubator/woden/trunk/java: src/org/apache/woden/internal/wsdl20/ src/org/apache/woden/wsdl20/xml/ test/org/apache/woden/tests/ test/org/apache/woden/wsdl20/xml/
Date Wed, 20 Jun 2007 13:39:50 GMT
Author: jkaputin
Date: Wed Jun 20 06:39:49 2007
New Revision: 549106

URL: http://svn.apache.org/viewvc?view=rev&rev=549106
Log:
WODEN-33
Changed DocumentElement so that it inherits from
NestedElement and implemented the set/getParentElement
methods. Added unit tests for DocumentationElement.

Added:
    incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java
Modified:
    incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentationImpl.java
    incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/DocumentationElement.java
    incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsDOM.java

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java?view=diff&rev=549106&r1=549105&r2=549106
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java
(original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java
Wed Jun 20 06:39:49 2007
@@ -41,6 +41,7 @@
     {
         DocumentationElement docEl = new DocumentationImpl();
         fDocumentationElements.add(docEl);
+        docEl.setParentElement(this);
         return docEl;
     }
 

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentationImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentationImpl.java?view=diff&rev=549106&r1=549105&r2=549106
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentationImpl.java
(original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/DocumentationImpl.java
Wed Jun 20 06:39:49 2007
@@ -17,6 +17,7 @@
 package org.apache.woden.internal.wsdl20;
 
 import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
 
 /**
  * This class implements support for parsing, creating and manipulating a
@@ -35,6 +36,7 @@
 public class DocumentationImpl extends WSDLElementImpl implements DocumentationElement 
 {
     private Object fContent;
+    private WSDLElement fParentElem = null;
     
     /* (non-Javadoc)
      * @see org.apache.woden.wsdl20.xml.DocumentationElement#setContentModel(java.lang.Object)
@@ -50,4 +52,17 @@
         return fContent;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.NestedElement#setParentElement(org.apache.woden.wsdl20.xml.WSDL20Element)
+     */
+    public void setParentElement(WSDLElement parent) {
+        fParentElem = parent;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.NestedElement#getParentElement()
+     */
+    public WSDLElement getParentElement() {
+        return fParentElem;
+    }
 }

Modified: incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/DocumentationElement.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/DocumentationElement.java?view=diff&rev=549106&r1=549105&r2=549106
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/DocumentationElement.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/wsdl20/xml/DocumentationElement.java Wed
Jun 20 06:39:49 2007
@@ -27,7 +27,7 @@
  * 
  * @author John Kaputin (jkaputin@apache.org)
  */
-public interface DocumentationElement extends WSDLElement {
+public interface DocumentationElement extends NestedElement {
     
     /**
      * @deprecated In M7, to be replaced in M8. See JIRA WODEN-142.

Modified: incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsDOM.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsDOM.java?view=diff&rev=549106&r1=549105&r2=549106
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsDOM.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsDOM.java Wed Jun 20
06:39:49 2007
@@ -59,6 +59,7 @@
 import org.apache.woden.wsdl20.xml.BindingMessageReferenceElementTest;
 import org.apache.woden.wsdl20.xml.BindingOperationElementTest;
 import org.apache.woden.wsdl20.xml.DescriptiontElementTest;
+import org.apache.woden.wsdl20.xml.DocumentationElementTest;
 import org.apache.woden.wsdl20.xml.EndpointElementTest;
 import org.apache.woden.wsdl20.xml.ImportElementTest;
 import org.apache.woden.wsdl20.xml.IncludeElementTest;
@@ -150,6 +151,7 @@
     addTest(BindingOperationTest.suite());
     addTest(BindingFaultReferenceTest.suite());
     addTest(BindingMessageReferenceTest.suite());
+    addTest(DocumentationElementTest.suite());
     //TODO in-progress 30May06 tests for BindingOpExt and BindingMsgRefExt
   }
 

Added: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java?view=auto&rev=549106
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java
(added)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java
Wed Jun 20 06:39:49 2007
@@ -0,0 +1,60 @@
+/**
+ * 
+ */
+package org.apache.woden.wsdl20.xml;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.internal.wsdl20.DescriptionImpl;
+
+/**
+ * Unit tests for DocumentationImpl class.
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ *
+ */
+public class DocumentationElementTest extends TestCase {
+
+    public static Test suite()
+    {
+       return new TestSuite(DocumentationElementTest.class);
+    }
+       
+
+    /**
+     * Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#setContent(java.lang.Object)}.
+     * Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#setContent(java.lang.Object)}.
+     */
+    public void testSetGetContent() {
+        DescriptionElement descElem = new DescriptionImpl();
+        DocumentationElement docElem = descElem.addDocumentationElement();
+        
+        //check that the doc element is empty when first created
+        assertNull(docElem.getContent());
+        
+        //test the setter and getter methods for doc elem content
+        docElem.setContent("Doc content");
+        assertEquals("Doc content", docElem.getContent());
+    }
+
+    /**
+     * Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#setParentElement(org.apache.woden.wsdl20.xml.WSDLElement)}.
+     * Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#getParentElement()}.
+     */
+    public void testSetGetParentElement() {
+        DescriptionElement descElem1 = new DescriptionImpl();
+        DocumentationElement docElem = descElem1.addDocumentationElement();
+        
+        //check the initial parent
+        assertEquals(descElem1, docElem.getParentElement());
+        
+        DescriptionElement descElem2 = new DescriptionImpl();
+        docElem.setParentElement(descElem2);
+        
+        //test that the parent has been changed by the set method
+        assertEquals(descElem2, docElem.getParentElement());
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org


Mime
View raw message