You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by he...@apache.org on 2005/07/28 14:34:10 UTC
svn commit: r225759 - in /webservices/axis/trunk/java/modules:
samples/project.xml xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
xml/test/org/apache/axis2/om/impl/OMBlankElementTest.java
Author: hemapani
Date: Thu Jul 28 05:33:52 2005
New Revision: 225759
URL: http://svn.apache.org/viewcvs?rev=225759&view=rev
Log:
fix the http://issues.apache.org/jira/browse/AXIS2-99
Added:
webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/OMBlankElementTest.java
Modified:
webservices/axis/trunk/java/modules/samples/project.xml
webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=225759&r1=225758&r2=225759&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Thu Jul 28 05:33:52 2005
@@ -166,10 +166,8 @@
<exclude>**/*InteropStubTest.java</exclude>
<exclude>**/*EchoRawXMLChunckedTest.java</exclude>
<exclude>**org/apache/axis2/mail/*.java</exclude>
-
- <!--Deepal SOAP test suit is failing due to some problem in AxisEngine some one has to fix that-->
-<!-- <exclude>**/*SOAP12Test.java</exclude>-->
-<!-- <exclude>**/*SOAP12TestWithFaults.java</exclude>-->
+ <exclude>**/*SOAP12Test.java</exclude>
+ <exclude>**/*SOAP12TestWithFaults.java</exclude>
<!-- <exclude>**/*MailEchoRawXMLTest.java</exclude>
<exclude>**/*MailOneWayRawXMLTest.java</exclude>
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java?rev=225759&r1=225758&r2=225759&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java Thu Jul 28 05:33:52 2005
@@ -108,7 +108,7 @@
*/
public OMElementImpl(String localName, OMNamespace ns) {
super(null);
- if(localName == null || "".equals(localName)){
+ if(localName == null || localName.trim().length() == 0){
throw new OMException("localname can not be null or empty");
}
this.localName = localName;
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/OMBlankElementTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/OMBlankElementTest.java?rev=225759&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/OMBlankElementTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/OMBlankElementTest.java Thu Jul 28 05:33:52 2005
@@ -0,0 +1,71 @@
+package org.apache.axis2.om.impl;
+
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMException;
+import org.apache.axis2.om.OMFactory;
+import org.apache.axis2.om.OMNamespace;
+
+public class OMBlankElementTest extends TestCase {
+
+ public OMBlankElementTest(String name) {
+ super(name);
+ }
+
+ public void testBlankOMElem() throws XMLStreamException {
+ try {
+ //We should not get anything as the return value here: the output of the serialization
+ String value = buildBlankOMElem();
+ System.out.println(value);
+ assertNull(
+ "There's a serialized output for a blank XML element that cannot exist",
+ value);
+ } catch (OMException e) {
+ }
+ }
+
+ String buildBlankOMElem() throws XMLStreamException {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace namespace1 = factory.createOMNamespace("", "");
+ OMElement elem1 = factory.createOMElement("", namespace1);
+
+ StringWriter writer = new StringWriter();
+ elem1.build();
+ elem1.serializeWithCache(
+ new OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
+ writer.flush();
+ return writer.toString();
+ }
+
+ public void testOMElemWithWhiteSpace() throws XMLStreamException {
+ try {
+ //We should not get anything as the return value here: the output of the serialization
+ String value = buildWithWhiteSpaceOMElem();
+ System.out.println(value);
+ assertNull(
+ "There's a serialized output for a blank XML element that cannot exist",
+ value);
+ } catch (OMException e) {
+ }
+ }
+
+ String buildWithWhiteSpaceOMElem() throws XMLStreamException {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace namespace1 = factory.createOMNamespace(" ", "");
+ OMElement elem1 = factory.createOMElement(" ", namespace1);
+
+ StringWriter writer = new StringWriter();
+ elem1.build();
+ elem1.serializeWithCache(
+ new OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
+ writer.flush();
+ return writer.toString();
+ }
+}