[Jboss-cvs] JBoss Messaging SVN: r1188 - in trunk: src/main/org/jboss/jms/util tests/etc/stress tests/src/org/jboss/test/messaging/util

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 3 21:25:47 EDT 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-08-03 21:25:44 -0400 (Thu, 03 Aug 2006)
New Revision: 1188

Modified:
   trunk/src/main/org/jboss/jms/util/XMLUtil.java
   trunk/tests/etc/stress/log4j.xml
   trunk/tests/src/org/jboss/test/messaging/util/XMLUtilTest.java
Log:
http://jira.jboss.com/jira/browse/JBMESSAGING-482

Modified: trunk/src/main/org/jboss/jms/util/XMLUtil.java
===================================================================
--- trunk/src/main/org/jboss/jms/util/XMLUtil.java	2006-08-03 20:11:09 UTC (rev 1187)
+++ trunk/src/main/org/jboss/jms/util/XMLUtil.java	2006-08-04 01:25:44 UTC (rev 1188)
@@ -59,6 +59,14 @@
    {
 
       String name = n.getNodeName();
+
+      short type = n.getNodeType();
+
+      if (Node.CDATA_SECTION_NODE == type)
+      {
+         return "<![CDATA[" + n.getNodeValue() + "]]>";
+      }
+
       if (name.startsWith("#"))
       {
          return "";
@@ -238,11 +246,19 @@
          throw new XMLRuntimeException("nodes have different node names");
       }
 
+      int attrCount = 0;
       NamedNodeMap attrs = node.getAttributes();
-      int attrCount = attrs.getLength();
+      if (attrs != null)
+      {
+         attrCount = attrs.getLength();
+      }
 
+      int attrCount2 = 0;
       NamedNodeMap attrs2 = node2.getAttributes();
-      int attrCount2 = attrs2.getLength();
+      if (attrs2 != null)
+      {
+         attrCount2 = attrs2.getLength();
+      }
 
       if (attrCount != attrCount2)
       {

Modified: trunk/tests/etc/stress/log4j.xml
===================================================================
--- trunk/tests/etc/stress/log4j.xml	2006-08-03 20:11:09 UTC (rev 1187)
+++ trunk/tests/etc/stress/log4j.xml	2006-08-04 01:25:44 UTC (rev 1188)
@@ -74,6 +74,11 @@
       <priority value="INFO"/>
    </category>
 
+   <category name="org.jboss">
+      <priority value="DEBUG"/>
+   </category>
+
+
    <!-- ======================= -->
    <!-- Setup the Root category -->
    <!-- ======================= -->

Modified: trunk/tests/src/org/jboss/test/messaging/util/XMLUtilTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/util/XMLUtilTest.java	2006-08-03 20:11:09 UTC (rev 1187)
+++ trunk/tests/src/org/jboss/test/messaging/util/XMLUtilTest.java	2006-08-04 01:25:44 UTC (rev 1188)
@@ -238,5 +238,15 @@
       XMLUtil.assertEquivalent(e, convertedAgain);
    }
 
+   public void testElementToString_4() throws Exception
+   {
+      String s = "<a><![CDATA[somedata]]></a>";
+      Element e = XMLUtil.stringToElement(s);
+      String tostring = XMLUtil.elementToString(e);
+      Element convertedAgain = XMLUtil.stringToElement(tostring);
+      XMLUtil.assertEquivalent(e, convertedAgain);
+   }
 
+
+
 }




More information about the jboss-cvs-commits mailing list