You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by th...@apache.org on 2006/10/11 14:46:21 UTC

svn commit: r462789 - /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java

Author: thilina
Date: Wed Oct 11 05:46:20 2006
New Revision: 462789

URL: http://svn.apache.org/viewvc?view=rev&rev=462789
Log:
Adding a test for llom to DOOM

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java?view=diff&rev=462789&r1=462788&r2=462789
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java Wed Oct 11 05:46:20 2006
@@ -17,6 +17,7 @@
 package org.apache.axiom.soap.impl.llom;
 
 import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMConstants;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -134,7 +135,6 @@
     	String text = "This was a DOOM Text";
     	
     	OMElement llomRoot = llomFactory.createOMElement("root",null);
-    	
     	OMElement doomElement = doomFactory.createOMElement("second","test","a");
     	doomElement.setText(text);
     	llomRoot.addChild(doomElement);
@@ -153,11 +153,44 @@
     	String text = "This was a DOOM Text";
     	
     	OMElement llomRoot = llomFactory.createOMElement("root",null);
-    	
     	OMText doomText = doomFactory.createOMText(text);
     	llomRoot.addChild(doomText);
     	
     	OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
+				.getXMLStreamReader())).getDocumentElement();
+		newElement.build();
+		assertEquals(newElement.getText(),text);		
+    }
+    public void testAddLLOMElementChildToDOOM() throws XMLStreamException {
+    	OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+    	OMFactory llomFactory = OMAbstractFactory.getOMFactory();
+    	String text = "This was a LLOM Text";
+    	
+    	OMElement doomRoot = doomFactory.createOMElement("root",null);
+    	OMElement llomElement = llomFactory.createOMElement("second","test","a");
+    	llomElement.setText(text);
+    	doomRoot.addChild(llomElement);
+    	
+    	OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
+				.getXMLStreamReader())).getDocumentElement();
+		newElement.build();
+		OMElement secondElement = newElement.getFirstElement();
+		assertNotNull(secondElement);
+		assertEquals(secondElement.getText(),text);		
+    }
+    
+    public void testAddLLOMTextChildToDOOM() throws XMLStreamException {
+    	OMFactory doomFactory = DOOMAbstractFactory.getOMFactory();
+    	OMFactory llomFactory = OMAbstractFactory.getOMFactory();
+    	String text = "This was a DOOM Text";
+    	
+    	OMElement doomRoot = doomFactory.createOMElement("root",null);
+    	OMText llomText = llomFactory.createOMText(text);
+    	OMComment comment = llomFactory.createOMComment(null,"comment");
+    	doomRoot.addChild(llomText);
+    	doomRoot.addChild(comment);
+    	
+    	OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
 				.getXMLStreamReader())).getDocumentElement();
 		newElement.build();
 		assertEquals(newElement.getText(),text);		



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